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_) |
489 true, kInfiniteDuration(), base::Time(), false); | 489 .Run(true, InitParameters(kInfiniteDuration())); |
490 is_initialized_ = true; | 490 is_initialized_ = true; |
491 | 491 |
492 return true; | 492 return true; |
493 } | 493 } |
494 | 494 |
495 void Mp2tStreamParser::OnEmitAudioBuffer( | 495 void Mp2tStreamParser::OnEmitAudioBuffer( |
496 int pes_pid, | 496 int pes_pid, |
497 scoped_refptr<StreamParserBuffer> stream_parser_buffer) { | 497 scoped_refptr<StreamParserBuffer> stream_parser_buffer) { |
498 DCHECK_EQ(pes_pid, selected_audio_pid_); | 498 DCHECK_EQ(pes_pid, selected_audio_pid_); |
499 | 499 |
(...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. | 614 // so that buffers with the same config can be added later on. |
615 BufferQueueWithConfig queue_with_config( | 615 BufferQueueWithConfig queue_with_config( |
616 true, last_audio_config, last_video_config); | 616 true, last_audio_config, last_video_config); |
617 buffer_queue_chain_.push_back(queue_with_config); | 617 buffer_queue_chain_.push_back(queue_with_config); |
618 | 618 |
619 return true; | 619 return true; |
620 } | 620 } |
621 | 621 |
622 } // namespace mp2t | 622 } // namespace mp2t |
623 } // namespace media | 623 } // namespace media |
OLD | NEW |