| 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 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/message_loop_proxy.h" | 14 #include "base/message_loop_proxy.h" |
| 15 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
| 16 #include "base/string_number_conversions.h" | 16 #include "base/string_number_conversions.h" |
| 17 #include "base/synchronization/waitable_event.h" | 17 #include "base/synchronization/waitable_event.h" |
| 18 #include "media/audio/null_audio_sink.h" | 18 #include "media/audio/null_audio_sink.h" |
| 19 #include "media/base/filter_collection.h" | 19 #include "media/base/filter_collection.h" |
| 20 #include "media/base/limits.h" | 20 #include "media/base/limits.h" |
| 21 #include "media/base/media_log.h" | 21 #include "media/base/media_log.h" |
| 22 #include "media/base/media_switches.h" | 22 #include "media/base/media_switches.h" |
| 23 #include "media/base/pipeline.h" | 23 #include "media/base/pipeline.h" |
| 24 #include "media/base/video_frame.h" | 24 #include "media/base/video_frame.h" |
| 25 #include "media/crypto/aes_decryptor.h" | |
| 26 #include "media/filters/audio_renderer_impl.h" | 25 #include "media/filters/audio_renderer_impl.h" |
| 27 #include "media/filters/video_renderer_base.h" | 26 #include "media/filters/video_renderer_base.h" |
| 28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVideoFrame.h" | 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVideoFrame.h" |
| 29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 30 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" | 29 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" |
| 31 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" | 30 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" |
| 32 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 31 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
| 33 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" | 32 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURL.h" |
| 34 #include "v8/include/v8.h" | 33 #include "v8/include/v8.h" |
| 35 #include "webkit/media/buffered_data_source.h" | 34 #include "webkit/media/buffered_data_source.h" |
| 36 #include "webkit/media/filter_helpers.h" | 35 #include "webkit/media/filter_helpers.h" |
| 37 #include "webkit/media/key_systems.h" | |
| 38 #include "webkit/media/webmediaplayer_delegate.h" | 36 #include "webkit/media/webmediaplayer_delegate.h" |
| 39 #include "webkit/media/webmediaplayer_proxy.h" | 37 #include "webkit/media/webmediaplayer_proxy.h" |
| 40 #include "webkit/media/webmediaplayer_util.h" | 38 #include "webkit/media/webmediaplayer_util.h" |
| 41 #include "webkit/media/webvideoframe_impl.h" | 39 #include "webkit/media/webvideoframe_impl.h" |
| 42 | 40 |
| 43 using WebKit::WebCanvas; | 41 using WebKit::WebCanvas; |
| 44 using WebKit::WebMediaPlayer; | 42 using WebKit::WebMediaPlayer; |
| 45 using WebKit::WebRect; | 43 using WebKit::WebRect; |
| 46 using WebKit::WebSize; | 44 using WebKit::WebSize; |
| 47 using WebKit::WebString; | 45 using WebKit::WebString; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 75 // Also our timers are not very accurate (especially for ogg), which becomes | 73 // Also our timers are not very accurate (especially for ogg), which becomes |
| 76 // evident at low speeds and on Vista. Since other speeds are risky and outside | 74 // evident at low speeds and on Vista. Since other speeds are risky and outside |
| 77 // the norms, we think 1/16x to 16x is a safe and useful range for now. | 75 // the norms, we think 1/16x to 16x is a safe and useful range for now. |
| 78 const float kMinRate = 0.0625f; | 76 const float kMinRate = 0.0625f; |
| 79 const float kMaxRate = 16.0f; | 77 const float kMaxRate = 16.0f; |
| 80 | 78 |
| 81 } // namespace | 79 } // namespace |
| 82 | 80 |
| 83 namespace webkit_media { | 81 namespace webkit_media { |
| 84 | 82 |
| 85 #define COMPILE_ASSERT_MATCHING_ENUM(name) \ | 83 #define COMPILE_ASSERT_MATCHING_ENUM(name) \ |
| 86 COMPILE_ASSERT(static_cast<int>(WebKit::WebMediaPlayer::CORSMode ## name) == \ | 84 COMPILE_ASSERT(static_cast<int>(WebKit::WebMediaPlayer::CORSMode ## name) == \ |
| 87 static_cast<int>(BufferedResourceLoader::k ## name), \ | 85 static_cast<int>(BufferedResourceLoader::k ## name), \ |
| 88 mismatching_enums) | 86 mismatching_enums) |
| 89 COMPILE_ASSERT_MATCHING_ENUM(Unspecified); | 87 COMPILE_ASSERT_MATCHING_ENUM(Unspecified); |
| 90 COMPILE_ASSERT_MATCHING_ENUM(Anonymous); | 88 COMPILE_ASSERT_MATCHING_ENUM(Anonymous); |
| 91 COMPILE_ASSERT_MATCHING_ENUM(UseCredentials); | 89 COMPILE_ASSERT_MATCHING_ENUM(UseCredentials); |
| 92 #undef COMPILE_ASSERT_MATCHING_ENUM | 90 #undef COMPILE_ASSERT_MATCHING_ENUM |
| 93 | 91 |
| 94 static WebKit::WebTimeRanges ConvertToWebTimeRanges( | 92 static WebKit::WebTimeRanges ConvertToWebTimeRanges( |
| 95 const media::Ranges<base::TimeDelta>& ranges) { | 93 const media::Ranges<base::TimeDelta>& ranges) { |
| 96 WebKit::WebTimeRanges result(ranges.size()); | 94 WebKit::WebTimeRanges result(ranges.size()); |
| 97 for (size_t i = 0; i < ranges.size(); i++) { | 95 for (size_t i = 0; i < ranges.size(); i++) { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 123 pending_seek_(false), | 121 pending_seek_(false), |
| 124 pending_seek_seconds_(0.0f), | 122 pending_seek_seconds_(0.0f), |
| 125 client_(client), | 123 client_(client), |
| 126 proxy_(new WebMediaPlayerProxy(main_loop_->message_loop_proxy(), this)), | 124 proxy_(new WebMediaPlayerProxy(main_loop_->message_loop_proxy(), this)), |
| 127 delegate_(delegate), | 125 delegate_(delegate), |
| 128 media_stream_client_(media_stream_client), | 126 media_stream_client_(media_stream_client), |
| 129 media_log_(media_log), | 127 media_log_(media_log), |
| 130 accelerated_compositing_reported_(false), | 128 accelerated_compositing_reported_(false), |
| 131 incremented_externally_allocated_memory_(false), | 129 incremented_externally_allocated_memory_(false), |
| 132 audio_source_provider_(audio_source_provider), | 130 audio_source_provider_(audio_source_provider), |
| 133 is_local_source_(false) { | 131 is_local_source_(false), |
| 132 decryptor_(proxy_.get()) { |
| 134 media_log_->AddEvent( | 133 media_log_->AddEvent( |
| 135 media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_CREATED)); | 134 media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_CREATED)); |
| 136 | 135 |
| 137 MessageLoop* pipeline_message_loop = | 136 MessageLoop* pipeline_message_loop = |
| 138 message_loop_factory_->GetMessageLoop("PipelineThread"); | 137 message_loop_factory_->GetMessageLoop("PipelineThread"); |
| 139 pipeline_ = new media::Pipeline(pipeline_message_loop, media_log_); | 138 pipeline_ = new media::Pipeline(pipeline_message_loop, media_log_); |
| 140 | 139 |
| 141 // Let V8 know we started new thread if we did not did it yet. | 140 // Let V8 know we started new thread if we did not did it yet. |
| 142 // Made separate task to avoid deletion of player currently being created. | 141 // Made separate task to avoid deletion of player currently being created. |
| 143 // Also, delaying GC until after player starts gets rid of starting lag -- | 142 // Also, delaying GC until after player starts gets rid of starting lag -- |
| (...skipping 13 matching lines...) Expand all Loading... |
| 157 new media::VideoRendererBase( | 156 new media::VideoRendererBase( |
| 158 base::Bind(&WebMediaPlayerProxy::Repaint, proxy_), | 157 base::Bind(&WebMediaPlayerProxy::Repaint, proxy_), |
| 159 base::Bind(&WebMediaPlayerProxy::SetOpaque, proxy_.get()), | 158 base::Bind(&WebMediaPlayerProxy::SetOpaque, proxy_.get()), |
| 160 true); | 159 true); |
| 161 filter_collection_->AddVideoRenderer(video_renderer); | 160 filter_collection_->AddVideoRenderer(video_renderer); |
| 162 proxy_->set_frame_provider(video_renderer); | 161 proxy_->set_frame_provider(video_renderer); |
| 163 | 162 |
| 164 // Create default audio renderer. | 163 // Create default audio renderer. |
| 165 filter_collection_->AddAudioRenderer( | 164 filter_collection_->AddAudioRenderer( |
| 166 new media::AudioRendererImpl(new media::NullAudioSink())); | 165 new media::AudioRendererImpl(new media::NullAudioSink())); |
| 167 | |
| 168 decryptor_.reset(new media::AesDecryptor(proxy_.get())); | |
| 169 } | 166 } |
| 170 | 167 |
| 171 WebMediaPlayerImpl::~WebMediaPlayerImpl() { | 168 WebMediaPlayerImpl::~WebMediaPlayerImpl() { |
| 172 DCHECK_EQ(main_loop_, MessageLoop::current()); | 169 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 173 Destroy(); | 170 Destroy(); |
| 174 media_log_->AddEvent( | 171 media_log_->AddEvent( |
| 175 media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_DESTROYED)); | 172 media_log_->CreateEvent(media::MediaLogEvent::WEBMEDIAPLAYER_DESTROYED)); |
| 176 | 173 |
| 177 if (delegate_) | 174 if (delegate_) |
| 178 delegate_->PlayerGone(this); | 175 delegate_->PlayerGone(this); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 filter_collection_.get())) { | 235 filter_collection_.get())) { |
| 239 StartPipeline(); | 236 StartPipeline(); |
| 240 return; | 237 return; |
| 241 } | 238 } |
| 242 | 239 |
| 243 // Media source pipelines can start immediately. | 240 // Media source pipelines can start immediately. |
| 244 scoped_refptr<media::FFmpegVideoDecoder> video_decoder; | 241 scoped_refptr<media::FFmpegVideoDecoder> video_decoder; |
| 245 if (BuildMediaSourceCollection(url, GetClient()->sourceURL(), proxy_, | 242 if (BuildMediaSourceCollection(url, GetClient()->sourceURL(), proxy_, |
| 246 message_loop_factory_.get(), | 243 message_loop_factory_.get(), |
| 247 filter_collection_.get(), | 244 filter_collection_.get(), |
| 248 decryptor_.get(), | 245 &decryptor_, |
| 249 &video_decoder)) { | 246 &video_decoder)) { |
| 250 proxy_->set_video_decoder(video_decoder); | 247 proxy_->set_video_decoder(video_decoder); |
| 251 StartPipeline(); | 248 StartPipeline(); |
| 252 return; | 249 return; |
| 253 } | 250 } |
| 254 | 251 |
| 255 // Otherwise it's a regular request which requires resolving the URL first. | 252 // Otherwise it's a regular request which requires resolving the URL first. |
| 256 proxy_->set_data_source( | 253 proxy_->set_data_source( |
| 257 new BufferedDataSource(main_loop_, frame_, media_log_, | 254 new BufferedDataSource(main_loop_, frame_, media_log_, |
| 258 base::Bind(&WebMediaPlayerImpl::NotifyDownloading, | 255 base::Bind(&WebMediaPlayerImpl::NotifyDownloading, |
| 259 base::Unretained(this)))); | 256 base::Unretained(this)))); |
| 260 proxy_->data_source()->Initialize( | 257 proxy_->data_source()->Initialize( |
| 261 url, static_cast<BufferedResourceLoader::CORSMode>(cors_mode), | 258 url, static_cast<BufferedResourceLoader::CORSMode>(cors_mode), |
| 262 base::Bind( | 259 base::Bind( |
| 263 &WebMediaPlayerImpl::DataSourceInitialized, | 260 &WebMediaPlayerImpl::DataSourceInitialized, |
| 264 base::Unretained(this), gurl)); | 261 base::Unretained(this), gurl)); |
| 265 | 262 |
| 266 is_local_source_ = !gurl.SchemeIs("http") && !gurl.SchemeIs("https"); | 263 is_local_source_ = !gurl.SchemeIs("http") && !gurl.SchemeIs("https"); |
| 267 | 264 |
| 268 BuildDefaultCollection(proxy_->data_source(), | 265 BuildDefaultCollection(proxy_->data_source(), |
| 269 message_loop_factory_.get(), | 266 message_loop_factory_.get(), |
| 270 filter_collection_.get(), | 267 filter_collection_.get(), |
| 271 decryptor_.get(), | 268 &decryptor_, |
| 272 &video_decoder); | 269 &video_decoder); |
| 273 proxy_->set_video_decoder(video_decoder); | 270 proxy_->set_video_decoder(video_decoder); |
| 274 } | 271 } |
| 275 | 272 |
| 276 void WebMediaPlayerImpl::cancelLoad() { | 273 void WebMediaPlayerImpl::cancelLoad() { |
| 277 DCHECK_EQ(main_loop_, MessageLoop::current()); | 274 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 278 } | 275 } |
| 279 | 276 |
| 280 void WebMediaPlayerImpl::play() { | 277 void WebMediaPlayerImpl::play() { |
| 281 DCHECK_EQ(main_loop_, MessageLoop::current()); | 278 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 703 proxy_->DemuxerEndOfStream(pipeline_status); | 700 proxy_->DemuxerEndOfStream(pipeline_status); |
| 704 } | 701 } |
| 705 | 702 |
| 706 WebKit::WebMediaPlayer::MediaKeyException | 703 WebKit::WebMediaPlayer::MediaKeyException |
| 707 WebMediaPlayerImpl::generateKeyRequest(const WebString& key_system, | 704 WebMediaPlayerImpl::generateKeyRequest(const WebString& key_system, |
| 708 const unsigned char* init_data, | 705 const unsigned char* init_data, |
| 709 unsigned init_data_length) { | 706 unsigned init_data_length) { |
| 710 if (!IsSupportedKeySystem(key_system)) | 707 if (!IsSupportedKeySystem(key_system)) |
| 711 return WebKit::WebMediaPlayer::MediaKeyExceptionKeySystemNotSupported; | 708 return WebKit::WebMediaPlayer::MediaKeyExceptionKeySystemNotSupported; |
| 712 | 709 |
| 710 // We do not support run-time switching between key systems for now. |
| 711 if (current_key_system_.isEmpty()) |
| 712 current_key_system_ = key_system; |
| 713 else if (key_system != current_key_system_) |
| 714 return WebKit::WebMediaPlayer::MediaKeyExceptionInvalidPlayerState; |
| 715 |
| 713 DVLOG(1) << "generateKeyRequest: " << key_system.utf8().data() << ": " | 716 DVLOG(1) << "generateKeyRequest: " << key_system.utf8().data() << ": " |
| 714 << std::string(reinterpret_cast<const char*>(init_data), | 717 << std::string(reinterpret_cast<const char*>(init_data), |
| 715 static_cast<size_t>(init_data_length)); | 718 static_cast<size_t>(init_data_length)); |
| 716 | 719 |
| 717 decryptor_->GenerateKeyRequest(key_system.utf8(), | 720 decryptor_.GenerateKeyRequest(key_system.utf8(), |
| 718 init_data, init_data_length); | 721 init_data, init_data_length); |
| 719 return WebKit::WebMediaPlayer::MediaKeyExceptionNoError; | 722 return WebKit::WebMediaPlayer::MediaKeyExceptionNoError; |
| 720 } | 723 } |
| 721 | 724 |
| 722 WebKit::WebMediaPlayer::MediaKeyException WebMediaPlayerImpl::addKey( | 725 WebKit::WebMediaPlayer::MediaKeyException WebMediaPlayerImpl::addKey( |
| 723 const WebString& key_system, | 726 const WebString& key_system, |
| 724 const unsigned char* key, | 727 const unsigned char* key, |
| 725 unsigned key_length, | 728 unsigned key_length, |
| 726 const unsigned char* init_data, | 729 const unsigned char* init_data, |
| 727 unsigned init_data_length, | 730 unsigned init_data_length, |
| 728 const WebString& session_id) { | 731 const WebString& session_id) { |
| 729 DCHECK(key); | 732 DCHECK(key); |
| 730 DCHECK_GT(key_length, 0u); | 733 DCHECK_GT(key_length, 0u); |
| 731 | 734 |
| 732 if (!IsSupportedKeySystem(key_system)) | 735 if (!IsSupportedKeySystem(key_system)) |
| 733 return WebKit::WebMediaPlayer::MediaKeyExceptionKeySystemNotSupported; | 736 return WebKit::WebMediaPlayer::MediaKeyExceptionKeySystemNotSupported; |
| 734 | 737 |
| 738 if (current_key_system_.isEmpty() || key_system != current_key_system_) |
| 739 return WebKit::WebMediaPlayer::MediaKeyExceptionInvalidPlayerState; |
| 740 |
| 735 DVLOG(1) << "addKey: " << key_system.utf8().data() << ": " | 741 DVLOG(1) << "addKey: " << key_system.utf8().data() << ": " |
| 736 << std::string(reinterpret_cast<const char*>(key), | 742 << std::string(reinterpret_cast<const char*>(key), |
| 737 static_cast<size_t>(key_length)) << ", " | 743 static_cast<size_t>(key_length)) << ", " |
| 738 << std::string(reinterpret_cast<const char*>(init_data), | 744 << std::string(reinterpret_cast<const char*>(init_data), |
| 739 static_cast<size_t>(init_data_length)) | 745 static_cast<size_t>(init_data_length)) |
| 740 << " [" << session_id.utf8().data() << "]"; | 746 << " [" << session_id.utf8().data() << "]"; |
| 741 | 747 |
| 742 decryptor_->AddKey(key_system.utf8(), key, key_length, | 748 decryptor_.AddKey(key_system.utf8(), key, key_length, |
| 743 init_data, init_data_length, session_id.utf8()); | 749 init_data, init_data_length, session_id.utf8()); |
| 744 return WebKit::WebMediaPlayer::MediaKeyExceptionNoError; | 750 return WebKit::WebMediaPlayer::MediaKeyExceptionNoError; |
| 745 } | 751 } |
| 746 | 752 |
| 747 WebKit::WebMediaPlayer::MediaKeyException WebMediaPlayerImpl::cancelKeyRequest( | 753 WebKit::WebMediaPlayer::MediaKeyException WebMediaPlayerImpl::cancelKeyRequest( |
| 748 const WebString& key_system, | 754 const WebString& key_system, |
| 749 const WebString& session_id) { | 755 const WebString& session_id) { |
| 750 if (!IsSupportedKeySystem(key_system)) | 756 if (!IsSupportedKeySystem(key_system)) |
| 751 return WebKit::WebMediaPlayer::MediaKeyExceptionKeySystemNotSupported; | 757 return WebKit::WebMediaPlayer::MediaKeyExceptionKeySystemNotSupported; |
| 752 | 758 |
| 753 decryptor_->CancelKeyRequest(key_system.utf8(), session_id.utf8()); | 759 if (current_key_system_.isEmpty() || key_system != current_key_system_) |
| 760 return WebKit::WebMediaPlayer::MediaKeyExceptionInvalidPlayerState; |
| 761 |
| 762 decryptor_.CancelKeyRequest(key_system.utf8(), session_id.utf8()); |
| 754 return WebKit::WebMediaPlayer::MediaKeyExceptionNoError; | 763 return WebKit::WebMediaPlayer::MediaKeyExceptionNoError; |
| 755 } | 764 } |
| 756 | 765 |
| 757 void WebMediaPlayerImpl::WillDestroyCurrentMessageLoop() { | 766 void WebMediaPlayerImpl::WillDestroyCurrentMessageLoop() { |
| 758 Destroy(); | 767 Destroy(); |
| 759 main_loop_ = NULL; | 768 main_loop_ = NULL; |
| 760 } | 769 } |
| 761 | 770 |
| 762 void WebMediaPlayerImpl::Repaint() { | 771 void WebMediaPlayerImpl::Repaint() { |
| 763 DCHECK_EQ(main_loop_, MessageLoop::current()); | 772 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 884 scoped_array<uint8> init_data, | 893 scoped_array<uint8> init_data, |
| 885 int init_data_size) { | 894 int init_data_size) { |
| 886 DCHECK_EQ(main_loop_, MessageLoop::current()); | 895 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 887 | 896 |
| 888 GetClient()->keyNeeded(WebString::fromUTF8(key_system), | 897 GetClient()->keyNeeded(WebString::fromUTF8(key_system), |
| 889 WebString::fromUTF8(session_id), | 898 WebString::fromUTF8(session_id), |
| 890 init_data.get(), | 899 init_data.get(), |
| 891 init_data_size); | 900 init_data_size); |
| 892 } | 901 } |
| 893 | 902 |
| 903 #define COMPILE_ASSERT_MATCHING_ENUM(name) \ |
| 904 COMPILE_ASSERT(static_cast<int>(WebKit::WebMediaPlayerClient::name) == \ |
| 905 static_cast<int>(media::Decryptor::k ## name), \ |
| 906 mismatching_enums) |
| 907 COMPILE_ASSERT_MATCHING_ENUM(UnknownError); |
| 908 COMPILE_ASSERT_MATCHING_ENUM(ClientError); |
| 909 COMPILE_ASSERT_MATCHING_ENUM(ServiceError); |
| 910 COMPILE_ASSERT_MATCHING_ENUM(OutputError); |
| 911 COMPILE_ASSERT_MATCHING_ENUM(HardwareChangeError); |
| 912 COMPILE_ASSERT_MATCHING_ENUM(DomainError); |
| 913 #undef COMPILE_ASSERT_MATCHING_ENUM |
| 914 |
| 894 void WebMediaPlayerImpl::OnKeyError(const std::string& key_system, | 915 void WebMediaPlayerImpl::OnKeyError(const std::string& key_system, |
| 895 const std::string& session_id, | 916 const std::string& session_id, |
| 896 media::Decryptor::KeyError error_code, | 917 media::Decryptor::KeyError error_code, |
| 897 int system_code) { | 918 int system_code) { |
| 898 DCHECK_EQ(main_loop_, MessageLoop::current()); | 919 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 899 | 920 |
| 900 GetClient()->keyError( | 921 GetClient()->keyError( |
| 901 WebString::fromUTF8(key_system), | 922 WebString::fromUTF8(key_system), |
| 902 WebString::fromUTF8(session_id), | 923 WebString::fromUTF8(session_id), |
| 903 static_cast<WebKit::WebMediaPlayerClient::MediaKeyErrorCode>(error_code), | 924 static_cast<WebKit::WebMediaPlayerClient::MediaKeyErrorCode>(error_code), |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1021 return audio_source_provider_; | 1042 return audio_source_provider_; |
| 1022 } | 1043 } |
| 1023 | 1044 |
| 1024 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { | 1045 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { |
| 1025 DCHECK_EQ(main_loop_, MessageLoop::current()); | 1046 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 1026 incremented_externally_allocated_memory_ = true; | 1047 incremented_externally_allocated_memory_ = true; |
| 1027 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); | 1048 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); |
| 1028 } | 1049 } |
| 1029 | 1050 |
| 1030 } // namespace webkit_media | 1051 } // namespace webkit_media |
| OLD | NEW |