| 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 13 matching lines...) Expand all  Loading... | 
| 24 namespace mp2t { | 24 namespace mp2t { | 
| 25 | 25 | 
| 26 class PidState; | 26 class PidState; | 
| 27 | 27 | 
| 28 class MEDIA_EXPORT Mp2tStreamParser : public StreamParser { | 28 class MEDIA_EXPORT Mp2tStreamParser : public StreamParser { | 
| 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( | 34   void Init(const InitCB& init_cb, | 
| 35       const InitCB& init_cb, | 35             const NewConfigCB& config_cb, | 
| 36       const NewConfigCB& config_cb, | 36             const NewBuffersCB& new_buffers_cb, | 
| 37       const NewBuffersCB& new_buffers_cb, | 37             bool ignore_text_tracks, | 
| 38       bool ignore_text_tracks, | 38             const EncryptedMediaInitDataCB& encrypted_media_init_data_cb, | 
| 39       const EncryptedMediaInitDataCB& encrypted_media_init_data_cb, | 39             const NewMediaSegmentCB& new_segment_cb, | 
| 40       const NewMediaSegmentCB& new_segment_cb, | 40             const base::Closure& end_of_segment_cb, | 
| 41       const base::Closure& end_of_segment_cb, | 41             const scoped_refptr<MediaLog>& media_log) override; | 
| 42       const LogCB& log_cb) override; |  | 
| 43   void Flush() override; | 42   void Flush() override; | 
| 44   bool Parse(const uint8* buf, int size) override; | 43   bool Parse(const uint8* buf, int size) override; | 
| 45 | 44 | 
| 46  private: | 45  private: | 
| 47   typedef std::map<int, PidState*> PidMap; | 46   typedef std::map<int, PidState*> PidMap; | 
| 48 | 47 | 
| 49   struct BufferQueueWithConfig { | 48   struct BufferQueueWithConfig { | 
| 50     BufferQueueWithConfig(bool is_cfg_sent, | 49     BufferQueueWithConfig(bool is_cfg_sent, | 
| 51                           const AudioDecoderConfig& audio_cfg, | 50                           const AudioDecoderConfig& audio_cfg, | 
| 52                           const VideoDecoderConfig& video_cfg); | 51                           const VideoDecoderConfig& video_cfg); | 
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 94       scoped_refptr<StreamParserBuffer> stream_parser_buffer); | 93       scoped_refptr<StreamParserBuffer> stream_parser_buffer); | 
| 95   bool EmitRemainingBuffers(); | 94   bool EmitRemainingBuffers(); | 
| 96 | 95 | 
| 97   // List of callbacks. | 96   // List of callbacks. | 
| 98   InitCB init_cb_; | 97   InitCB init_cb_; | 
| 99   NewConfigCB config_cb_; | 98   NewConfigCB config_cb_; | 
| 100   NewBuffersCB new_buffers_cb_; | 99   NewBuffersCB new_buffers_cb_; | 
| 101   EncryptedMediaInitDataCB encrypted_media_init_data_cb_; | 100   EncryptedMediaInitDataCB encrypted_media_init_data_cb_; | 
| 102   NewMediaSegmentCB new_segment_cb_; | 101   NewMediaSegmentCB new_segment_cb_; | 
| 103   base::Closure end_of_segment_cb_; | 102   base::Closure end_of_segment_cb_; | 
| 104   LogCB log_cb_; | 103   scoped_refptr<MediaLog> media_log_; | 
| 105 | 104 | 
| 106   // True when AAC SBR extension is signalled in the mimetype | 105   // True when AAC SBR extension is signalled in the mimetype | 
| 107   // (mp4a.40.5 in the codecs parameter). | 106   // (mp4a.40.5 in the codecs parameter). | 
| 108   bool sbr_in_mimetype_; | 107   bool sbr_in_mimetype_; | 
| 109 | 108 | 
| 110   // Bytes of the TS stream. | 109   // Bytes of the TS stream. | 
| 111   ByteQueue ts_byte_queue_; | 110   ByteQueue ts_byte_queue_; | 
| 112 | 111 | 
| 113   // List of PIDs and their state. | 112   // List of PIDs and their state. | 
| 114   PidMap pids_; | 113   PidMap pids_; | 
| (...skipping 17 matching lines...) Expand all  Loading... | 
| 132   TimestampUnroller timestamp_unroller_; | 131   TimestampUnroller timestamp_unroller_; | 
| 133 | 132 | 
| 134   DISALLOW_COPY_AND_ASSIGN(Mp2tStreamParser); | 133   DISALLOW_COPY_AND_ASSIGN(Mp2tStreamParser); | 
| 135 }; | 134 }; | 
| 136 | 135 | 
| 137 }  // namespace mp2t | 136 }  // namespace mp2t | 
| 138 }  // namespace media | 137 }  // namespace media | 
| 139 | 138 | 
| 140 #endif | 139 #endif | 
| 141 | 140 | 
| OLD | NEW | 
|---|