| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // Filter implementation. | 30 // Filter implementation. |
| 31 virtual void Stop(FilterCallback* callback); | 31 virtual void Stop(FilterCallback* callback); |
| 32 virtual void Seek(base::TimeDelta time, const FilterStatusCB& cb); | 32 virtual void Seek(base::TimeDelta time, const FilterStatusCB& cb); |
| 33 virtual void Pause(FilterCallback* callback); | 33 virtual void Pause(FilterCallback* callback); |
| 34 virtual void Flush(FilterCallback* callback); | 34 virtual void Flush(FilterCallback* callback); |
| 35 | 35 |
| 36 // Decoder implementation. | 36 // Decoder implementation. |
| 37 virtual void Initialize(DemuxerStream* demuxer_stream, | 37 virtual void Initialize(DemuxerStream* demuxer_stream, |
| 38 FilterCallback* callback, | 38 FilterCallback* callback, |
| 39 StatisticsCallback* stats_callback); | 39 StatisticsCallback* stats_callback); |
| 40 virtual const MediaFormat& media_format(); | |
| 41 virtual void ProduceVideoFrame(scoped_refptr<VideoFrame> video_frame); | 40 virtual void ProduceVideoFrame(scoped_refptr<VideoFrame> video_frame); |
| 42 virtual bool ProvidesBuffer(); | 41 virtual bool ProvidesBuffer(); |
| 42 virtual int width(); |
| 43 virtual int height(); |
| 43 | 44 |
| 44 private: | 45 private: |
| 45 // VideoDecodeEngine::EventHandler interface. | 46 // VideoDecodeEngine::EventHandler interface. |
| 46 virtual void OnInitializeComplete(const VideoCodecInfo& info); | 47 virtual void OnInitializeComplete(const VideoCodecInfo& info); |
| 47 virtual void OnUninitializeComplete(); | 48 virtual void OnUninitializeComplete(); |
| 48 virtual void OnFlushComplete(); | 49 virtual void OnFlushComplete(); |
| 49 virtual void OnSeekComplete(); | 50 virtual void OnSeekComplete(); |
| 50 virtual void OnError(); | 51 virtual void OnError(); |
| 51 virtual void OnFormatChange(VideoStreamInfo stream_info); | 52 virtual void OnFormatChange(VideoStreamInfo stream_info); |
| 52 virtual void ProduceVideoSample(scoped_refptr<Buffer> buffer); | 53 virtual void ProduceVideoSample(scoped_refptr<Buffer> buffer); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 void OnReadCompleteTask(scoped_refptr<Buffer> buffer); | 85 void OnReadCompleteTask(scoped_refptr<Buffer> buffer); |
| 85 | 86 |
| 86 // Flush the output buffers that we had held in Paused state. | 87 // Flush the output buffers that we had held in Paused state. |
| 87 void FlushBuffers(); | 88 void FlushBuffers(); |
| 88 | 89 |
| 89 // Injection point for unittest to provide a mock engine. Takes ownership of | 90 // Injection point for unittest to provide a mock engine. Takes ownership of |
| 90 // the provided engine. | 91 // the provided engine. |
| 91 virtual void SetVideoDecodeEngineForTest(VideoDecodeEngine* engine); | 92 virtual void SetVideoDecodeEngineForTest(VideoDecodeEngine* engine); |
| 92 | 93 |
| 93 MessageLoop* message_loop_; | 94 MessageLoop* message_loop_; |
| 94 MediaFormat media_format_; | |
| 95 | 95 |
| 96 PtsStream pts_stream_; // Stream of presentation timestamps. | 96 PtsStream pts_stream_; // Stream of presentation timestamps. |
| 97 DecoderState state_; | 97 DecoderState state_; |
| 98 scoped_ptr<VideoDecodeEngine> decode_engine_; | 98 scoped_ptr<VideoDecodeEngine> decode_engine_; |
| 99 scoped_ptr<VideoDecodeContext> decode_context_; | 99 scoped_ptr<VideoDecodeContext> decode_context_; |
| 100 | 100 |
| 101 scoped_ptr<FilterCallback> initialize_callback_; | 101 scoped_ptr<FilterCallback> initialize_callback_; |
| 102 scoped_ptr<FilterCallback> uninitialize_callback_; | 102 scoped_ptr<FilterCallback> uninitialize_callback_; |
| 103 scoped_ptr<FilterCallback> flush_callback_; | 103 scoped_ptr<FilterCallback> flush_callback_; |
| 104 FilterStatusCB seek_cb_; | 104 FilterStatusCB seek_cb_; |
| 105 scoped_ptr<StatisticsCallback> statistics_callback_; | 105 scoped_ptr<StatisticsCallback> statistics_callback_; |
| 106 | 106 |
| 107 // Hold video frames when flush happens. | 107 // Hold video frames when flush happens. |
| 108 std::deque<scoped_refptr<VideoFrame> > frame_queue_flushed_; | 108 std::deque<scoped_refptr<VideoFrame> > frame_queue_flushed_; |
| 109 | 109 |
| 110 VideoCodecInfo info_; | 110 VideoCodecInfo info_; |
| 111 | 111 |
| 112 // Pointer to the demuxer stream that will feed us compressed buffers. | 112 // Pointer to the demuxer stream that will feed us compressed buffers. |
| 113 scoped_refptr<DemuxerStream> demuxer_stream_; | 113 scoped_refptr<DemuxerStream> demuxer_stream_; |
| 114 | 114 |
| 115 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder); | 115 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder); |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 } // namespace media | 118 } // namespace media |
| 119 | 119 |
| 120 #endif // MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ | 120 #endif // MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ |
| OLD | NEW |