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 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 | 680 |
681 float old_duration = duration(); | 681 float old_duration = duration(); |
682 proxy_->DemuxerEndOfStream(pipeline_status); | 682 proxy_->DemuxerEndOfStream(pipeline_status); |
683 | 683 |
684 if (old_duration != duration()) | 684 if (old_duration != duration()) |
685 GetClient()->durationChanged(); | 685 GetClient()->durationChanged(); |
686 } | 686 } |
687 | 687 |
688 bool WebMediaPlayerImpl::sourceSetTimestampOffset(const WebKit::WebString& id, | 688 bool WebMediaPlayerImpl::sourceSetTimestampOffset(const WebKit::WebString& id, |
689 double offset) { | 689 double offset) { |
690 return proxy_->DemuxerSetTimestampOffset(id.utf8().data(), offset); | 690 base::TimeDelta time_offset = base::TimeDelta::FromMicroseconds( |
| 691 offset * base::Time::kMicrosecondsPerSecond); |
| 692 return proxy_->DemuxerSetTimestampOffset(id.utf8().data(), time_offset); |
691 } | 693 } |
692 | 694 |
693 WebKit::WebMediaPlayer::MediaKeyException | 695 WebKit::WebMediaPlayer::MediaKeyException |
694 WebMediaPlayerImpl::generateKeyRequest(const WebString& key_system, | 696 WebMediaPlayerImpl::generateKeyRequest(const WebString& key_system, |
695 const unsigned char* init_data, | 697 const unsigned char* init_data, |
696 unsigned init_data_length) { | 698 unsigned init_data_length) { |
697 if (!IsSupportedKeySystem(key_system)) | 699 if (!IsSupportedKeySystem(key_system)) |
698 return WebKit::WebMediaPlayer::MediaKeyExceptionKeySystemNotSupported; | 700 return WebKit::WebMediaPlayer::MediaKeyExceptionKeySystemNotSupported; |
699 | 701 |
700 // We do not support run-time switching between key systems for now. | 702 // We do not support run-time switching between key systems for now. |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 return audio_source_provider_; | 1032 return audio_source_provider_; |
1031 } | 1033 } |
1032 | 1034 |
1033 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { | 1035 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { |
1034 DCHECK_EQ(main_loop_, MessageLoop::current()); | 1036 DCHECK_EQ(main_loop_, MessageLoop::current()); |
1035 incremented_externally_allocated_memory_ = true; | 1037 incremented_externally_allocated_memory_ = true; |
1036 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); | 1038 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); |
1037 } | 1039 } |
1038 | 1040 |
1039 } // namespace webkit_media | 1041 } // namespace webkit_media |
OLD | NEW |