OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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/filters/media_source_state.h" | 5 #include "media/filters/media_source_state.h" |
6 | 6 |
7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "media/base/media_track.h" | 9 #include "media/base/media_track.h" |
10 #include "media/base/media_tracks.h" | 10 #include "media/base/media_tracks.h" |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 return false; | 473 return false; |
474 } | 474 } |
475 | 475 |
476 bool MediaSourceState::OnNewConfigs( | 476 bool MediaSourceState::OnNewConfigs( |
477 bool allow_audio, | 477 bool allow_audio, |
478 bool allow_video, | 478 bool allow_video, |
479 std::unique_ptr<MediaTracks> tracks, | 479 std::unique_ptr<MediaTracks> tracks, |
480 const StreamParser::TextTrackConfigMap& text_configs) { | 480 const StreamParser::TextTrackConfigMap& text_configs) { |
481 DCHECK_GE(state_, PENDING_PARSER_CONFIG); | 481 DCHECK_GE(state_, PENDING_PARSER_CONFIG); |
482 DCHECK(tracks.get()); | 482 DCHECK(tracks.get()); |
| 483 |
483 media_tracks_ = std::move(tracks); | 484 media_tracks_ = std::move(tracks); |
484 const AudioDecoderConfig& audio_config = media_tracks_->getFirstAudioConfig(); | 485 const AudioDecoderConfig& audio_config = media_tracks_->getFirstAudioConfig(); |
485 const VideoDecoderConfig& video_config = media_tracks_->getFirstVideoConfig(); | 486 const VideoDecoderConfig& video_config = media_tracks_->getFirstVideoConfig(); |
486 | 487 |
487 DVLOG(1) << "OnNewConfigs(" << allow_audio << ", " << allow_video << ", " | 488 DVLOG(1) << "OnNewConfigs(" << allow_audio << ", " << allow_video << ", " |
488 << audio_config.IsValidConfig() << ", " | 489 << audio_config.IsValidConfig() << ", " |
489 << video_config.IsValidConfig() << ")"; | 490 << video_config.IsValidConfig() << ")"; |
490 // MSE spec allows new configs to be emitted only during Append, but not | 491 // MSE spec allows new configs to be emitted only during Append, but not |
491 // during Flush or parser reset operations. | 492 // during Flush or parser reset operations. |
492 CHECK(append_in_progress_); | 493 CHECK(append_in_progress_); |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 | 740 |
740 void MediaSourceState::OnSourceInitDone( | 741 void MediaSourceState::OnSourceInitDone( |
741 const StreamParser::InitParameters& params) { | 742 const StreamParser::InitParameters& params) { |
742 DCHECK_EQ(state_, PENDING_PARSER_INIT); | 743 DCHECK_EQ(state_, PENDING_PARSER_INIT); |
743 state_ = PARSER_INITIALIZED; | 744 state_ = PARSER_INITIALIZED; |
744 auto_update_timestamp_offset_ = params.auto_update_timestamp_offset; | 745 auto_update_timestamp_offset_ = params.auto_update_timestamp_offset; |
745 base::ResetAndReturn(&init_cb_).Run(params); | 746 base::ResetAndReturn(&init_cb_).Run(params); |
746 } | 747 } |
747 | 748 |
748 } // namespace media | 749 } // namespace media |
OLD | NEW |