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" |
(...skipping 13 matching lines...) Expand all Loading... | |
24 public: | 24 public: |
25 FFmpegVideoDecoder(const base::Callback<MessageLoop*()>& message_loop_cb); | 25 FFmpegVideoDecoder(const base::Callback<MessageLoop*()>& message_loop_cb); |
26 | 26 |
27 // VideoDecoder implementation. | 27 // VideoDecoder implementation. |
28 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, | 28 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, |
29 const PipelineStatusCB& status_cb, | 29 const PipelineStatusCB& status_cb, |
30 const StatisticsCB& statistics_cb) OVERRIDE; | 30 const StatisticsCB& statistics_cb) OVERRIDE; |
31 virtual void Read(const ReadCB& read_cb) OVERRIDE; | 31 virtual void Read(const ReadCB& read_cb) OVERRIDE; |
32 virtual void Reset(const base::Closure& closure) OVERRIDE; | 32 virtual void Reset(const base::Closure& closure) OVERRIDE; |
33 virtual void Stop(const base::Closure& closure) OVERRIDE; | 33 virtual void Stop(const base::Closure& closure) OVERRIDE; |
34 virtual const gfx::Size& natural_size() OVERRIDE; | |
35 | 34 |
36 // Must be called prior to initialization if decrypted buffers will be | 35 // Must be called prior to initialization if decrypted buffers will be |
37 // encountered. | 36 // encountered. |
38 void set_decryptor(Decryptor* decryptor); | 37 void set_decryptor(Decryptor* decryptor); |
39 | 38 |
40 // Callback called from within FFmpeg to allocate a buffer based on | 39 // Callback called from within FFmpeg to allocate a buffer based on |
41 // the dimensions of |codec_context|. See AVCodecContext.get_buffer | 40 // the dimensions of |codec_context|. See AVCodecContext.get_buffer |
42 // documentation inside FFmpeg. | 41 // documentation inside FFmpeg. |
43 int GetVideoBuffer(AVCodecContext *codec_context, AVFrame* frame); | 42 int GetVideoBuffer(AVCodecContext *codec_context, AVFrame* frame); |
44 | 43 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 StatisticsCB statistics_cb_; | 99 StatisticsCB statistics_cb_; |
101 | 100 |
102 ReadCB read_cb_; | 101 ReadCB read_cb_; |
103 base::Closure reset_cb_; | 102 base::Closure reset_cb_; |
104 base::Closure stop_cb_; | 103 base::Closure stop_cb_; |
105 | 104 |
106 // FFmpeg structures owned by this object. | 105 // FFmpeg structures owned by this object. |
107 AVCodecContext* codec_context_; | 106 AVCodecContext* codec_context_; |
108 AVFrame* av_frame_; | 107 AVFrame* av_frame_; |
109 | 108 |
110 // Frame rate of the video. | 109 // Natural size for the last VideoDecoderConfig received. |
Ami GONE FROM CHROMIUM
2012/08/02 00:16:14
Why does this get to live?
acolwell GONE FROM CHROMIUM
2012/08/02 02:16:30
Removed.
| |
111 int frame_rate_numerator_; | |
112 int frame_rate_denominator_; | |
acolwell GONE FROM CHROMIUM
2012/08/01 23:58:13
Missed these on my last CL.
| |
113 | |
114 // TODO(scherkus): I think this should be calculated by VideoRenderers based | |
115 // on information provided by VideoDecoders (i.e., aspect ratio). | |
116 gfx::Size natural_size_; | 110 gfx::Size natural_size_; |
117 | 111 |
118 // Pointer to the demuxer stream that will feed us compressed buffers. | 112 // Pointer to the demuxer stream that will feed us compressed buffers. |
119 scoped_refptr<DemuxerStream> demuxer_stream_; | 113 scoped_refptr<DemuxerStream> demuxer_stream_; |
120 | 114 |
121 Decryptor* decryptor_; | 115 Decryptor* decryptor_; |
122 | 116 |
123 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder); | 117 DISALLOW_COPY_AND_ASSIGN(FFmpegVideoDecoder); |
124 }; | 118 }; |
125 | 119 |
126 } // namespace media | 120 } // namespace media |
127 | 121 |
128 #endif // MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ | 122 #endif // MEDIA_FILTERS_FFMPEG_VIDEO_DECODER_H_ |
OLD | NEW |