| 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 pending_seek_seconds_ = seconds; | 321 pending_seek_seconds_ = seconds; |
| 322 if (chunk_demuxer_) | 322 if (chunk_demuxer_) |
| 323 chunk_demuxer_->CancelPendingSeek(seek_time); | 323 chunk_demuxer_->CancelPendingSeek(seek_time); |
| 324 return; | 324 return; |
| 325 } | 325 } |
| 326 | 326 |
| 327 media_log_->AddEvent(media_log_->CreateSeekEvent(seconds)); | 327 media_log_->AddEvent(media_log_->CreateSeekEvent(seconds)); |
| 328 | 328 |
| 329 // Update our paused time. | 329 // Update our paused time. |
| 330 // In paused state ignore the seek operations to current time and generate | 330 // In paused state ignore the seek operations to current time and generate |
| 331 // buffer state change event to eventually fire seeking and seeked events | 331 // OnPipelineSeeked and OnPipelineBufferingStateChanged events |
| 332 // to eventually fire seeking and seeked events |
| 332 if (paused_) { | 333 if (paused_) { |
| 333 if (paused_time_ != seek_time) { | 334 if (paused_time_ != seek_time) { |
| 334 paused_time_ = seek_time; | 335 paused_time_ = seek_time; |
| 335 } else { | 336 } else { |
| 336 main_task_runner_->PostTask( | 337 main_task_runner_->PostTask( |
| 338 FROM_HERE, base::Bind(&WebMediaPlayerImpl::OnPipelineSeeked, |
| 339 AsWeakPtr(), false, PIPELINE_OK)); |
| 340 main_task_runner_->PostTask( |
| 337 FROM_HERE, | 341 FROM_HERE, |
| 338 base::Bind(&WebMediaPlayerImpl::OnPipelineBufferingStateChanged, | 342 base::Bind(&WebMediaPlayerImpl::OnPipelineBufferingStateChanged, |
| 339 AsWeakPtr(), | 343 AsWeakPtr(), BUFFERING_HAVE_ENOUGH)); |
| 340 BUFFERING_HAVE_ENOUGH)); | |
| 341 return; | 344 return; |
| 342 } | 345 } |
| 343 } | 346 } |
| 344 | 347 |
| 345 seeking_ = true; | 348 seeking_ = true; |
| 346 | 349 |
| 347 if (chunk_demuxer_) | 350 if (chunk_demuxer_) |
| 348 chunk_demuxer_->StartWaitingForSeek(seek_time); | 351 chunk_demuxer_->StartWaitingForSeek(seek_time); |
| 349 | 352 |
| 350 // Kick off the asynchronous seek! | 353 // Kick off the asynchronous seek! |
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1025 compositor_task_runner_->PostTask(FROM_HERE, | 1028 compositor_task_runner_->PostTask(FROM_HERE, |
| 1026 base::Bind(&GetCurrentFrameAndSignal, | 1029 base::Bind(&GetCurrentFrameAndSignal, |
| 1027 base::Unretained(compositor_), | 1030 base::Unretained(compositor_), |
| 1028 &video_frame, | 1031 &video_frame, |
| 1029 &event)); | 1032 &event)); |
| 1030 event.Wait(); | 1033 event.Wait(); |
| 1031 return video_frame; | 1034 return video_frame; |
| 1032 } | 1035 } |
| 1033 | 1036 |
| 1034 } // namespace media | 1037 } // namespace media |
| OLD | NEW |