| 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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 return true; | 478 return true; |
| 479 | 479 |
| 480 // Pass the config before invoking the initialization callback. | 480 // Pass the config before invoking the initialization callback. |
| 481 RCHECK(config_cb_.Run(queue_with_config.audio_config, | 481 RCHECK(config_cb_.Run(queue_with_config.audio_config, |
| 482 queue_with_config.video_config, | 482 queue_with_config.video_config, |
| 483 TextTrackConfigMap())); | 483 TextTrackConfigMap())); |
| 484 queue_with_config.is_config_sent = true; | 484 queue_with_config.is_config_sent = true; |
| 485 | 485 |
| 486 // For Mpeg2 TS, the duration is not known. | 486 // For Mpeg2 TS, the duration is not known. |
| 487 DVLOG(1) << "Mpeg2TS stream parser initialization done"; | 487 DVLOG(1) << "Mpeg2TS stream parser initialization done"; |
| 488 base::ResetAndReturn(&init_cb_).Run( | 488 base::ResetAndReturn(&init_cb_).Run(true, StreamParser::StreamParameters()); |
| 489 true, kInfiniteDuration(), base::Time(), false); | |
| 490 is_initialized_ = true; | 489 is_initialized_ = true; |
| 491 | 490 |
| 492 return true; | 491 return true; |
| 493 } | 492 } |
| 494 | 493 |
| 495 void Mp2tStreamParser::OnEmitAudioBuffer( | 494 void Mp2tStreamParser::OnEmitAudioBuffer( |
| 496 int pes_pid, | 495 int pes_pid, |
| 497 scoped_refptr<StreamParserBuffer> stream_parser_buffer) { | 496 scoped_refptr<StreamParserBuffer> stream_parser_buffer) { |
| 498 DCHECK_EQ(pes_pid, selected_audio_pid_); | 497 DCHECK_EQ(pes_pid, selected_audio_pid_); |
| 499 | 498 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 // so that buffers with the same config can be added later on. | 613 // so that buffers with the same config can be added later on. |
| 615 BufferQueueWithConfig queue_with_config( | 614 BufferQueueWithConfig queue_with_config( |
| 616 true, last_audio_config, last_video_config); | 615 true, last_audio_config, last_video_config); |
| 617 buffer_queue_chain_.push_back(queue_with_config); | 616 buffer_queue_chain_.push_back(queue_with_config); |
| 618 | 617 |
| 619 return true; | 618 return true; |
| 620 } | 619 } |
| 621 | 620 |
| 622 } // namespace mp2t | 621 } // namespace mp2t |
| 623 } // namespace media | 622 } // namespace media |
| OLD | NEW |