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

Side by Side Diff: media/filters/ffmpeg_video_decoder.h

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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | media/filters/ffmpeg_video_decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ 5 #ifndef MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_
6 #define MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ 6 #define MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_
7 7
8 #include <list> 8 #include <list>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 13 matching lines...) Expand all
24 namespace media { 24 namespace media {
25 25
26 class DecoderBuffer; 26 class DecoderBuffer;
27 27
28 class MEDIA_EXPORT FFmpegVideoDecoder : public VideoDecoder { 28 class MEDIA_EXPORT FFmpegVideoDecoder : public VideoDecoder {
29 public: 29 public:
30 explicit FFmpegVideoDecoder( 30 explicit FFmpegVideoDecoder(
31 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); 31 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
32 virtual ~FFmpegVideoDecoder(); 32 virtual ~FFmpegVideoDecoder();
33 33
34 // Allow decoding of individual NALU. Entire frames are required by default.
35 // Disables low-latency mode. Must be called before Initialize().
36 void set_decode_nalus(bool decode_nalus) { decode_nalus_ = decode_nalus; }
37
34 // VideoDecoder implementation. 38 // VideoDecoder implementation.
35 virtual void Initialize(const VideoDecoderConfig& config, 39 virtual void Initialize(const VideoDecoderConfig& config,
36 bool low_delay, 40 bool low_delay,
37 const PipelineStatusCB& status_cb) OVERRIDE; 41 const PipelineStatusCB& status_cb) OVERRIDE;
38 virtual void Decode(const scoped_refptr<DecoderBuffer>& buffer, 42 virtual void Decode(const scoped_refptr<DecoderBuffer>& buffer,
39 const DecodeCB& decode_cb) OVERRIDE; 43 const DecodeCB& decode_cb) OVERRIDE;
40 virtual void Reset(const base::Closure& closure) OVERRIDE; 44 virtual void Reset(const base::Closure& closure) OVERRIDE;
41 virtual void Stop() OVERRIDE; 45 virtual void Stop() OVERRIDE;
42 46
43 // Callback called from within FFmpeg to allocate a buffer based on 47 // Callback called from within FFmpeg to allocate a buffer based on
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 DecodeCB decode_cb_; 81 DecodeCB decode_cb_;
78 82
79 // FFmpeg structures owned by this object. 83 // FFmpeg structures owned by this object.
80 scoped_ptr<AVCodecContext, ScopedPtrAVFreeContext> codec_context_; 84 scoped_ptr<AVCodecContext, ScopedPtrAVFreeContext> codec_context_;
81 scoped_ptr<AVFrame, ScopedPtrAVFreeFrame> av_frame_; 85 scoped_ptr<AVFrame, ScopedPtrAVFreeFrame> av_frame_;
82 86
83 VideoDecoderConfig config_; 87 VideoDecoderConfig config_;
84 88
85 VideoFramePool frame_pool_; 89 VideoFramePool frame_pool_;
86 90
91 bool decode_nalus_;
92
87 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder); 93 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder);
88 }; 94 };
89 95
90 } // namespace media 96 } // namespace media
91 97
92 #endif // MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ 98 #endif // MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_
OLDNEW
« no previous file with comments | « no previous file | media/filters/ffmpeg_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698