OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MEDIA_FORMATS_MPEG_MPEG1_AUDIO_STREAM_PARSER_H_ | |
6 #define MEDIA_FORMATS_MPEG_MPEG1_AUDIO_STREAM_PARSER_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "media/base/media_export.h" | |
10 #include "media/formats/mpeg/mpeg_audio_stream_parser_base.h" | |
11 | |
12 namespace media { | |
13 | |
14 // MPEG1AudioStreamParser handles MPEG-1 audio streams (ISO/IEC 11172-3) | |
15 // as well as the following extensions: | |
16 // - MPEG-2 audio (ISO/IEC 13818-3), | |
17 // - and MPEG2.5 (not an ISO standard). | |
18 class MEDIA_EXPORT MPEG1AudioStreamParser : public MPEGAudioStreamParserBase { | |
19 public: | |
20 struct Header { | |
21 int version; | |
acolwell GONE FROM CHROMIUM
2014/09/04 22:20:53
nit: Since this is a public struct, version and la
damienv1
2014/09/05 20:06:13
Done.
| |
22 int layer; | |
23 int frame_size; | |
24 int sample_rate; | |
25 int channel_mode; | |
26 ChannelLayout channel_layout; | |
27 int sample_count; | |
28 }; | |
29 | |
30 static const int kHeaderSize; | |
31 | |
32 // Assumption: size of array |data| should be at least the size of an Mpeg1 | |
33 // audio header (i.e. should be greater than or equal to 4). | |
34 static bool ParseHeader( | |
35 const LogCB& log_cb, | |
36 const uint8* data, | |
37 Header* header); | |
38 | |
39 MPEG1AudioStreamParser(); | |
40 virtual ~MPEG1AudioStreamParser(); | |
41 | |
42 private: | |
43 // MPEGAudioStreamParserBase overrides. | |
44 virtual int ParseFrameHeader(const uint8* data, | |
45 int size, | |
46 int* frame_size, | |
47 int* sample_rate, | |
48 ChannelLayout* channel_layout, | |
49 int* sample_count, | |
50 bool* metadata_frame) const OVERRIDE; | |
51 | |
52 DISALLOW_COPY_AND_ASSIGN(MPEG1AudioStreamParser); | |
53 }; | |
54 | |
55 } // namespace media | |
56 | |
57 #endif // MEDIA_FORMATS_MPEG_MPEG1_AUDIO_STREAM_PARSER_H_ | |
OLD | NEW |