| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chunk_demuxer.h" | 5 #include "media/filters/chunk_demuxer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <list> | 9 #include <list> |
| 10 | 10 |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 bool success = true; | 554 bool success = true; |
| 555 if (audio_config.IsValidConfig()) { | 555 if (audio_config.IsValidConfig()) { |
| 556 if (!audio_) { | 556 if (!audio_) { |
| 557 audio_ = create_demuxer_stream_cb_.Run(DemuxerStream::AUDIO); | 557 audio_ = create_demuxer_stream_cb_.Run(DemuxerStream::AUDIO); |
| 558 | 558 |
| 559 if (!audio_) { | 559 if (!audio_) { |
| 560 DVLOG(1) << "Failed to create an audio stream."; | 560 DVLOG(1) << "Failed to create an audio stream."; |
| 561 return false; | 561 return false; |
| 562 } | 562 } |
| 563 | 563 |
| 564 if (!frame_processor_->AddTrack(FrameProcessorBase::kAudioTrackId, | 564 if (!frame_processor_->AddTrack(FrameProcessor::kAudioTrackId, audio_)) { |
| 565 audio_)) { | |
| 566 DVLOG(1) << "Failed to add audio track to frame processor."; | 565 DVLOG(1) << "Failed to add audio track to frame processor."; |
| 567 return false; | 566 return false; |
| 568 } | 567 } |
| 569 } | 568 } |
| 570 | 569 |
| 571 frame_processor_->OnPossibleAudioConfigUpdate(audio_config); | 570 frame_processor_->OnPossibleAudioConfigUpdate(audio_config); |
| 572 success &= audio_->UpdateAudioConfig(audio_config, log_cb_); | 571 success &= audio_->UpdateAudioConfig(audio_config, log_cb_); |
| 573 } | 572 } |
| 574 | 573 |
| 575 if (video_config.IsValidConfig()) { | 574 if (video_config.IsValidConfig()) { |
| 576 if (!video_) { | 575 if (!video_) { |
| 577 video_ = create_demuxer_stream_cb_.Run(DemuxerStream::VIDEO); | 576 video_ = create_demuxer_stream_cb_.Run(DemuxerStream::VIDEO); |
| 578 | 577 |
| 579 if (!video_) { | 578 if (!video_) { |
| 580 DVLOG(1) << "Failed to create a video stream."; | 579 DVLOG(1) << "Failed to create a video stream."; |
| 581 return false; | 580 return false; |
| 582 } | 581 } |
| 583 | 582 |
| 584 if (!frame_processor_->AddTrack(FrameProcessorBase::kVideoTrackId, | 583 if (!frame_processor_->AddTrack(FrameProcessor::kVideoTrackId, video_)) { |
| 585 video_)) { | |
| 586 DVLOG(1) << "Failed to add video track to frame processor."; | 584 DVLOG(1) << "Failed to add video track to frame processor."; |
| 587 return false; | 585 return false; |
| 588 } | 586 } |
| 589 } | 587 } |
| 590 | 588 |
| 591 success &= video_->UpdateVideoConfig(video_config, log_cb_); | 589 success &= video_->UpdateVideoConfig(video_config, log_cb_); |
| 592 } | 590 } |
| 593 | 591 |
| 594 typedef StreamParser::TextTrackConfigMap::const_iterator TextConfigItr; | 592 typedef StreamParser::TextTrackConfigMap::const_iterator TextConfigItr; |
| 595 if (text_stream_map_.empty()) { | 593 if (text_stream_map_.empty()) { |
| (...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1741 } | 1739 } |
| 1742 | 1740 |
| 1743 void ChunkDemuxer::ShutdownAllStreams() { | 1741 void ChunkDemuxer::ShutdownAllStreams() { |
| 1744 for (SourceStateMap::iterator itr = source_state_map_.begin(); | 1742 for (SourceStateMap::iterator itr = source_state_map_.begin(); |
| 1745 itr != source_state_map_.end(); ++itr) { | 1743 itr != source_state_map_.end(); ++itr) { |
| 1746 itr->second->Shutdown(); | 1744 itr->second->Shutdown(); |
| 1747 } | 1745 } |
| 1748 } | 1746 } |
| 1749 | 1747 |
| 1750 } // namespace media | 1748 } // namespace media |
| OLD | NEW |