OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MEDIA_FILTERS_VIDEO_FRAME_GENERATOR_H_ |
| 6 #define MEDIA_FILTERS_VIDEO_FRAME_GENERATOR_H_ |
| 7 |
| 8 #include "media/base/filters.h" |
| 9 #include "media/base/pipeline_status.h" |
| 10 |
| 11 namespace base { |
| 12 class MessageLoopProxy; |
| 13 } |
| 14 |
| 15 namespace media { |
| 16 |
| 17 class DemuxerStream; |
| 18 class VideoFrame; |
| 19 |
| 20 // A filter generates raw frames and passes them to media engine as a video |
| 21 // decoder filter. |
| 22 class MEDIA_EXPORT VideoFrameGenerator |
| 23 : public VideoDecoder { |
| 24 public: |
| 25 VideoFrameGenerator( |
| 26 base::MessageLoopProxy* message_loop_proxy, |
| 27 const gfx::Size& size, |
| 28 const base::TimeDelta& frame_duration); |
| 29 virtual ~VideoFrameGenerator(); |
| 30 |
| 31 // Filter implementation. |
| 32 virtual void Stop(const base::Closure& callback) OVERRIDE; |
| 33 |
| 34 // Decoder implementation. |
| 35 virtual void Initialize( |
| 36 DemuxerStream* demuxer_stream, |
| 37 const PipelineStatusCB& filter_callback, |
| 38 const StatisticsCallback& stat_callback) OVERRIDE; |
| 39 virtual void Read(const ReadCB& callback) OVERRIDE; |
| 40 virtual const gfx::Size& natural_size() OVERRIDE; |
| 41 |
| 42 private: |
| 43 void StopOnDecoderThread(const base::Closure& callback); |
| 44 |
| 45 void InitializeOnDecoderThread( |
| 46 DemuxerStream* demuxer_stream, |
| 47 const PipelineStatusCB& filter_callback, |
| 48 const StatisticsCallback& stat_callback); |
| 49 void ReadOnDecoderThread(const ReadCB& callback); |
| 50 |
| 51 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; |
| 52 gfx::Size natural_size_; |
| 53 bool stopped_; |
| 54 |
| 55 base::TimeDelta current_time_; |
| 56 base::TimeDelta frame_duration_; |
| 57 |
| 58 DISALLOW_COPY_AND_ASSIGN(VideoFrameGenerator); |
| 59 }; |
| 60 |
| 61 } // namespace media |
| 62 |
| 63 #endif // MEDIA_FILTERS_VIDEO_FRAME_GENERATOR_H_ |
OLD | NEW |