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 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1220 | 1220 |
1221 if (pipeline_filter_) { | 1221 if (pipeline_filter_) { |
1222 pipeline_filter_->Stop(callback); | 1222 pipeline_filter_->Stop(callback); |
1223 return; | 1223 return; |
1224 } | 1224 } |
1225 | 1225 |
1226 callback.Run(); | 1226 callback.Run(); |
1227 } | 1227 } |
1228 | 1228 |
1229 void Pipeline::DoSeek(TimeDelta seek_timestamp) { | 1229 void Pipeline::DoSeek(TimeDelta seek_timestamp) { |
1230 // TODO(acolwell): We might be able to convert this if (demuxer_) into a | 1230 demuxer_->Seek(seek_timestamp, base::Bind( |
1231 // DCHECK(). Further investigation is needed to make sure this won't introduce | 1231 &Pipeline::OnDemuxerSeekDone, this, seek_timestamp)); |
1232 // a bug. | |
1233 if (demuxer_) { | |
1234 demuxer_->Seek(seek_timestamp, base::Bind( | |
1235 &Pipeline::OnDemuxerSeekDone, this, seek_timestamp)); | |
1236 return; | |
1237 } | |
1238 | |
1239 OnDemuxerSeekDone(seek_timestamp, PIPELINE_OK); | |
1240 } | 1232 } |
1241 | 1233 |
1242 void Pipeline::OnDemuxerSeekDone(TimeDelta seek_timestamp, | 1234 void Pipeline::OnDemuxerSeekDone(TimeDelta seek_timestamp, |
1243 PipelineStatus status) { | 1235 PipelineStatus status) { |
1244 if (!message_loop_->BelongsToCurrentThread()) { | 1236 if (!message_loop_->BelongsToCurrentThread()) { |
1245 message_loop_->PostTask(FROM_HERE, base::Bind( | 1237 message_loop_->PostTask(FROM_HERE, base::Bind( |
1246 &Pipeline::OnDemuxerSeekDone, this, seek_timestamp, status)); | 1238 &Pipeline::OnDemuxerSeekDone, this, seek_timestamp, status)); |
1247 return; | 1239 return; |
1248 } | 1240 } |
1249 | 1241 |
(...skipping 25 matching lines...) Expand all Loading... |
1275 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { | 1267 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { |
1276 lock_.AssertAcquired(); | 1268 lock_.AssertAcquired(); |
1277 if (!waiting_for_clock_update_) | 1269 if (!waiting_for_clock_update_) |
1278 return; | 1270 return; |
1279 | 1271 |
1280 waiting_for_clock_update_ = false; | 1272 waiting_for_clock_update_ = false; |
1281 clock_->Play(); | 1273 clock_->Play(); |
1282 } | 1274 } |
1283 | 1275 |
1284 } // namespace media | 1276 } // namespace media |
OLD | NEW |