| 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, 0) {} | 14 : MPEGAudioStreamParserBase(kADTSStartCodeMask, kCodecAAC) {} |
| 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, | 23 int* sample_count, |
| 24 bool* metadata_frame) const { | 24 bool* metadata_frame) const { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 if (channel_layout) | 90 if (channel_layout) |
| 91 *channel_layout = kADTSChannelLayoutTable[channel_layout_index]; | 91 *channel_layout = kADTSChannelLayoutTable[channel_layout_index]; |
| 92 | 92 |
| 93 if (metadata_frame) | 93 if (metadata_frame) |
| 94 *metadata_frame = false; | 94 *metadata_frame = false; |
| 95 | 95 |
| 96 return bytes_read; | 96 return bytes_read; |
| 97 } | 97 } |
| 98 | 98 |
| 99 } // namespace media | 99 } // namespace media |
| OLD | NEW |