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 WEBKIT_MEDIA_CRYPTO_PPAPI_FFMPEG_CDM_AUDIO_DECODER_H_ | 5 #ifndef WEBKIT_MEDIA_CRYPTO_PPAPI_FFMPEG_CDM_AUDIO_DECODER_H_ |
6 #define WEBKIT_MEDIA_CRYPTO_PPAPI_FFMPEG_CDM_AUDIO_DECODER_H_ | 6 #define WEBKIT_MEDIA_CRYPTO_PPAPI_FFMPEG_CDM_AUDIO_DECODER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 cdm::Allocator* const allocator_; | 63 cdm::Allocator* const allocator_; |
64 | 64 |
65 // FFmpeg structures owned by this object. | 65 // FFmpeg structures owned by this object. |
66 AVCodecContext* codec_context_; | 66 AVCodecContext* codec_context_; |
67 AVFrame* av_frame_; | 67 AVFrame* av_frame_; |
68 | 68 |
69 // Audio format. | 69 // Audio format. |
70 int bits_per_channel_; | 70 int bits_per_channel_; |
71 int samples_per_second_; | 71 int samples_per_second_; |
| 72 int channels_; |
| 73 |
| 74 // AVSampleFormat initially requested; not Chrome's SampleFormat. |
| 75 int av_sample_format_; |
72 | 76 |
73 // Used for computing output timestamps. | 77 // Used for computing output timestamps. |
74 scoped_ptr<media::AudioTimestampHelper> output_timestamp_helper_; | 78 scoped_ptr<media::AudioTimestampHelper> output_timestamp_helper_; |
75 int bytes_per_frame_; | 79 int bytes_per_frame_; |
76 base::TimeDelta last_input_timestamp_; | 80 base::TimeDelta last_input_timestamp_; |
77 | 81 |
78 // We may need to convert the audio data coming out of FFmpeg from planar | 82 // We may need to convert the audio data coming out of FFmpeg from planar |
79 // float to integer. | 83 // float to integer. |
80 scoped_ptr<media::AudioBus> converter_bus_; | 84 scoped_ptr<media::AudioBus> converter_bus_; |
81 | 85 |
82 // Number of output sample bytes to drop before generating output buffers. | 86 // Number of output sample bytes to drop before generating output buffers. |
83 // This is required for handling negative timestamps when decoding Vorbis | 87 // This is required for handling negative timestamps when decoding Vorbis |
84 // audio, for example. | 88 // audio, for example. |
85 int output_bytes_to_drop_; | 89 int output_bytes_to_drop_; |
86 | 90 |
87 typedef std::vector<uint8_t> SerializedAudioFrames; | 91 typedef std::vector<uint8_t> SerializedAudioFrames; |
88 SerializedAudioFrames serialized_audio_frames_; | 92 SerializedAudioFrames serialized_audio_frames_; |
89 | 93 |
90 DISALLOW_COPY_AND_ASSIGN(FFmpegCdmAudioDecoder); | 94 DISALLOW_COPY_AND_ASSIGN(FFmpegCdmAudioDecoder); |
91 }; | 95 }; |
92 | 96 |
93 } // namespace webkit_media | 97 } // namespace webkit_media |
94 | 98 |
95 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_FFMPEG_CDM_AUDIO_DECODER_H_ | 99 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_FFMPEG_CDM_AUDIO_DECODER_H_ |
OLD | NEW |