OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "media/formats/mpeg/adts_stream_parser.h" | 5 #include "media/formats/mpeg/adts_stream_parser.h" |
6 | 6 |
7 #include "media/formats/mpeg/adts_constants.h" | 7 #include "media/formats/mpeg/adts_constants.h" |
8 | 8 |
9 namespace media { | 9 namespace media { |
10 | 10 |
11 static const uint32 kADTSStartCodeMask = 0xfff00000; | 11 static const uint32_t kADTSStartCodeMask = 0xfff00000; |
12 | 12 |
13 ADTSStreamParser::ADTSStreamParser() | 13 ADTSStreamParser::ADTSStreamParser() |
14 : MPEGAudioStreamParserBase(kADTSStartCodeMask, kCodecAAC, 0) {} | 14 : MPEGAudioStreamParserBase(kADTSStartCodeMask, kCodecAAC, 0) {} |
15 | 15 |
16 ADTSStreamParser::~ADTSStreamParser() {} | 16 ADTSStreamParser::~ADTSStreamParser() {} |
17 | 17 |
18 int ADTSStreamParser::ParseFrameHeader(const uint8* data, | 18 int ADTSStreamParser::ParseFrameHeader(const uint8_t* data, |
19 int size, | 19 int size, |
20 int* frame_size, | 20 int* frame_size, |
21 int* sample_rate, | 21 int* sample_rate, |
22 ChannelLayout* channel_layout, | 22 ChannelLayout* channel_layout, |
23 int* sample_count, | 23 int* sample_count, |
24 bool* metadata_frame) const { | 24 bool* metadata_frame) const { |
25 DCHECK(data); | 25 DCHECK(data); |
26 DCHECK_GE(size, 0); | 26 DCHECK_GE(size, 0); |
27 DCHECK(frame_size); | 27 DCHECK(frame_size); |
28 | 28 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 if (channel_layout) | 89 if (channel_layout) |
90 *channel_layout = kADTSChannelLayoutTable[channel_layout_index]; | 90 *channel_layout = kADTSChannelLayoutTable[channel_layout_index]; |
91 | 91 |
92 if (metadata_frame) | 92 if (metadata_frame) |
93 *metadata_frame = false; | 93 *metadata_frame = false; |
94 | 94 |
95 return bytes_read; | 95 return bytes_read; |
96 } | 96 } |
97 | 97 |
98 } // namespace media | 98 } // namespace media |
OLD | NEW |