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

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

Issue 6171009: Remove MessageLoop methods from Filter interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Applied more CR suggestions & removed message_loop() methods where possible. Created 9 years, 11 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 | « media/filters/ffmpeg_video_decoder_unittest.cc ('k') | media/filters/omx_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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_OMX_VIDEO_DECODER_H_ 5 #ifndef MEDIA_FILTERS_OMX_VIDEO_DECODER_H_
6 #define MEDIA_FILTERS_OMX_VIDEO_DECODER_H_ 6 #define MEDIA_FILTERS_OMX_VIDEO_DECODER_H_
7 7
8 #include <queue> 8 #include <queue>
9 9
10 #include "media/base/filters.h" 10 #include "media/base/filters.h"
11 #include "media/base/media_format.h" 11 #include "media/base/media_format.h"
12 #include "media/video/video_decode_context.h" 12 #include "media/video/video_decode_context.h"
13 #include "media/video/video_decode_engine.h" 13 #include "media/video/video_decode_engine.h"
14 14
15 class MessageLoop; 15 class MessageLoop;
16 16
17 namespace media { 17 namespace media {
18 18
19 class Buffer; 19 class Buffer;
20 class OmxVideoDecodeEngine; 20 class OmxVideoDecodeEngine;
21 class VideoFrame; 21 class VideoFrame;
22 22
23 class OmxVideoDecoder : public VideoDecoder, 23 class OmxVideoDecoder : public VideoDecoder,
24 public VideoDecodeEngine::EventHandler { 24 public VideoDecodeEngine::EventHandler {
25 public: 25 public:
26 explicit OmxVideoDecoder(VideoDecodeContext* decode_context); 26 OmxVideoDecoder(MessageLoop* message_loop,
27 VideoDecodeContext* decode_context);
27 virtual ~OmxVideoDecoder(); 28 virtual ~OmxVideoDecoder();
28 29
29 // Filter implementations. 30 // Filter implementations.
30 virtual void Initialize(DemuxerStream* stream, FilterCallback* callback); 31 virtual void Initialize(DemuxerStream* stream, FilterCallback* callback);
31 virtual void Stop(FilterCallback* callback); 32 virtual void Stop(FilterCallback* callback);
32 virtual void Flush(FilterCallback* callback); 33 virtual void Flush(FilterCallback* callback);
33 virtual void Seek(base::TimeDelta time, FilterCallback* callback); 34 virtual void Seek(base::TimeDelta time, FilterCallback* callback);
34 virtual void ProduceVideoFrame(scoped_refptr<VideoFrame> frame); 35 virtual void ProduceVideoFrame(scoped_refptr<VideoFrame> frame);
35 virtual bool ProvidesBuffer(); 36 virtual bool ProvidesBuffer();
36 virtual const MediaFormat& media_format(); 37 virtual const MediaFormat& media_format();
37 38
38 private: 39 private:
39 // VideoDecodeEngine::EventHandler interface. 40 // VideoDecodeEngine::EventHandler interface.
40 virtual void OnInitializeComplete(const VideoCodecInfo& info); 41 virtual void OnInitializeComplete(const VideoCodecInfo& info);
41 virtual void OnUninitializeComplete(); 42 virtual void OnUninitializeComplete();
42 virtual void OnFlushComplete(); 43 virtual void OnFlushComplete();
43 virtual void OnSeekComplete(); 44 virtual void OnSeekComplete();
44 virtual void OnError(); 45 virtual void OnError();
45 virtual void OnFormatChange(VideoStreamInfo stream_info); 46 virtual void OnFormatChange(VideoStreamInfo stream_info);
46 virtual void ProduceVideoSample(scoped_refptr<Buffer> buffer); 47 virtual void ProduceVideoSample(scoped_refptr<Buffer> buffer);
47 virtual void ConsumeVideoFrame(scoped_refptr<VideoFrame> frame); 48 virtual void ConsumeVideoFrame(scoped_refptr<VideoFrame> frame);
48 49
49 // TODO(hclam): This is very ugly that we keep reference instead of 50 // TODO(hclam): This is very ugly that we keep reference instead of
50 // scoped_refptr. 51 // scoped_refptr.
51 void DemuxCompleteTask(Buffer* buffer); 52 void DemuxCompleteTask(Buffer* buffer);
52 53
54 MessageLoop* message_loop_;
55
53 // Pointer to the demuxer stream that will feed us compressed buffers. 56 // Pointer to the demuxer stream that will feed us compressed buffers.
54 scoped_refptr<DemuxerStream> demuxer_stream_; 57 scoped_refptr<DemuxerStream> demuxer_stream_;
55 scoped_ptr<VideoDecodeEngine> decode_engine_; 58 scoped_ptr<VideoDecodeEngine> decode_engine_;
56 scoped_ptr<VideoDecodeContext> decode_context_; 59 scoped_ptr<VideoDecodeContext> decode_context_;
57 MediaFormat media_format_; 60 MediaFormat media_format_;
58 size_t width_; 61 size_t width_;
59 size_t height_; 62 size_t height_;
60 63
61 scoped_ptr<FilterCallback> initialize_callback_; 64 scoped_ptr<FilterCallback> initialize_callback_;
62 scoped_ptr<FilterCallback> uninitialize_callback_; 65 scoped_ptr<FilterCallback> uninitialize_callback_;
63 scoped_ptr<FilterCallback> flush_callback_; 66 scoped_ptr<FilterCallback> flush_callback_;
64 scoped_ptr<FilterCallback> seek_callback_; 67 scoped_ptr<FilterCallback> seek_callback_;
65 68
66 VideoCodecInfo info_; 69 VideoCodecInfo info_;
67 70
68 DISALLOW_COPY_AND_ASSIGN(OmxVideoDecoder); 71 DISALLOW_COPY_AND_ASSIGN(OmxVideoDecoder);
69 }; 72 };
70 73
71 } // namespace media 74 } // namespace media
72 75
73 #endif // MEDIA_FILTERS_OMX_VIDEO_DECODER_H_ 76 #endif // MEDIA_FILTERS_OMX_VIDEO_DECODER_H_
OLDNEW
« no previous file with comments | « media/filters/ffmpeg_video_decoder_unittest.cc ('k') | media/filters/omx_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698