Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef MEDIA_MP4_AAC_H_ | |
| 6 #define MEDIA_MP4_AAC_H_ | |
| 7 | |
| 8 #include <vector> | |
| 9 | |
| 10 #include "base/basictypes.h" | |
| 11 #include "media/base/channel_layout.h" | |
| 12 #include "media/base/media_export.h" | |
| 13 | |
| 14 namespace media { | |
| 15 | |
| 16 class BitReader; | |
| 17 | |
| 18 namespace mp4 { | |
| 19 | |
| 20 // This class parses the AAC information from decoder specific information | |
| 21 // embedded in the esds box in an ISO BMFF file. | |
| 22 // Please refer to ISO 14496 Part 3 Table 1.13 - Syntax of AudioSpecificConfig | |
| 23 // for more details. | |
| 24 class MEDIA_EXPORT AAC { | |
| 25 public: | |
| 26 AAC(); | |
| 27 ~AAC(); | |
| 28 | |
| 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, | |
| 31 // then it will parse the ElementaryStreamDescriptor to get audio stream | |
| 32 // configurations. | |
| 33 bool Parse(const std::vector<uint8>& data); | |
| 34 | |
| 35 uint32 frequency() const; | |
| 36 ChannelLayout channel_layout() const; | |
| 37 | |
| 38 // This function converts raw AAC frame into AAC frame with ADTS header. | |
| 39 bool ConvertEsdsToADTS(std::vector<uint8>* buffer) const; | |
|
acolwell GONE FROM CHROMIUM
2012/07/03 01:00:12
nit:Document return value and buffer. Is buffer an
| |
| 40 | |
| 41 private: | |
| 42 bool SkipDecoderGASpecificConfig(BitReader* bit_reader) const; | |
| 43 bool SkipErrorSpecificConfig() const; | |
| 44 bool SkipGASpecificConfig(BitReader* bit_reader) const; | |
| 45 | |
| 46 // The following variables store the AAC specific configuration information | |
| 47 // that are used to generate the ADTS header. | |
| 48 uint8 profile_; | |
| 49 uint8 frequency_index_; | |
| 50 uint8 channel_config_; | |
| 51 | |
| 52 // The following variables store audio configuration information that | |
| 53 // can be used by Chromium. They ara based on the AAC specific | |
|
acolwell GONE FROM CHROMIUM
2012/07/03 01:00:12
ara -> are
| |
| 54 // configuration but can be overridden by extensions in elementary | |
| 55 // stream descriptor. | |
| 56 uint32 frequency_; | |
| 57 ChannelLayout channel_layout_; | |
| 58 }; | |
| 59 | |
| 60 } // namespace mp4 | |
| 61 | |
| 62 } // namespace media | |
| 63 | |
| 64 #endif // MEDIA_MP4_AAC_H_ | |
| OLD | NEW |