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

Unified Diff: media/filters/ffmpeg_video_decoder.h

Issue 8417019: Simplify VideoDecodeEngine interface by making everything synchronous. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup++ Created 9 years, 2 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 | « no previous file | media/filters/ffmpeg_video_decoder.cc » ('j') | media/filters/ffmpeg_video_decoder.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_video_decoder.h
diff --git a/media/filters/ffmpeg_video_decoder.h b/media/filters/ffmpeg_video_decoder.h
index a421c8cd42cb00c99842f7581ffaaa717b1555b4..c6c19a93d0c8c318b25e0ef052fc2b9df946180e 100644
--- a/media/filters/ffmpeg_video_decoder.h
+++ b/media/filters/ffmpeg_video_decoder.h
@@ -7,9 +7,10 @@
#include <deque>
+#include "base/memory/scoped_ptr.h"
#include "media/base/filters.h"
#include "media/base/pts_stream.h"
-#include "media/video/video_decode_engine.h"
+#include "ui/gfx/size.h"
class MessageLoop;
@@ -18,8 +19,7 @@ namespace media {
class VideoDecodeEngine;
class MEDIA_EXPORT FFmpegVideoDecoder
- : public VideoDecoder,
- public VideoDecodeEngine::EventHandler {
+ : public VideoDecoder {
acolwell GONE FROM CHROMIUM 2011/10/28 17:38:47 fits on line above?
scherkus (not reviewing) 2011/11/01 04:18:26 Done.
public:
explicit FFmpegVideoDecoder(MessageLoop* message_loop);
virtual ~FFmpegVideoDecoder();
@@ -39,58 +39,27 @@ class MEDIA_EXPORT FFmpegVideoDecoder
virtual gfx::Size natural_size() OVERRIDE;
private:
- // VideoDecodeEngine::EventHandler interface.
- virtual void OnInitializeComplete(bool success) OVERRIDE;
- virtual void OnUninitializeComplete() OVERRIDE;
- virtual void OnFlushComplete() OVERRIDE;
- virtual void OnSeekComplete() OVERRIDE;
- virtual void OnError() OVERRIDE;
- virtual void ProduceVideoSample(scoped_refptr<Buffer> buffer) OVERRIDE;
- virtual void ConsumeVideoFrame(
- scoped_refptr<VideoFrame> frame,
- const PipelineStatistics& statistics) OVERRIDE;
-
enum DecoderState {
- kUnInitialized,
- kInitializing,
+ kUninitialized,
kNormal,
kFlushCodec,
kDecodeFinished,
- kPausing,
- kFlushing,
- kStopped
};
- void OnFlushComplete(const base::Closure& callback);
- void OnSeekComplete(const base::Closure& callback);
- void OnReadComplete(Buffer* buffer);
-
- // TODO(jiesun): until demuxer pass scoped_refptr<Buffer>: we could not merge
- // this with OnReadComplete
- void OnReadCompleteTask(scoped_refptr<Buffer> buffer);
+ void DoDecodeBuffer(const scoped_refptr<Buffer>& buffer);
- // Flush the output buffers that we had held in Paused state.
- void FlushBuffers();
-
- // Injection point for unittest to provide a mock engine. Takes ownership of
- // the provided engine.
- virtual void SetVideoDecodeEngineForTest(VideoDecodeEngine* engine);
+ // Reads from the demuxer stream with corresponding callback method.
+ void ReadFromDemuxerStream();
+ void DecodeBuffer(Buffer* buffer);
MessageLoop* message_loop_;
- PtsStream pts_stream_; // Stream of presentation timestamps.
+ PtsStream pts_stream_;
DecoderState state_;
scoped_ptr<VideoDecodeEngine> decode_engine_;
- base::Closure initialize_callback_;
- base::Closure uninitialize_callback_;
- base::Closure flush_callback_;
- FilterStatusCB seek_cb_;
StatisticsCallback statistics_callback_;
- // Hold video frames when flush happens.
- std::deque<scoped_refptr<VideoFrame> > frame_queue_flushed_;
-
// TODO(scherkus): I think this should be calculated by VideoRenderers based
// on information provided by VideoDecoders (i.e., aspect ratio).
gfx::Size natural_size_;
« no previous file with comments | « no previous file | media/filters/ffmpeg_video_decoder.cc » ('j') | media/filters/ffmpeg_video_decoder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698