Chromium Code Reviews| Index: media/mp4/aac.h |
| diff --git a/media/mp4/aac.h b/media/mp4/aac.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b9709f27a5c592b7d260f6718753892ae2a9fcb2 |
| --- /dev/null |
| +++ b/media/mp4/aac.h |
| @@ -0,0 +1,64 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef MEDIA_MP4_AAC_H_ |
| +#define MEDIA_MP4_AAC_H_ |
| + |
| +#include <vector> |
| + |
| +#include "base/basictypes.h" |
| +#include "media/base/channel_layout.h" |
| +#include "media/base/media_export.h" |
| + |
| +namespace media { |
| + |
| +class BitReader; |
| + |
| +namespace mp4 { |
| + |
| +// This class parses the AAC information from decoder specific information |
| +// embedded in the esds box in an ISO BMFF file. |
| +// Please refer to ISO 14496 Part 3 Table 1.13 - Syntax of AudioSpecificConfig |
| +// for more details. |
| +class MEDIA_EXPORT AAC { |
| + public: |
| + AAC(); |
| + ~AAC(); |
| + |
| + // Parse the AAC config from the raw binary data embedded in esds box. |
| + // The function will parse the data and get the ElementaryStreamDescriptor, |
| + // then it will parse the ElementaryStreamDescriptor to get audio stream |
| + // configurations. |
| + bool Parse(const std::vector<uint8>& data); |
| + |
| + uint32 frequency() const; |
| + ChannelLayout channel_layout() const; |
| + |
| + // This function converts raw AAC frame into AAC frame with ADTS header. |
| + 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
|
| + |
| + private: |
| + bool SkipDecoderGASpecificConfig(BitReader* bit_reader) const; |
| + bool SkipErrorSpecificConfig() const; |
| + bool SkipGASpecificConfig(BitReader* bit_reader) const; |
| + |
| + // The following variables store the AAC specific configuration information |
| + // that are used to generate the ADTS header. |
| + uint8 profile_; |
| + uint8 frequency_index_; |
| + uint8 channel_config_; |
| + |
| + // The following variables store audio configuration information that |
| + // can be used by Chromium. They ara based on the AAC specific |
|
acolwell GONE FROM CHROMIUM
2012/07/03 01:00:12
ara -> are
|
| + // configuration but can be overridden by extensions in elementary |
| + // stream descriptor. |
| + uint32 frequency_; |
| + ChannelLayout channel_layout_; |
| +}; |
| + |
| +} // namespace mp4 |
| + |
| +} // namespace media |
| + |
| +#endif // MEDIA_MP4_AAC_H_ |