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/base/pipeline.h" | 5 #include "media/base/pipeline.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 void Pipeline::InitializeDemuxer() { | 1084 void Pipeline::InitializeDemuxer() { |
1085 DCHECK_EQ(MessageLoop::current(), message_loop_); | 1085 DCHECK_EQ(MessageLoop::current(), message_loop_); |
1086 DCHECK(IsPipelineOk()); | 1086 DCHECK(IsPipelineOk()); |
1087 | 1087 |
1088 demuxer_ = filter_collection_->GetDemuxer(); | 1088 demuxer_ = filter_collection_->GetDemuxer(); |
1089 if (!demuxer_) { | 1089 if (!demuxer_) { |
1090 SetError(PIPELINE_ERROR_REQUIRED_FILTER_MISSING); | 1090 SetError(PIPELINE_ERROR_REQUIRED_FILTER_MISSING); |
1091 return; | 1091 return; |
1092 } | 1092 } |
1093 | 1093 |
1094 demuxer_->set_host(this); | 1094 demuxer_->Initialize(this, base::Bind(&Pipeline::OnDemuxerInitialized, this)); |
1095 demuxer_->Initialize(base::Bind(&Pipeline::OnDemuxerInitialized, this)); | |
1096 } | 1095 } |
1097 | 1096 |
1098 void Pipeline::OnDemuxerInitialized(PipelineStatus status) { | 1097 void Pipeline::OnDemuxerInitialized(PipelineStatus status) { |
1099 if (MessageLoop::current() != message_loop_) { | 1098 if (MessageLoop::current() != message_loop_) { |
1100 message_loop_->PostTask(FROM_HERE, base::Bind( | 1099 message_loop_->PostTask(FROM_HERE, base::Bind( |
1101 &Pipeline::OnDemuxerInitialized, this, status)); | 1100 &Pipeline::OnDemuxerInitialized, this, status)); |
1102 return; | 1101 return; |
1103 } | 1102 } |
1104 | 1103 |
1105 if (status != PIPELINE_OK) { | 1104 if (status != PIPELINE_OK) { |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1371 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { | 1370 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { |
1372 lock_.AssertAcquired(); | 1371 lock_.AssertAcquired(); |
1373 if (!waiting_for_clock_update_) | 1372 if (!waiting_for_clock_update_) |
1374 return; | 1373 return; |
1375 | 1374 |
1376 waiting_for_clock_update_ = false; | 1375 waiting_for_clock_update_ = false; |
1377 clock_->Play(); | 1376 clock_->Play(); |
1378 } | 1377 } |
1379 | 1378 |
1380 } // namespace media | 1379 } // namespace media |
OLD | NEW |