Chromium Code Reviews| 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_MP4_AAC_H_ | 5 #ifndef MEDIA_MP4_AAC_H_ |
| 6 #define MEDIA_MP4_AAC_H_ | 6 #define MEDIA_MP4_AAC_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 public: | 25 public: |
| 26 AAC(); | 26 AAC(); |
| 27 ~AAC(); | 27 ~AAC(); |
| 28 | 28 |
| 29 // Parse the AAC config from the raw binary data embedded in esds box. | 29 // Parse the AAC config from the raw binary data embedded in esds box. |
| 30 // The function will parse the data and get the ElementaryStreamDescriptor, | 30 // The function will parse the data and get the ElementaryStreamDescriptor, |
| 31 // then it will parse the ElementaryStreamDescriptor to get audio stream | 31 // then it will parse the ElementaryStreamDescriptor to get audio stream |
| 32 // configurations. | 32 // configurations. |
| 33 bool Parse(const std::vector<uint8>& data); | 33 bool Parse(const std::vector<uint8>& data); |
| 34 | 34 |
| 35 uint32 frequency() const; | 35 // Gets the output sample rate for the AAC stream. |
| 36 // |sbr_in_mimetype| should be set to true if the SBR mode is | |
| 37 // signalled in the mimetype. (ie mp4a.40.5 in the codecs parameter). | |
|
vrk (LEFT CHROMIUM)
2012/07/20 23:08:48
nit: extra space "// "
acolwell GONE FROM CHROMIUM
2012/07/20 23:20:05
Done.
| |
| 38 // Returns the samples_per_second value that should used in an | |
| 39 // AudioDecoderConfig. | |
|
vrk (LEFT CHROMIUM)
2012/07/20 23:08:48
nit: extra space "// "
acolwell GONE FROM CHROMIUM
2012/07/20 23:20:05
Done.
| |
| 40 int GetOutputSamplesPerSecond(bool sbr_in_mimetype) const; | |
| 36 ChannelLayout channel_layout() const; | 41 ChannelLayout channel_layout() const; |
| 37 | 42 |
| 38 // This function converts a raw AAC frame into an AAC frame with an ADTS | 43 // This function converts a raw AAC frame into an AAC frame with an ADTS |
| 39 // header. On success, the function returns true and stores the converted data | 44 // header. On success, the function returns true and stores the converted data |
| 40 // in the buffer. The function returns false on failure and leaves the buffer | 45 // in the buffer. The function returns false on failure and leaves the buffer |
| 41 // unchanged. | 46 // unchanged. |
| 42 bool ConvertEsdsToADTS(std::vector<uint8>* buffer) const; | 47 bool ConvertEsdsToADTS(std::vector<uint8>* buffer) const; |
| 43 | 48 |
| 44 private: | 49 private: |
| 45 bool SkipDecoderGASpecificConfig(BitReader* bit_reader) const; | 50 bool SkipDecoderGASpecificConfig(BitReader* bit_reader) const; |
| 46 bool SkipErrorSpecificConfig() const; | 51 bool SkipErrorSpecificConfig() const; |
| 47 bool SkipGASpecificConfig(BitReader* bit_reader) const; | 52 bool SkipGASpecificConfig(BitReader* bit_reader) const; |
| 48 | 53 |
| 49 // The following variables store the AAC specific configuration information | 54 // The following variables store the AAC specific configuration information |
| 50 // that are used to generate the ADTS header. | 55 // that are used to generate the ADTS header. |
| 51 uint8 profile_; | 56 uint8 profile_; |
| 52 uint8 frequency_index_; | 57 uint8 frequency_index_; |
| 53 uint8 channel_config_; | 58 uint8 channel_config_; |
| 54 | 59 |
| 55 // The following variables store audio configuration information that | 60 // The following variables store audio configuration information that |
| 56 // can be used by Chromium. They are based on the AAC specific | 61 // can be used by Chromium. They are based on the AAC specific |
| 57 // configuration but can be overridden by extensions in elementary | 62 // configuration but can be overridden by extensions in elementary |
| 58 // stream descriptor. | 63 // stream descriptor. |
| 59 uint32 frequency_; | 64 int frequency_; |
| 65 int extension_frequency_; | |
| 60 ChannelLayout channel_layout_; | 66 ChannelLayout channel_layout_; |
| 61 }; | 67 }; |
| 62 | 68 |
| 63 } // namespace mp4 | 69 } // namespace mp4 |
| 64 | 70 |
| 65 } // namespace media | 71 } // namespace media |
| 66 | 72 |
| 67 #endif // MEDIA_MP4_AAC_H_ | 73 #endif // MEDIA_MP4_AAC_H_ |
| OLD | NEW |