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