| 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 kADTSStartCodeMask = 0xfff00000; |
| 12 | 12 |
| 13 ADTSStreamParser::ADTSStreamParser() | 13 ADTSStreamParser::ADTSStreamParser() |
| 14 : MPEGAudioStreamParserBase(kADTSStartCodeMask, kCodecAAC) {} | 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* 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) const { | 23 int* sample_count) const { |
| 24 DCHECK(data); | 24 DCHECK(data); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 if (sample_count) | 86 if (sample_count) |
| 87 *sample_count = (num_data_blocks + 1) * kSamplesPerAACFrame; | 87 *sample_count = (num_data_blocks + 1) * kSamplesPerAACFrame; |
| 88 | 88 |
| 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 return bytes_read; | 92 return bytes_read; |
| 93 } | 93 } |
| 94 | 94 |
| 95 } // namespace media | 95 } // namespace media |
| OLD | NEW |