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 24 matching lines...) Expand all Loading... | |
35 void Deinitialize(); | 35 void Deinitialize(); |
36 void Reset(); | 36 void Reset(); |
37 | 37 |
38 // Returns true when |config| is a valid audio decoder configuration. | 38 // Returns true when |config| is a valid audio decoder configuration. |
39 static bool IsValidConfig(const cdm::AudioDecoderConfig& config); | 39 static bool IsValidConfig(const cdm::AudioDecoderConfig& config); |
40 | 40 |
41 // Decodes |compressed_buffer|. Returns |cdm::kSuccess| after storing | 41 // Decodes |compressed_buffer|. Returns |cdm::kSuccess| after storing |
42 // output in |decoded_frames| when output is available. Returns | 42 // output in |decoded_frames| when output is available. Returns |
43 // |cdm::kNeedMoreData| when |compressed_frame| does not produce output. | 43 // |cdm::kNeedMoreData| when |compressed_frame| does not produce output. |
44 // Returns |cdm::kDecodeError| when decoding fails. | 44 // Returns |cdm::kDecodeError| when decoding fails. |
45 // | |
46 // A null |compressed_buffer| is will attempt to flush the decoder of any | |
xhwang
2013/01/28 16:35:20
ditto
scherkus (not reviewing)
2013/01/28 18:28:37
Done.
| |
47 // remaining frames. |compressed_buffer_size| and |timestamp| are ignored. | |
45 cdm::Status DecodeBuffer(const uint8_t* compressed_buffer, | 48 cdm::Status DecodeBuffer(const uint8_t* compressed_buffer, |
46 int32_t compressed_buffer_size, | 49 int32_t compressed_buffer_size, |
47 int64_t timestamp, | 50 int64_t timestamp, |
48 cdm::AudioFrames* decoded_frames); | 51 cdm::AudioFrames* decoded_frames); |
49 | 52 |
50 private: | 53 private: |
51 void ResetTimestampState(); | 54 void ResetTimestampState(); |
52 void ReleaseFFmpegResources(); | 55 void ReleaseFFmpegResources(); |
53 | 56 |
54 base::TimeDelta GetNextOutputTimestamp() const; | 57 base::TimeDelta GetNextOutputTimestamp() const; |
(...skipping 28 matching lines...) Expand all Loading... | |
83 | 86 |
84 typedef std::vector<uint8_t> SerializedAudioFrames; | 87 typedef std::vector<uint8_t> SerializedAudioFrames; |
85 SerializedAudioFrames serialized_audio_frames_; | 88 SerializedAudioFrames serialized_audio_frames_; |
86 | 89 |
87 DISALLOW_COPY_AND_ASSIGN(FFmpegCdmAudioDecoder); | 90 DISALLOW_COPY_AND_ASSIGN(FFmpegCdmAudioDecoder); |
88 }; | 91 }; |
89 | 92 |
90 } // namespace webkit_media | 93 } // namespace webkit_media |
91 | 94 |
92 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_FFMPEG_CDM_AUDIO_DECODER_H_ | 95 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_FFMPEG_CDM_AUDIO_DECODER_H_ |
OLD | NEW |