| 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 "webkit/media/webmediaplayer_impl.h" | 5 #include "webkit/media/webmediaplayer_impl.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 GetClient()->durationChanged(); | 658 GetClient()->durationChanged(); |
| 659 | 659 |
| 660 return true; | 660 return true; |
| 661 } | 661 } |
| 662 | 662 |
| 663 bool WebMediaPlayerImpl::sourceAbort(const WebKit::WebString& id) { | 663 bool WebMediaPlayerImpl::sourceAbort(const WebKit::WebString& id) { |
| 664 proxy_->DemuxerAbort(id.utf8().data()); | 664 proxy_->DemuxerAbort(id.utf8().data()); |
| 665 return true; | 665 return true; |
| 666 } | 666 } |
| 667 | 667 |
| 668 void WebMediaPlayerImpl::sourceSetDuration(double new_duration) { |
| 669 if (static_cast<double>(duration()) == new_duration) |
| 670 return; |
| 671 |
| 672 proxy_->DemuxerSetDuration( |
| 673 base::TimeDelta::FromMicroseconds( |
| 674 new_duration * base::Time::kMicrosecondsPerSecond)); |
| 675 GetClient()->durationChanged(); |
| 676 } |
| 677 |
| 668 void WebMediaPlayerImpl::sourceEndOfStream( | 678 void WebMediaPlayerImpl::sourceEndOfStream( |
| 669 WebMediaPlayer::EndOfStreamStatus status) { | 679 WebMediaPlayer::EndOfStreamStatus status) { |
| 670 DCHECK_EQ(main_loop_, MessageLoop::current()); | 680 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 671 media::PipelineStatus pipeline_status = media::PIPELINE_OK; | 681 media::PipelineStatus pipeline_status = media::PIPELINE_OK; |
| 672 | 682 |
| 673 switch (status) { | 683 switch (status) { |
| 674 case WebMediaPlayer::EndOfStreamStatusNoError: | 684 case WebMediaPlayer::EndOfStreamStatusNoError: |
| 675 break; | 685 break; |
| 676 case WebMediaPlayer::EndOfStreamStatusNetworkError: | 686 case WebMediaPlayer::EndOfStreamStatusNetworkError: |
| 677 pipeline_status = media::PIPELINE_ERROR_NETWORK; | 687 pipeline_status = media::PIPELINE_ERROR_NETWORK; |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1050 return audio_source_provider_; | 1060 return audio_source_provider_; |
| 1051 } | 1061 } |
| 1052 | 1062 |
| 1053 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { | 1063 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { |
| 1054 DCHECK_EQ(main_loop_, MessageLoop::current()); | 1064 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 1055 incremented_externally_allocated_memory_ = true; | 1065 incremented_externally_allocated_memory_ = true; |
| 1056 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); | 1066 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); |
| 1057 } | 1067 } |
| 1058 | 1068 |
| 1059 } // namespace webkit_media | 1069 } // namespace webkit_media |
| OLD | NEW |