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 20 matching lines...) Expand all Loading... |
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 // Gets the output sample rate for the AAC stream. | 35 // Gets the output sample rate for the AAC stream. |
36 // |sbr_in_mimetype| should be set to true if the SBR mode is | 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). | 37 // signalled in the mimetype. (ie mp4a.40.5 in the codecs parameter). |
38 // Returns the samples_per_second value that should used in an | 38 // Returns the samples_per_second value that should used in an |
39 // AudioDecoderConfig. | 39 // AudioDecoderConfig. |
40 int GetOutputSamplesPerSecond(bool sbr_in_mimetype) const; | 40 int GetOutputSamplesPerSecond(bool sbr_in_mimetype) const; |
41 ChannelLayout channel_layout() const; | 41 |
| 42 // Gets the channel layout for the AAC stream. |
| 43 // |sbr_in_mimetype| should be set to true if the SBR mode is |
| 44 // signalled in the mimetype. (ie mp4a.40.5 in the codecs parameter). |
| 45 // Returns the channel_layout value that should used in an |
| 46 // AudioDecoderConfig. |
| 47 ChannelLayout GetChannelLayout(bool sbr_in_mimetype) const; |
42 | 48 |
43 // This function converts a raw AAC frame into an AAC frame with an ADTS | 49 // This function converts a raw AAC frame into an AAC frame with an ADTS |
44 // header. On success, the function returns true and stores the converted data | 50 // header. On success, the function returns true and stores the converted data |
45 // in the buffer. The function returns false on failure and leaves the buffer | 51 // in the buffer. The function returns false on failure and leaves the buffer |
46 // unchanged. | 52 // unchanged. |
47 bool ConvertEsdsToADTS(std::vector<uint8>* buffer) const; | 53 bool ConvertEsdsToADTS(std::vector<uint8>* buffer) const; |
48 | 54 |
49 // Size in bytes of the ADTS header added by ConvertEsdsToADTS(). | 55 // Size in bytes of the ADTS header added by ConvertEsdsToADTS(). |
50 static const size_t kADTSHeaderSize = 7; | 56 static const size_t kADTSHeaderSize = 7; |
51 | 57 |
(...skipping 15 matching lines...) Expand all Loading... |
67 int frequency_; | 73 int frequency_; |
68 int extension_frequency_; | 74 int extension_frequency_; |
69 ChannelLayout channel_layout_; | 75 ChannelLayout channel_layout_; |
70 }; | 76 }; |
71 | 77 |
72 } // namespace mp4 | 78 } // namespace mp4 |
73 | 79 |
74 } // namespace media | 80 } // namespace media |
75 | 81 |
76 #endif // MEDIA_MP4_AAC_H_ | 82 #endif // MEDIA_MP4_AAC_H_ |
OLD | NEW |