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