From 70a9edbb1181302caff7f4d1147e60bfa124568a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Colin=20G=C3=BCnther?= Date: Tue, 15 Jul 2014 23:31:54 +0200 Subject: [PATCH] FFMPEG plugin: Tell the FFMPEG library to handle incomplete data. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - It is just one flag that needs to be set, so that streaming video data can be handled by the FFMPEG library. - For reference: This flag is based on FFMPEG's 0.10.2 video decode example (doc/example/decoding_encoding.c). - The _DecodeNextVideoFrame() method needs to be adjusted (still to come), to take streamed data into account. So the flag on its own doesn't help, but it is a reasonable step in that direction. Signed-off-by: Colin Günther --- src/add-ons/media/plugins/ffmpeg/AVCodecDecoder.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/add-ons/media/plugins/ffmpeg/AVCodecDecoder.cpp b/src/add-ons/media/plugins/ffmpeg/AVCodecDecoder.cpp index 9db9929cbe..8d52cc5c30 100644 --- a/src/add-ons/media/plugins/ffmpeg/AVCodecDecoder.cpp +++ b/src/add-ons/media/plugins/ffmpeg/AVCodecDecoder.cpp @@ -430,6 +430,11 @@ AVCodecDecoder::_NegotiateVideoOutputFormat(media_format* inOutFormat) fContext->extradata = (uint8_t*)fExtraData; fContext->extradata_size = fExtraDataSize; + if (fCodec->capabilities & CODEC_CAP_TRUNCATED) + // Expect and handle video frames to be splitted across consecutive + // data chunks. + fContext->flags |= CODEC_FLAG_TRUNCATED; + TRACE(" requested video format 0x%x\n", inOutFormat->u.raw_video.display.format);