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/callback.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "media/base/video_decoder.h" | 12 #include "media/base/video_decoder.h" |
13 #include "media/crypto/aes_decryptor.h" | 13 #include "media/crypto/aes_decryptor.h" |
14 | 14 |
15 class MessageLoop; | 15 class MessageLoop; |
16 | 16 |
17 struct AVCodecContext; | 17 struct AVCodecContext; |
18 struct AVFrame; | 18 struct AVFrame; |
19 | 19 |
20 namespace media { | 20 namespace media { |
21 | 21 |
22 class MEDIA_EXPORT FFmpegVideoDecoder : public VideoDecoder { | 22 class MEDIA_EXPORT FFmpegVideoDecoder : public VideoDecoder { |
23 public: | 23 public: |
24 FFmpegVideoDecoder(const base::Callback<MessageLoop*()>& message_loop_cb); | 24 FFmpegVideoDecoder(const base::Callback<MessageLoop*()>& message_loop_cb); |
25 virtual ~FFmpegVideoDecoder(); | |
26 | 25 |
27 // VideoDecoder implementation. | 26 // VideoDecoder implementation. |
28 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, | 27 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, |
29 const PipelineStatusCB& status_cb, | 28 const PipelineStatusCB& status_cb, |
30 const StatisticsCB& statistics_cb) OVERRIDE; | 29 const StatisticsCB& statistics_cb) OVERRIDE; |
31 virtual void Read(const ReadCB& read_cb) OVERRIDE; | 30 virtual void Read(const ReadCB& read_cb) OVERRIDE; |
32 virtual void Reset(const base::Closure& closure) OVERRIDE; | 31 virtual void Reset(const base::Closure& closure) OVERRIDE; |
33 virtual void Stop(const base::Closure& closure) OVERRIDE; | 32 virtual void Stop(const base::Closure& closure) OVERRIDE; |
34 virtual const gfx::Size& natural_size() OVERRIDE; | 33 virtual const gfx::Size& natural_size() OVERRIDE; |
35 | 34 |
36 AesDecryptor* decryptor(); | 35 AesDecryptor* decryptor(); |
37 | 36 |
| 37 protected: |
| 38 virtual ~FFmpegVideoDecoder(); |
| 39 |
38 private: | 40 private: |
39 enum DecoderState { | 41 enum DecoderState { |
40 kUninitialized, | 42 kUninitialized, |
41 kNormal, | 43 kNormal, |
42 kFlushCodec, | 44 kFlushCodec, |
43 kDecodeFinished, | 45 kDecodeFinished, |
44 }; | 46 }; |
45 | 47 |
46 // Carries out the reading operation scheduled by Read(). | 48 // Carries out the reading operation scheduled by Read(). |
47 void DoRead(const ReadCB& read_cb); | 49 void DoRead(const ReadCB& read_cb); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 scoped_refptr<DemuxerStream> demuxer_stream_; | 99 scoped_refptr<DemuxerStream> demuxer_stream_; |
98 | 100 |
99 AesDecryptor decryptor_; | 101 AesDecryptor decryptor_; |
100 | 102 |
101 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder); | 103 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder); |
102 }; | 104 }; |
103 | 105 |
104 } // namespace media | 106 } // namespace media |
105 | 107 |
106 #endif // MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ | 108 #endif // MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ |
OLD | NEW |