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 #ifndef MEDIA_FORMATS_MPEG_MPEG1_AUDIO_STREAM_PARSER_H_ | 5 #ifndef MEDIA_FORMATS_MPEG_MPEG1_AUDIO_STREAM_PARSER_H_ |
6 #define MEDIA_FORMATS_MPEG_MPEG1_AUDIO_STREAM_PARSER_H_ | 6 #define MEDIA_FORMATS_MPEG_MPEG1_AUDIO_STREAM_PARSER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | |
9 #include "media/base/media_export.h" | 8 #include "media/base/media_export.h" |
10 #include "media/formats/mpeg/mpeg_audio_stream_parser_base.h" | 9 #include "media/formats/mpeg/mpeg_audio_stream_parser_base.h" |
11 | 10 |
12 namespace media { | 11 namespace media { |
13 | 12 |
14 // MPEG1AudioStreamParser handles MPEG-1 audio streams (ISO/IEC 11172-3) | 13 // MPEG1AudioStreamParser handles MPEG-1 audio streams (ISO/IEC 11172-3) |
15 // as well as the following extensions: | 14 // as well as the following extensions: |
16 // - MPEG-2 audio (ISO/IEC 13818-3), | 15 // - MPEG-2 audio (ISO/IEC 13818-3), |
17 // - and MPEG2.5 (not an ISO standard). | 16 // - and MPEG2.5 (not an ISO standard). |
18 class MEDIA_EXPORT MPEG1AudioStreamParser : public MPEGAudioStreamParserBase { | 17 class MEDIA_EXPORT MPEG1AudioStreamParser : public MPEGAudioStreamParserBase { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 ChannelLayout channel_layout; | 55 ChannelLayout channel_layout; |
57 | 56 |
58 // Number of samples per frame. | 57 // Number of samples per frame. |
59 int sample_count; | 58 int sample_count; |
60 }; | 59 }; |
61 | 60 |
62 // Parses the header starting at |data|. | 61 // Parses the header starting at |data|. |
63 // Assumption: size of array |data| should be at least |kHeaderSize|. | 62 // Assumption: size of array |data| should be at least |kHeaderSize|. |
64 // Returns false if the header is not valid. | 63 // Returns false if the header is not valid. |
65 static bool ParseHeader(const scoped_refptr<MediaLog>& media_log, | 64 static bool ParseHeader(const scoped_refptr<MediaLog>& media_log, |
66 const uint8* data, | 65 const uint8_t* data, |
67 Header* header); | 66 Header* header); |
68 | 67 |
69 MPEG1AudioStreamParser(); | 68 MPEG1AudioStreamParser(); |
70 ~MPEG1AudioStreamParser() override; | 69 ~MPEG1AudioStreamParser() override; |
71 | 70 |
72 private: | 71 private: |
73 // MPEGAudioStreamParserBase overrides. | 72 // MPEGAudioStreamParserBase overrides. |
74 int ParseFrameHeader(const uint8* data, | 73 int ParseFrameHeader(const uint8_t* data, |
75 int size, | 74 int size, |
76 int* frame_size, | 75 int* frame_size, |
77 int* sample_rate, | 76 int* sample_rate, |
78 ChannelLayout* channel_layout, | 77 ChannelLayout* channel_layout, |
79 int* sample_count, | 78 int* sample_count, |
80 bool* metadata_frame) const override; | 79 bool* metadata_frame) const override; |
81 | 80 |
82 DISALLOW_COPY_AND_ASSIGN(MPEG1AudioStreamParser); | 81 DISALLOW_COPY_AND_ASSIGN(MPEG1AudioStreamParser); |
83 }; | 82 }; |
84 | 83 |
85 } // namespace media | 84 } // namespace media |
86 | 85 |
87 #endif // MEDIA_FORMATS_MPEG_MPEG1_AUDIO_STREAM_PARSER_H_ | 86 #endif // MEDIA_FORMATS_MPEG_MPEG1_AUDIO_STREAM_PARSER_H_ |
OLD | NEW |