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