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_MPEG_AUDIO_STREAM_PARSER_BASE_H_ | 5 #ifndef MEDIA_FORMATS_MPEG_MPEG_AUDIO_STREAM_PARSER_BASE_H_ |
6 #define MEDIA_FORMATS_MPEG_MPEG_AUDIO_STREAM_PARSER_BASE_H_ | 6 #define MEDIA_FORMATS_MPEG_MPEG_AUDIO_STREAM_PARSER_BASE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 // Returns: | 75 // Returns: |
76 // > 0 : The number of bytes parsed. | 76 // > 0 : The number of bytes parsed. |
77 // 0 : If more data is needed to parse the entire frame header. | 77 // 0 : If more data is needed to parse the entire frame header. |
78 // < 0 : An error was encountered during parsing. | 78 // < 0 : An error was encountered during parsing. |
79 virtual int ParseFrameHeader(const uint8_t* data, | 79 virtual int ParseFrameHeader(const uint8_t* data, |
80 int size, | 80 int size, |
81 int* frame_size, | 81 int* frame_size, |
82 int* sample_rate, | 82 int* sample_rate, |
83 ChannelLayout* channel_layout, | 83 ChannelLayout* channel_layout, |
84 int* sample_count, | 84 int* sample_count, |
85 bool* metadata_frame) const = 0; | 85 bool* metadata_frame, |
| 86 std::vector<uint8_t>* extra_data) const = 0; |
86 | 87 |
87 const scoped_refptr<MediaLog>& media_log() const { return media_log_; } | 88 const scoped_refptr<MediaLog>& media_log() const { return media_log_; } |
88 | 89 |
89 private: | 90 private: |
90 enum State { | 91 enum State { |
91 UNINITIALIZED, | 92 UNINITIALIZED, |
92 INITIALIZED, | 93 INITIALIZED, |
93 PARSE_ERROR | 94 PARSE_ERROR |
94 }; | 95 }; |
95 | 96 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 const uint32_t start_code_mask_; | 151 const uint32_t start_code_mask_; |
151 const AudioCodec audio_codec_; | 152 const AudioCodec audio_codec_; |
152 const int codec_delay_; | 153 const int codec_delay_; |
153 | 154 |
154 DISALLOW_COPY_AND_ASSIGN(MPEGAudioStreamParserBase); | 155 DISALLOW_COPY_AND_ASSIGN(MPEGAudioStreamParserBase); |
155 }; | 156 }; |
156 | 157 |
157 } // namespace media | 158 } // namespace media |
158 | 159 |
159 #endif // MEDIA_FORMATS_MPEG_MPEG_AUDIO_STREAM_PARSER_BASE_H_ | 160 #endif // MEDIA_FORMATS_MPEG_MPEG_AUDIO_STREAM_PARSER_BASE_H_ |
OLD | NEW |