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 <set> | 10 #include <set> |
(...skipping 21 matching lines...) Expand all Loading... |
32 int codec_delay); | 32 int codec_delay); |
33 ~MPEGAudioStreamParserBase() override; | 33 ~MPEGAudioStreamParserBase() override; |
34 | 34 |
35 // StreamParser implementation. | 35 // StreamParser implementation. |
36 void Init(const InitCB& init_cb, | 36 void Init(const InitCB& init_cb, |
37 const NewConfigCB& config_cb, | 37 const NewConfigCB& config_cb, |
38 const NewBuffersCB& new_buffers_cb, | 38 const NewBuffersCB& new_buffers_cb, |
39 bool ignore_text_tracks, | 39 bool ignore_text_tracks, |
40 const EncryptedMediaInitDataCB& encrypted_media_init_data_cb, | 40 const EncryptedMediaInitDataCB& encrypted_media_init_data_cb, |
41 const NewMediaSegmentCB& new_segment_cb, | 41 const NewMediaSegmentCB& new_segment_cb, |
42 const base::Closure& end_of_segment_cb, | 42 const EndMediaSegmentCB& end_of_segment_cb, |
43 const scoped_refptr<MediaLog>& media_log) override; | 43 const scoped_refptr<MediaLog>& media_log) override; |
44 void Flush() override; | 44 void Flush() override; |
45 bool Parse(const uint8_t* buf, int size) override; | 45 bool Parse(const uint8_t* buf, int size) override; |
46 | 46 |
47 protected: | 47 protected: |
48 // Subclasses implement this method to parse format specific frame headers. | 48 // Subclasses implement this method to parse format specific frame headers. |
49 // |data| & |size| describe the data available for parsing. | 49 // |data| & |size| describe the data available for parsing. |
50 // | 50 // |
51 // Implementations are expected to consume an entire frame header. It should | 51 // Implementations are expected to consume an entire frame header. It should |
52 // only return a value greater than 0 when |data| has enough bytes to | 52 // only return a value greater than 0 when |data| has enough bytes to |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 // media segment. | 131 // media segment. |
132 // Returns true if the buffers are sent successfully. | 132 // Returns true if the buffers are sent successfully. |
133 bool SendBuffers(BufferQueue* buffers, bool end_of_segment); | 133 bool SendBuffers(BufferQueue* buffers, bool end_of_segment); |
134 | 134 |
135 State state_; | 135 State state_; |
136 | 136 |
137 InitCB init_cb_; | 137 InitCB init_cb_; |
138 NewConfigCB config_cb_; | 138 NewConfigCB config_cb_; |
139 NewBuffersCB new_buffers_cb_; | 139 NewBuffersCB new_buffers_cb_; |
140 NewMediaSegmentCB new_segment_cb_; | 140 NewMediaSegmentCB new_segment_cb_; |
141 base::Closure end_of_segment_cb_; | 141 EndMediaSegmentCB end_of_segment_cb_; |
142 scoped_refptr<MediaLog> media_log_; | 142 scoped_refptr<MediaLog> media_log_; |
143 | 143 |
144 ByteQueue queue_; | 144 ByteQueue queue_; |
145 | 145 |
146 AudioDecoderConfig config_; | 146 AudioDecoderConfig config_; |
147 scoped_ptr<AudioTimestampHelper> timestamp_helper_; | 147 scoped_ptr<AudioTimestampHelper> timestamp_helper_; |
148 bool in_media_segment_; | 148 bool in_media_segment_; |
149 const uint32_t start_code_mask_; | 149 const uint32_t start_code_mask_; |
150 const AudioCodec audio_codec_; | 150 const AudioCodec audio_codec_; |
151 const int codec_delay_; | 151 const int codec_delay_; |
152 | 152 |
153 DISALLOW_COPY_AND_ASSIGN(MPEGAudioStreamParserBase); | 153 DISALLOW_COPY_AND_ASSIGN(MPEGAudioStreamParserBase); |
154 }; | 154 }; |
155 | 155 |
156 } // namespace media | 156 } // namespace media |
157 | 157 |
158 #endif // MEDIA_FORMATS_MPEG_MPEG_AUDIO_STREAM_PARSER_BASE_H_ | 158 #endif // MEDIA_FORMATS_MPEG_MPEG_AUDIO_STREAM_PARSER_BASE_H_ |
OLD | NEW |