| 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" | 8 #include "base/basictypes.h" |
| 9 #include "media/base/media_export.h" | 9 #include "media/base/media_export.h" |
| 10 #include "media/formats/mpeg/mpeg_audio_stream_parser_base.h" | 10 #include "media/formats/mpeg/mpeg_audio_stream_parser_base.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // Channel layout. | 55 // Channel layout. |
| 56 ChannelLayout channel_layout; | 56 ChannelLayout channel_layout; |
| 57 | 57 |
| 58 // Number of samples per frame. | 58 // Number of samples per frame. |
| 59 int sample_count; | 59 int sample_count; |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 // Parses the header starting at |data|. | 62 // Parses the header starting at |data|. |
| 63 // Assumption: size of array |data| should be at least |kHeaderSize|. | 63 // Assumption: size of array |data| should be at least |kHeaderSize|. |
| 64 // Returns false if the header is not valid. | 64 // Returns false if the header is not valid. |
| 65 static bool ParseHeader( | 65 static bool ParseHeader(const scoped_refptr<MediaLog>& media_log, |
| 66 const LogCB& log_cb, | 66 const uint8* data, |
| 67 const uint8* data, | 67 Header* header); |
| 68 Header* header); | |
| 69 | 68 |
| 70 MPEG1AudioStreamParser(); | 69 MPEG1AudioStreamParser(); |
| 71 ~MPEG1AudioStreamParser() override; | 70 ~MPEG1AudioStreamParser() override; |
| 72 | 71 |
| 73 private: | 72 private: |
| 74 // MPEGAudioStreamParserBase overrides. | 73 // MPEGAudioStreamParserBase overrides. |
| 75 int ParseFrameHeader(const uint8* data, | 74 int ParseFrameHeader(const uint8* data, |
| 76 int size, | 75 int size, |
| 77 int* frame_size, | 76 int* frame_size, |
| 78 int* sample_rate, | 77 int* sample_rate, |
| 79 ChannelLayout* channel_layout, | 78 ChannelLayout* channel_layout, |
| 80 int* sample_count, | 79 int* sample_count, |
| 81 bool* metadata_frame) const override; | 80 bool* metadata_frame) const override; |
| 82 | 81 |
| 83 DISALLOW_COPY_AND_ASSIGN(MPEG1AudioStreamParser); | 82 DISALLOW_COPY_AND_ASSIGN(MPEG1AudioStreamParser); |
| 84 }; | 83 }; |
| 85 | 84 |
| 86 } // namespace media | 85 } // namespace media |
| 87 | 86 |
| 88 #endif // MEDIA_FORMATS_MPEG_MPEG1_AUDIO_STREAM_PARSER_H_ | 87 #endif // MEDIA_FORMATS_MPEG_MPEG1_AUDIO_STREAM_PARSER_H_ |
| OLD | NEW |