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 <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "base/callback.h" | |
| 10 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 11 #include "media/base/filters.h" | 12 #include "media/base/filters.h" |
| 12 #include "media/crypto/aes_decryptor.h" | 13 #include "media/crypto/aes_decryptor.h" |
| 13 #include "ui/gfx/size.h" | 14 #include "ui/gfx/size.h" |
| 14 | 15 |
| 15 class MessageLoop; | 16 class MessageLoop; |
| 16 | 17 |
| 17 struct AVCodecContext; | 18 struct AVCodecContext; |
| 18 struct AVFrame; | 19 struct AVFrame; |
| 19 | 20 |
| 20 namespace media { | 21 namespace media { |
| 21 | 22 |
| 23 class MessageLoopFactory; | |
|
Ami GONE FROM CHROMIUM
2012/03/09 16:15:06
unnecessary
tommi (sloooow) - chröme
2012/03/11 18:49:36
Done.
| |
| 24 | |
| 22 class MEDIA_EXPORT FFmpegVideoDecoder : public VideoDecoder { | 25 class MEDIA_EXPORT FFmpegVideoDecoder : public VideoDecoder { |
| 23 public: | 26 public: |
| 24 explicit FFmpegVideoDecoder(MessageLoop* message_loop); | 27 FFmpegVideoDecoder(const base::Callback<MessageLoop*()>& message_loop_cb); |
| 25 virtual ~FFmpegVideoDecoder(); | 28 virtual ~FFmpegVideoDecoder(); |
| 26 | 29 |
| 27 // Filter implementation. | 30 // Filter implementation. |
| 28 virtual void Stop(const base::Closure& callback) OVERRIDE; | 31 virtual void Stop(const base::Closure& callback) OVERRIDE; |
| 29 virtual void Seek(base::TimeDelta time, const FilterStatusCB& cb) OVERRIDE; | 32 virtual void Seek(base::TimeDelta time, const FilterStatusCB& cb) OVERRIDE; |
| 30 virtual void Pause(const base::Closure& callback) OVERRIDE; | 33 virtual void Pause(const base::Closure& callback) OVERRIDE; |
| 31 virtual void Flush(const base::Closure& callback) OVERRIDE; | 34 virtual void Flush(const base::Closure& callback) OVERRIDE; |
| 32 | 35 |
| 33 // VideoDecoder implementation. | 36 // VideoDecoder implementation. |
| 34 virtual void Initialize(DemuxerStream* demuxer_stream, | 37 virtual void Initialize(DemuxerStream* demuxer_stream, |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 61 void DeliverFrame(const scoped_refptr<VideoFrame>& video_frame); | 64 void DeliverFrame(const scoped_refptr<VideoFrame>& video_frame); |
| 62 | 65 |
| 63 // Releases resources associated with |codec_context_| and |av_frame_| | 66 // Releases resources associated with |codec_context_| and |av_frame_| |
| 64 // and resets them to NULL. | 67 // and resets them to NULL. |
| 65 void ReleaseFFmpegResources(); | 68 void ReleaseFFmpegResources(); |
| 66 | 69 |
| 67 // Allocates a video frame based on the current format and dimensions based on | 70 // Allocates a video frame based on the current format and dimensions based on |
| 68 // the current state of |codec_context_|. | 71 // the current state of |codec_context_|. |
| 69 scoped_refptr<VideoFrame> AllocateVideoFrame(); | 72 scoped_refptr<VideoFrame> AllocateVideoFrame(); |
| 70 | 73 |
| 74 base::Callback<MessageLoop*()> message_loop_cb_; | |
|
Ami GONE FROM CHROMIUM
2012/03/09 16:15:06
s/message_loop_cb_/message_loop_factory_cb_/
and a
tommi (sloooow) - chröme
2012/03/11 18:49:36
Done.
| |
| 75 | |
| 71 MessageLoop* message_loop_; | 76 MessageLoop* message_loop_; |
| 72 | 77 |
| 73 DecoderState state_; | 78 DecoderState state_; |
| 74 | 79 |
| 75 StatisticsCallback statistics_callback_; | 80 StatisticsCallback statistics_callback_; |
| 76 | 81 |
| 77 ReadCB read_cb_; | 82 ReadCB read_cb_; |
| 78 | 83 |
| 79 // FFmpeg structures owned by this object. | 84 // FFmpeg structures owned by this object. |
| 80 AVCodecContext* codec_context_; | 85 AVCodecContext* codec_context_; |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 92 scoped_refptr<DemuxerStream> demuxer_stream_; | 97 scoped_refptr<DemuxerStream> demuxer_stream_; |
| 93 | 98 |
| 94 AesDecryptor decryptor_; | 99 AesDecryptor decryptor_; |
| 95 | 100 |
| 96 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder); | 101 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder); |
| 97 }; | 102 }; |
| 98 | 103 |
| 99 } // namespace media | 104 } // namespace media |
| 100 | 105 |
| 101 #endif // MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ | 106 #endif // MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ |
| OLD | NEW |