Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(541)

Side by Side Diff: media/formats/mpeg/mp3_stream_parser.cc

Issue 239423005: Wire up codec_delay() to MP3StreamParser and FFmpegAudioDecoder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ResetTimestampState() on config change. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/mp3_stream_parser.h" 5 #include "media/formats/mpeg/mp3_stream_parser.h"
6 6
7 namespace media { 7 namespace media {
8 8
9 static const uint32 kMP3StartCodeMask = 0xffe00000; 9 static const uint32 kMP3StartCodeMask = 0xffe00000;
10 10
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 static const int kVersion2 = 2; 83 static const int kVersion2 = 2;
84 static const int kVersionReserved = 1; 84 static const int kVersionReserved = 1;
85 static const int kVersion2_5 = 0; 85 static const int kVersion2_5 = 0;
86 static const int kLayerReserved = 0; 86 static const int kLayerReserved = 0;
87 static const int kLayer1 = 3; 87 static const int kLayer1 = 3;
88 static const int kLayer2 = 2; 88 static const int kLayer2 = 2;
89 static const int kLayer3 = 1; 89 static const int kLayer3 = 1;
90 static const int kBitrateFree = 0; 90 static const int kBitrateFree = 0;
91 static const int kBitrateBad = 0xf; 91 static const int kBitrateBad = 0xf;
92 static const int kSampleRateReserved = 3; 92 static const int kSampleRateReserved = 3;
93 static const int kCodecDelay = 529;
93 94
94 MP3StreamParser::MP3StreamParser() 95 MP3StreamParser::MP3StreamParser()
95 : MPEGAudioStreamParserBase(kMP3StartCodeMask, kCodecMP3) {} 96 : MPEGAudioStreamParserBase(kMP3StartCodeMask, kCodecMP3, kCodecDelay) {}
96 97
97 MP3StreamParser::~MP3StreamParser() {} 98 MP3StreamParser::~MP3StreamParser() {}
98 99
99 int MP3StreamParser::ParseFrameHeader(const uint8* data, 100 int MP3StreamParser::ParseFrameHeader(const uint8* data,
100 int size, 101 int size,
101 int* frame_size, 102 int* frame_size,
102 int* sample_rate, 103 int* sample_rate,
103 ChannelLayout* channel_layout, 104 ChannelLayout* channel_layout,
104 int* sample_count, 105 int* sample_count,
105 bool* metadata_frame) const { 106 bool* metadata_frame) const {
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 if (metadata_frame) 271 if (metadata_frame)
271 *metadata_frame = true; 272 *metadata_frame = true;
272 return reader.bits_read() / 8; 273 return reader.bits_read() / 8;
273 } 274 }
274 275
275 // If it wasn't a XING frame, just return the number consumed bytes. 276 // If it wasn't a XING frame, just return the number consumed bytes.
276 return header_bytes_read; 277 return header_bytes_read;
277 } 278 }
278 279
279 } // namespace media 280 } // namespace media
OLDNEW
« no previous file with comments | « media/formats/mpeg/adts_stream_parser.cc ('k') | media/formats/mpeg/mp3_stream_parser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698