Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(559)

Side by Side Diff: media/blink/encrypted_media_player_support.cc

Issue 1132323004: Pass video overlay renderer preference to ProxyDecryptor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "media/blink/encrypted_media_player_support.h" 5 #include "media/blink/encrypted_media_player_support.h"
6 6
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 147
148 WebMediaPlayer::MediaKeyException 148 WebMediaPlayer::MediaKeyException
149 EncryptedMediaPlayerSupport::GenerateKeyRequestInternal( 149 EncryptedMediaPlayerSupport::GenerateKeyRequestInternal(
150 blink::WebLocalFrame* frame, 150 blink::WebLocalFrame* frame,
151 const std::string& key_system, 151 const std::string& key_system,
152 const unsigned char* init_data, 152 const unsigned char* init_data,
153 unsigned init_data_length) { 153 unsigned init_data_length) {
154 if (!PrefixedIsSupportedConcreteKeySystem(key_system)) 154 if (!PrefixedIsSupportedConcreteKeySystem(key_system))
155 return WebMediaPlayer::MediaKeyExceptionKeySystemNotSupported; 155 return WebMediaPlayer::MediaKeyExceptionKeySystemNotSupported;
156 156
157 // |use_hw_secure_codecs| is only supported on Android, and Android (WMPA)
158 // does not use EncryptedMediaPlayerSupport.
159 bool use_hw_secure_codecs = false;
160
157 if (!proxy_decryptor_) { 161 if (!proxy_decryptor_) {
158 DCHECK(current_key_system_.empty()); 162 DCHECK(current_key_system_.empty());
159 DCHECK(!cdm_context_ready_cb_.is_null()); 163 DCHECK(!cdm_context_ready_cb_.is_null());
160 proxy_decryptor_.reset(new ProxyDecryptor( 164 proxy_decryptor_.reset(new ProxyDecryptor(
161 media_permission_, 165 media_permission_, use_hw_secure_codecs,
162 BIND_TO_RENDER_LOOP(&EncryptedMediaPlayerSupport::OnKeyAdded), 166 BIND_TO_RENDER_LOOP(&EncryptedMediaPlayerSupport::OnKeyAdded),
163 BIND_TO_RENDER_LOOP(&EncryptedMediaPlayerSupport::OnKeyError), 167 BIND_TO_RENDER_LOOP(&EncryptedMediaPlayerSupport::OnKeyError),
164 BIND_TO_RENDER_LOOP(&EncryptedMediaPlayerSupport::OnKeyMessage))); 168 BIND_TO_RENDER_LOOP(&EncryptedMediaPlayerSupport::OnKeyMessage)));
165 169
166 GURL security_origin(frame->document().securityOrigin().toString()); 170 GURL security_origin(frame->document().securityOrigin().toString());
167 proxy_decryptor_->CreateCdm(cdm_factory_, key_system, security_origin, 171 proxy_decryptor_->CreateCdm(cdm_factory_, key_system, security_origin,
168 cdm_context_ready_cb_); 172 cdm_context_ready_cb_);
169 current_key_system_ = key_system; 173 current_key_system_ = key_system;
170 } 174 }
171 175
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 319
316 client_->keyMessage( 320 client_->keyMessage(
317 WebString::fromUTF8(GetPrefixedKeySystemName(current_key_system_)), 321 WebString::fromUTF8(GetPrefixedKeySystemName(current_key_system_)),
318 WebString::fromUTF8(session_id), 322 WebString::fromUTF8(session_id),
319 message.empty() ? NULL : &message[0], 323 message.empty() ? NULL : &message[0],
320 base::saturated_cast<unsigned int>(message.size()), 324 base::saturated_cast<unsigned int>(message.size()),
321 destination_url); 325 destination_url);
322 } 326 }
323 327
324 } // namespace media 328 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698