| 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 #include "media/formats/mp2t/mp2t_stream_parser.h" | 5 #include "media/formats/mp2t/mp2t_stream_parser.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 } | 162 } |
| 163 | 163 |
| 164 Mp2tStreamParser::~Mp2tStreamParser() { | 164 Mp2tStreamParser::~Mp2tStreamParser() { |
| 165 STLDeleteValues(&pids_); | 165 STLDeleteValues(&pids_); |
| 166 } | 166 } |
| 167 | 167 |
| 168 void Mp2tStreamParser::Init( | 168 void Mp2tStreamParser::Init( |
| 169 const InitCB& init_cb, | 169 const InitCB& init_cb, |
| 170 const NewConfigCB& config_cb, | 170 const NewConfigCB& config_cb, |
| 171 const NewBuffersCB& new_buffers_cb, | 171 const NewBuffersCB& new_buffers_cb, |
| 172 bool /* ignore_text_tracks */ , | 172 bool /* ignore_text_tracks */, |
| 173 const NeedKeyCB& need_key_cb, | 173 const EncryptedMediaInitDataCB& encrypted_media_init_data_cb, |
| 174 const NewMediaSegmentCB& new_segment_cb, | 174 const NewMediaSegmentCB& new_segment_cb, |
| 175 const base::Closure& end_of_segment_cb, | 175 const base::Closure& end_of_segment_cb, |
| 176 const LogCB& log_cb) { | 176 const LogCB& log_cb) { |
| 177 DCHECK(!is_initialized_); | 177 DCHECK(!is_initialized_); |
| 178 DCHECK(init_cb_.is_null()); | 178 DCHECK(init_cb_.is_null()); |
| 179 DCHECK(!init_cb.is_null()); | 179 DCHECK(!init_cb.is_null()); |
| 180 DCHECK(!config_cb.is_null()); | 180 DCHECK(!config_cb.is_null()); |
| 181 DCHECK(!new_buffers_cb.is_null()); | 181 DCHECK(!new_buffers_cb.is_null()); |
| 182 DCHECK(!need_key_cb.is_null()); | 182 DCHECK(!encrypted_media_init_data_cb.is_null()); |
| 183 DCHECK(!end_of_segment_cb.is_null()); | 183 DCHECK(!end_of_segment_cb.is_null()); |
| 184 | 184 |
| 185 init_cb_ = init_cb; | 185 init_cb_ = init_cb; |
| 186 config_cb_ = config_cb; | 186 config_cb_ = config_cb; |
| 187 new_buffers_cb_ = new_buffers_cb; | 187 new_buffers_cb_ = new_buffers_cb; |
| 188 need_key_cb_ = need_key_cb; | 188 encrypted_media_init_data_cb_ = encrypted_media_init_data_cb; |
| 189 new_segment_cb_ = new_segment_cb; | 189 new_segment_cb_ = new_segment_cb; |
| 190 end_of_segment_cb_ = end_of_segment_cb; | 190 end_of_segment_cb_ = end_of_segment_cb; |
| 191 log_cb_ = log_cb; | 191 log_cb_ = log_cb; |
| 192 } | 192 } |
| 193 | 193 |
| 194 void Mp2tStreamParser::Flush() { | 194 void Mp2tStreamParser::Flush() { |
| 195 DVLOG(1) << "Mp2tStreamParser::Flush"; | 195 DVLOG(1) << "Mp2tStreamParser::Flush"; |
| 196 | 196 |
| 197 // Flush the buffers and reset the pids. | 197 // Flush the buffers and reset the pids. |
| 198 for (std::map<int, PidState*>::iterator it = pids_.begin(); | 198 for (std::map<int, PidState*>::iterator it = pids_.begin(); |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 // so that buffers with the same config can be added later on. | 630 // so that buffers with the same config can be added later on. |
| 631 BufferQueueWithConfig queue_with_config( | 631 BufferQueueWithConfig queue_with_config( |
| 632 true, last_audio_config, last_video_config); | 632 true, last_audio_config, last_video_config); |
| 633 buffer_queue_chain_.push_back(queue_with_config); | 633 buffer_queue_chain_.push_back(queue_with_config); |
| 634 | 634 |
| 635 return true; | 635 return true; |
| 636 } | 636 } |
| 637 | 637 |
| 638 } // namespace mp2t | 638 } // namespace mp2t |
| 639 } // namespace media | 639 } // namespace media |
| OLD | NEW |