Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "media/base/decryptor.h" | 10 #include "media/base/decryptor.h" |
| 11 #include "media/base/demuxer_stream.h" | 11 #include "media/base/demuxer_stream.h" |
| 12 #include "media/base/video_decoder.h" | 12 #include "media/base/video_decoder.h" |
| 13 | 13 |
| 14 class MessageLoop; | |
| 15 | |
| 16 struct AVCodecContext; | 14 struct AVCodecContext; |
| 17 struct AVFrame; | 15 struct AVFrame; |
| 18 | 16 |
| 17 namespace base { | |
| 18 class MessageLoopProxy; | |
| 19 } | |
| 20 | |
| 19 namespace media { | 21 namespace media { |
| 20 | 22 |
| 21 class DecoderBuffer; | 23 class DecoderBuffer; |
| 22 | 24 |
| 23 class MEDIA_EXPORT FFmpegVideoDecoder : public VideoDecoder { | 25 class MEDIA_EXPORT FFmpegVideoDecoder : public VideoDecoder { |
| 24 public: | 26 public: |
| 25 FFmpegVideoDecoder(const base::Callback<MessageLoop*()>& message_loop_cb, | 27 typedef base::Callback<scoped_refptr<base::MessageLoopProxy>()> MessageLoopCB; |
|
Ami GONE FROM CHROMIUM
2012/08/10 04:38:06
ditto (here and elsewhere)
xhwang
2012/08/10 19:33:33
Done.
| |
| 28 FFmpegVideoDecoder(const MessageLoopCB& message_loop_cb, | |
| 26 Decryptor* decryptor); | 29 Decryptor* decryptor); |
| 27 | 30 |
| 28 // VideoDecoder implementation. | 31 // VideoDecoder implementation. |
| 29 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, | 32 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, |
| 30 const PipelineStatusCB& status_cb, | 33 const PipelineStatusCB& status_cb, |
| 31 const StatisticsCB& statistics_cb) OVERRIDE; | 34 const StatisticsCB& statistics_cb) OVERRIDE; |
| 32 virtual void Read(const ReadCB& read_cb) OVERRIDE; | 35 virtual void Read(const ReadCB& read_cb) OVERRIDE; |
| 33 virtual void Reset(const base::Closure& closure) OVERRIDE; | 36 virtual void Reset(const base::Closure& closure) OVERRIDE; |
| 34 virtual void Stop(const base::Closure& closure) OVERRIDE; | 37 virtual void Stop(const base::Closure& closure) OVERRIDE; |
| 35 | 38 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 80 // and resets them to NULL. | 83 // and resets them to NULL. |
| 81 void ReleaseFFmpegResources(); | 84 void ReleaseFFmpegResources(); |
| 82 | 85 |
| 83 // Reset decoder and call |reset_cb_|. | 86 // Reset decoder and call |reset_cb_|. |
| 84 void DoReset(); | 87 void DoReset(); |
| 85 | 88 |
| 86 // Free decoder resources and call |stop_cb_|. | 89 // Free decoder resources and call |stop_cb_|. |
| 87 void DoStop(); | 90 void DoStop(); |
| 88 | 91 |
| 89 // This is !is_null() iff Initialize() hasn't been called. | 92 // This is !is_null() iff Initialize() hasn't been called. |
| 90 base::Callback<MessageLoop*()> message_loop_factory_cb_; | 93 MessageLoopCB message_loop_factory_cb_; |
| 91 | 94 |
| 92 MessageLoop* message_loop_; | 95 scoped_refptr<base::MessageLoopProxy> message_loop_; |
| 93 | 96 |
| 94 DecoderState state_; | 97 DecoderState state_; |
| 95 | 98 |
| 96 StatisticsCB statistics_cb_; | 99 StatisticsCB statistics_cb_; |
| 97 | 100 |
| 98 ReadCB read_cb_; | 101 ReadCB read_cb_; |
| 99 base::Closure reset_cb_; | 102 base::Closure reset_cb_; |
| 100 base::Closure stop_cb_; | 103 base::Closure stop_cb_; |
| 101 | 104 |
| 102 // FFmpeg structures owned by this object. | 105 // FFmpeg structures owned by this object. |
| 103 AVCodecContext* codec_context_; | 106 AVCodecContext* codec_context_; |
| 104 AVFrame* av_frame_; | 107 AVFrame* av_frame_; |
| 105 | 108 |
| 106 // Pointer to the demuxer stream that will feed us compressed buffers. | 109 // Pointer to the demuxer stream that will feed us compressed buffers. |
| 107 scoped_refptr<DemuxerStream> demuxer_stream_; | 110 scoped_refptr<DemuxerStream> demuxer_stream_; |
| 108 | 111 |
| 109 Decryptor* decryptor_; | 112 Decryptor* decryptor_; |
| 110 | 113 |
| 111 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder); | 114 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder); |
| 112 }; | 115 }; |
| 113 | 116 |
| 114 } // namespace media | 117 } // namespace media |
| 115 | 118 |
| 116 #endif // MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ | 119 #endif // MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ |
| OLD | NEW |