OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/blink/webmediaplayer_impl.h" | 5 #include "media/blink/webmediaplayer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 pending_seek_ = true; | 330 pending_seek_ = true; |
331 pending_seek_seconds_ = seconds; | 331 pending_seek_seconds_ = seconds; |
332 if (chunk_demuxer_) | 332 if (chunk_demuxer_) |
333 chunk_demuxer_->CancelPendingSeek(seek_time); | 333 chunk_demuxer_->CancelPendingSeek(seek_time); |
334 return; | 334 return; |
335 } | 335 } |
336 | 336 |
337 media_log_->AddEvent(media_log_->CreateSeekEvent(seconds)); | 337 media_log_->AddEvent(media_log_->CreateSeekEvent(seconds)); |
338 | 338 |
339 // Update our paused time. | 339 // Update our paused time. |
340 // In paused state ignore the seek operations to current time and generate | 340 if (paused_) |
341 // buffer state change event to eventually fire seeking and seeked events | 341 paused_time_ = seek_time; |
342 if (paused_) { | |
343 if (paused_time_ != seek_time) { | |
344 paused_time_ = seek_time; | |
345 } else { | |
346 main_task_runner_->PostTask( | |
347 FROM_HERE, | |
348 base::Bind(&WebMediaPlayerImpl::OnPipelineBufferingStateChanged, | |
349 AsWeakPtr(), | |
350 BUFFERING_HAVE_ENOUGH)); | |
351 return; | |
352 } | |
353 } | |
354 | 342 |
355 seeking_ = true; | 343 seeking_ = true; |
356 | 344 |
357 if (chunk_demuxer_) | 345 if (chunk_demuxer_) |
358 chunk_demuxer_->StartWaitingForSeek(seek_time); | 346 chunk_demuxer_->StartWaitingForSeek(seek_time); |
359 | 347 |
360 // Kick off the asynchronous seek! | 348 // Kick off the asynchronous seek! |
361 pipeline_.Seek( | 349 pipeline_.Seek( |
362 seek_time, | 350 seek_time, |
363 BIND_TO_RENDER_LOOP1(&WebMediaPlayerImpl::OnPipelineSeeked, true)); | 351 BIND_TO_RENDER_LOOP1(&WebMediaPlayerImpl::OnPipelineSeeked, true)); |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 compositor_task_runner_->PostTask(FROM_HERE, | 1032 compositor_task_runner_->PostTask(FROM_HERE, |
1045 base::Bind(&GetCurrentFrameAndSignal, | 1033 base::Bind(&GetCurrentFrameAndSignal, |
1046 base::Unretained(compositor_), | 1034 base::Unretained(compositor_), |
1047 &video_frame, | 1035 &video_frame, |
1048 &event)); | 1036 &event)); |
1049 event.Wait(); | 1037 event.Wait(); |
1050 return video_frame; | 1038 return video_frame; |
1051 } | 1039 } |
1052 | 1040 |
1053 } // namespace media | 1041 } // namespace media |
OLD | NEW |