| 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 "content/renderer/media/webmediaplayer_impl.h" | 5 #include "content/renderer/media/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 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 // return 0 so that the seekable range is empty. | 530 // return 0 so that the seekable range is empty. |
| 531 if (ready_state_ < WebMediaPlayer::ReadyStateHaveMetadata) | 531 if (ready_state_ < WebMediaPlayer::ReadyStateHaveMetadata) |
| 532 return 0.0; | 532 return 0.0; |
| 533 | 533 |
| 534 // We don't support seeking in streaming media. | 534 // We don't support seeking in streaming media. |
| 535 if (data_source_ && data_source_->IsStreaming()) | 535 if (data_source_ && data_source_->IsStreaming()) |
| 536 return 0.0; | 536 return 0.0; |
| 537 return duration(); | 537 return duration(); |
| 538 } | 538 } |
| 539 | 539 |
| 540 bool WebMediaPlayerImpl::didLoadingProgress() const { | |
| 541 return const_cast<WebMediaPlayerImpl*>(this)->didLoadingProgress(); | |
| 542 } | |
| 543 | |
| 544 bool WebMediaPlayerImpl::didLoadingProgress() { | 540 bool WebMediaPlayerImpl::didLoadingProgress() { |
| 545 DCHECK(main_loop_->BelongsToCurrentThread()); | 541 DCHECK(main_loop_->BelongsToCurrentThread()); |
| 546 bool pipeline_progress = pipeline_.DidLoadingProgress(); | 542 bool pipeline_progress = pipeline_.DidLoadingProgress(); |
| 547 bool data_progress = buffered_data_source_host_.DidLoadingProgress(); | 543 bool data_progress = buffered_data_source_host_.DidLoadingProgress(); |
| 548 return pipeline_progress || data_progress; | 544 return pipeline_progress || data_progress; |
| 549 } | 545 } |
| 550 | 546 |
| 551 void WebMediaPlayerImpl::paint(WebCanvas* canvas, | 547 void WebMediaPlayerImpl::paint(WebCanvas* canvas, |
| 552 const WebRect& rect, | 548 const WebRect& rect, |
| 553 unsigned char alpha) { | 549 unsigned char alpha) { |
| (...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1382 compositor_task_runner_->PostTask(FROM_HERE, | 1378 compositor_task_runner_->PostTask(FROM_HERE, |
| 1383 base::Bind(&GetCurrentFrameAndSignal, | 1379 base::Bind(&GetCurrentFrameAndSignal, |
| 1384 base::Unretained(compositor_), | 1380 base::Unretained(compositor_), |
| 1385 &video_frame, | 1381 &video_frame, |
| 1386 &event)); | 1382 &event)); |
| 1387 event.Wait(); | 1383 event.Wait(); |
| 1388 return video_frame; | 1384 return video_frame; |
| 1389 } | 1385 } |
| 1390 | 1386 |
| 1391 } // namespace content | 1387 } // namespace content |
| OLD | NEW |