OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_FORMATS_MPEG_ADTS_HEADER_PARSER_H_ | 5 #ifndef MEDIA_FORMATS_MPEG_ADTS_HEADER_PARSER_H_ |
6 #define MEDIA_FORMATS_MPEG_ADTS_HEADER_PARSER_H_ | 6 #define MEDIA_FORMATS_MPEG_ADTS_HEADER_PARSER_H_ |
7 | 7 |
| 8 #include <stddef.h> |
8 #include <stdint.h> | 9 #include <stdint.h> |
9 | 10 |
10 #include "media/base/media_export.h" | 11 #include "media/base/media_export.h" |
11 | 12 |
12 namespace media { | 13 namespace media { |
13 | 14 |
14 class AudioDecoderConfig; | 15 class AudioDecoderConfig; |
15 | 16 |
16 // Parses ADTS header |adts_header| (4 bytes) and extracts the information into | 17 // Parses ADTS header |adts_header| (4 bytes) and extracts the information into |
17 // |config| structure if the parsing succeeds. Returns true if the parsing | 18 // |config| structure if the parsing succeeds. Returns true if the parsing |
18 // succeeds or false otherwise. The |is_sbr| flag stands for Spectral Band | 19 // succeeds or false otherwise. The |is_sbr| flag stands for Spectral Band |
19 // Replication. | 20 // Replication. |orig_sample_rate| will return the sample frequency before |
| 21 // doubling in SBR. |
20 MEDIA_EXPORT bool ParseAdtsHeader(const uint8_t* adts_header, | 22 MEDIA_EXPORT bool ParseAdtsHeader(const uint8_t* adts_header, |
21 bool is_sbr, | 23 bool is_sbr, |
22 AudioDecoderConfig* config); | 24 AudioDecoderConfig* config, |
| 25 size_t* orig_sample_rate); |
23 | 26 |
24 } // namespace media | 27 } // namespace media |
25 | 28 |
26 #endif // MEDIA_FORMATS_MPEG_ADTS_HEADER_PARSER_H_ | 29 #endif // MEDIA_FORMATS_MPEG_ADTS_HEADER_PARSER_H_ |
OLD | NEW |