| 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_MP2T_MP2T_STREAM_PARSER_H_ | 5 #ifndef MEDIA_FORMATS_MP2T_MP2T_STREAM_PARSER_H_ |
| 6 #define MEDIA_FORMATS_MP2T_MP2T_STREAM_PARSER_H_ | 6 #define MEDIA_FORMATS_MP2T_MP2T_STREAM_PARSER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 public: | 29 public: |
| 30 explicit Mp2tStreamParser(bool sbr_in_mimetype); | 30 explicit Mp2tStreamParser(bool sbr_in_mimetype); |
| 31 ~Mp2tStreamParser() override; | 31 ~Mp2tStreamParser() override; |
| 32 | 32 |
| 33 // StreamParser implementation. | 33 // StreamParser implementation. |
| 34 void Init(const InitCB& init_cb, | 34 void Init(const InitCB& init_cb, |
| 35 const NewConfigCB& config_cb, | 35 const NewConfigCB& config_cb, |
| 36 const NewBuffersCB& new_buffers_cb, | 36 const NewBuffersCB& new_buffers_cb, |
| 37 bool ignore_text_tracks, | 37 bool ignore_text_tracks, |
| 38 const EncryptedMediaInitDataCB& encrypted_media_init_data_cb, | 38 const EncryptedMediaInitDataCB& encrypted_media_init_data_cb, |
| 39 const NewMediaSegmentCB& new_segment_cb, | 39 const base::Closure& start_of_segment_cb, |
| 40 const base::Closure& end_of_segment_cb, | 40 const base::Closure& end_of_segment_cb, |
| 41 const scoped_refptr<MediaLog>& media_log) override; | 41 const scoped_refptr<MediaLog>& media_log) override; |
| 42 void Flush() override; | 42 void Flush() override; |
| 43 bool Parse(const uint8* buf, int size) override; | 43 bool Parse(const uint8* buf, int size) override; |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 typedef std::map<int, PidState*> PidMap; | 46 typedef std::map<int, PidState*> PidMap; |
| 47 | 47 |
| 48 struct BufferQueueWithConfig { | 48 struct BufferQueueWithConfig { |
| 49 BufferQueueWithConfig(bool is_cfg_sent, | 49 BufferQueueWithConfig(bool is_cfg_sent, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 void OnEmitVideoBuffer( | 91 void OnEmitVideoBuffer( |
| 92 int pes_pid, | 92 int pes_pid, |
| 93 scoped_refptr<StreamParserBuffer> stream_parser_buffer); | 93 scoped_refptr<StreamParserBuffer> stream_parser_buffer); |
| 94 bool EmitRemainingBuffers(); | 94 bool EmitRemainingBuffers(); |
| 95 | 95 |
| 96 // List of callbacks. | 96 // List of callbacks. |
| 97 InitCB init_cb_; | 97 InitCB init_cb_; |
| 98 NewConfigCB config_cb_; | 98 NewConfigCB config_cb_; |
| 99 NewBuffersCB new_buffers_cb_; | 99 NewBuffersCB new_buffers_cb_; |
| 100 EncryptedMediaInitDataCB encrypted_media_init_data_cb_; | 100 EncryptedMediaInitDataCB encrypted_media_init_data_cb_; |
| 101 NewMediaSegmentCB new_segment_cb_; | 101 base::Closure start_of_segment_cb_; |
| 102 base::Closure end_of_segment_cb_; | 102 base::Closure end_of_segment_cb_; |
| 103 scoped_refptr<MediaLog> media_log_; | 103 scoped_refptr<MediaLog> media_log_; |
| 104 | 104 |
| 105 // True when AAC SBR extension is signalled in the mimetype | 105 // True when AAC SBR extension is signalled in the mimetype |
| 106 // (mp4a.40.5 in the codecs parameter). | 106 // (mp4a.40.5 in the codecs parameter). |
| 107 bool sbr_in_mimetype_; | 107 bool sbr_in_mimetype_; |
| 108 | 108 |
| 109 // Bytes of the TS stream. | 109 // Bytes of the TS stream. |
| 110 ByteQueue ts_byte_queue_; | 110 ByteQueue ts_byte_queue_; |
| 111 | 111 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 131 TimestampUnroller timestamp_unroller_; | 131 TimestampUnroller timestamp_unroller_; |
| 132 | 132 |
| 133 DISALLOW_COPY_AND_ASSIGN(Mp2tStreamParser); | 133 DISALLOW_COPY_AND_ASSIGN(Mp2tStreamParser); |
| 134 }; | 134 }; |
| 135 | 135 |
| 136 } // namespace mp2t | 136 } // namespace mp2t |
| 137 } // namespace media | 137 } // namespace media |
| 138 | 138 |
| 139 #endif | 139 #endif |
| 140 | 140 |
| OLD | NEW |