| 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_EXTERNAL_CLEAR_KEY_FFMPEG_CDM_AUDIO_DECODER_H_ | 5 #ifndef MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_FFMPEG_CDM_AUDIO_DECODER_H_ |
| 6 #define MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_FFMPEG_CDM_AUDIO_DECODER_H_ | 6 #define MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_FFMPEG_CDM_AUDIO_DECODER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> |
| 10 #include <vector> | 11 #include <vector> |
| 11 | 12 |
| 12 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 13 #include "base/macros.h" | 14 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "media/cdm/ppapi/external_clear_key/clear_key_cdm_common.h" | 16 #include "media/cdm/ppapi/external_clear_key/clear_key_cdm_common.h" |
| 17 #include "media/ffmpeg/ffmpeg_deleters.h" | 17 #include "media/ffmpeg/ffmpeg_deleters.h" |
| 18 | 18 |
| 19 struct AVCodecContext; | 19 struct AVCodecContext; |
| 20 struct AVFrame; | 20 struct AVFrame; |
| 21 | 21 |
| 22 namespace media { | 22 namespace media { |
| 23 class AudioBus; | 23 class AudioBus; |
| 24 class AudioTimestampHelper; | 24 class AudioTimestampHelper; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 base::TimeDelta GetNextOutputTimestamp() const; | 59 base::TimeDelta GetNextOutputTimestamp() const; |
| 60 | 60 |
| 61 void SerializeInt64(int64_t value); | 61 void SerializeInt64(int64_t value); |
| 62 | 62 |
| 63 bool is_initialized_; | 63 bool is_initialized_; |
| 64 | 64 |
| 65 ClearKeyCdmHost* const host_; | 65 ClearKeyCdmHost* const host_; |
| 66 | 66 |
| 67 // FFmpeg structures owned by this object. | 67 // FFmpeg structures owned by this object. |
| 68 scoped_ptr<AVCodecContext, ScopedPtrAVFreeContext> codec_context_; | 68 std::unique_ptr<AVCodecContext, ScopedPtrAVFreeContext> codec_context_; |
| 69 scoped_ptr<AVFrame, ScopedPtrAVFreeFrame> av_frame_; | 69 std::unique_ptr<AVFrame, ScopedPtrAVFreeFrame> av_frame_; |
| 70 | 70 |
| 71 // Audio format. | 71 // Audio format. |
| 72 int samples_per_second_; | 72 int samples_per_second_; |
| 73 int channels_; | 73 int channels_; |
| 74 | 74 |
| 75 // AVSampleFormat initially requested; not Chrome's SampleFormat. | 75 // AVSampleFormat initially requested; not Chrome's SampleFormat. |
| 76 int av_sample_format_; | 76 int av_sample_format_; |
| 77 | 77 |
| 78 // Used for computing output timestamps. | 78 // Used for computing output timestamps. |
| 79 scoped_ptr<AudioTimestampHelper> output_timestamp_helper_; | 79 std::unique_ptr<AudioTimestampHelper> output_timestamp_helper_; |
| 80 int bytes_per_frame_; | 80 int bytes_per_frame_; |
| 81 base::TimeDelta last_input_timestamp_; | 81 base::TimeDelta last_input_timestamp_; |
| 82 | 82 |
| 83 // Number of output sample bytes to drop before generating output buffers. | 83 // Number of output sample bytes to drop before generating output buffers. |
| 84 // This is required for handling negative timestamps when decoding Vorbis | 84 // This is required for handling negative timestamps when decoding Vorbis |
| 85 // audio, for example. | 85 // audio, for example. |
| 86 int output_bytes_to_drop_; | 86 int output_bytes_to_drop_; |
| 87 | 87 |
| 88 typedef std::vector<uint8_t> SerializedAudioFrames; | 88 typedef std::vector<uint8_t> SerializedAudioFrames; |
| 89 SerializedAudioFrames serialized_audio_frames_; | 89 SerializedAudioFrames serialized_audio_frames_; |
| 90 | 90 |
| 91 DISALLOW_COPY_AND_ASSIGN(FFmpegCdmAudioDecoder); | 91 DISALLOW_COPY_AND_ASSIGN(FFmpegCdmAudioDecoder); |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 } // namespace media | 94 } // namespace media |
| 95 | 95 |
| 96 #endif // MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_FFMPEG_CDM_AUDIO_DECODER_H_ | 96 #endif // MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_FFMPEG_CDM_AUDIO_DECODER_H_ |
| OLD | NEW |