Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(902)

Unified Diff: media/filters/ffmpeg_video_decoder.cc

Issue 301243008: Allow ffmpeg to process individual NALU rather than require frames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ranamed setter as requested Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/ffmpeg_video_decoder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_video_decoder.cc
diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc
index aaa8a684c703d452ec5cfb1382db9d89ad250053..f56a356e758d6c555b82933b07dc412d27548d41 100644
--- a/media/filters/ffmpeg_video_decoder.cc
+++ b/media/filters/ffmpeg_video_decoder.cc
@@ -68,7 +68,8 @@ static void ReleaseVideoBufferImpl(void* opaque, uint8* data) {
FFmpegVideoDecoder::FFmpegVideoDecoder(
const scoped_refptr<base::SingleThreadTaskRunner>& task_runner)
- : task_runner_(task_runner), state_(kUninitialized) {}
+ : task_runner_(task_runner), state_(kUninitialized),
+ decode_nalus_(false) {}
int FFmpegVideoDecoder::GetVideoBuffer(struct AVCodecContext* codec_context,
AVFrame* frame,
@@ -360,6 +361,9 @@ bool FFmpegVideoDecoder::ConfigureDecoder(bool low_delay) {
codec_context_->get_buffer2 = GetVideoBufferImpl;
codec_context_->refcounted_frames = 1;
+ if (decode_nalus_)
+ codec_context_->flags2 |= CODEC_FLAG2_CHUNKS;
+
AVCodec* codec = avcodec_find_decoder(codec_context_->codec_id);
if (!codec || avcodec_open2(codec_context_.get(), codec, NULL) < 0) {
ReleaseFFmpegResources();
« no previous file with comments | « media/filters/ffmpeg_video_decoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698