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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 DCHECK_EQ(main_loop_, MessageLoop::current()); | 646 DCHECK_EQ(main_loop_, MessageLoop::current()); |
647 std::vector<std::string> new_codecs(codecs.size()); | 647 std::vector<std::string> new_codecs(codecs.size()); |
648 for (size_t i = 0; i < codecs.size(); ++i) | 648 for (size_t i = 0; i < codecs.size(); ++i) |
649 new_codecs[i] = codecs[i].utf8().data(); | 649 new_codecs[i] = codecs[i].utf8().data(); |
650 | 650 |
651 return static_cast<WebKit::WebMediaPlayer::AddIdStatus>( | 651 return static_cast<WebKit::WebMediaPlayer::AddIdStatus>( |
652 proxy_->DemuxerAddId(id.utf8().data(), type.utf8().data(), | 652 proxy_->DemuxerAddId(id.utf8().data(), type.utf8().data(), |
653 new_codecs)); | 653 new_codecs)); |
654 } | 654 } |
655 | 655 |
| 656 bool WebMediaPlayerImpl::sourceTimestampOffset( |
| 657 const WebKit::WebString& id, double offset) { |
| 658 return proxy_->DemuxerSetTimestampOffset(id.utf8().data(), offset); |
| 659 } |
| 660 |
656 bool WebMediaPlayerImpl::sourceRemoveId(const WebKit::WebString& id) { | 661 bool WebMediaPlayerImpl::sourceRemoveId(const WebKit::WebString& id) { |
657 DCHECK(!id.isEmpty()); | 662 DCHECK(!id.isEmpty()); |
658 proxy_->DemuxerRemoveId(id.utf8().data()); | 663 proxy_->DemuxerRemoveId(id.utf8().data()); |
659 return true; | 664 return true; |
660 } | 665 } |
661 | 666 |
662 WebKit::WebTimeRanges WebMediaPlayerImpl::sourceBuffered( | 667 WebKit::WebTimeRanges WebMediaPlayerImpl::sourceBuffered( |
663 const WebKit::WebString& id) { | 668 const WebKit::WebString& id) { |
664 return ConvertToWebTimeRanges(proxy_->DemuxerBufferedRange(id.utf8().data())); | 669 return ConvertToWebTimeRanges(proxy_->DemuxerBufferedRange(id.utf8().data())); |
665 } | 670 } |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1047 return audio_source_provider_; | 1052 return audio_source_provider_; |
1048 } | 1053 } |
1049 | 1054 |
1050 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { | 1055 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { |
1051 DCHECK_EQ(main_loop_, MessageLoop::current()); | 1056 DCHECK_EQ(main_loop_, MessageLoop::current()); |
1052 incremented_externally_allocated_memory_ = true; | 1057 incremented_externally_allocated_memory_ = true; |
1053 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); | 1058 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); |
1054 } | 1059 } |
1055 | 1060 |
1056 } // namespace webkit_media | 1061 } // namespace webkit_media |
OLD | NEW |