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

Side by Side Diff: media/mojo/clients/mojo_cdm_factory.cc

Issue 2494983002: media: Supports Clear Key key system for mojo CDM/Renderer combo (Closed)
Patch Set: fix comments Created 4 years, 1 month 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
« no previous file with comments | « content/browser/media/encrypted_media_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/mojo/clients/mojo_cdm_factory.h" 5 #include "media/mojo/clients/mojo_cdm_factory.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 23 matching lines...) Expand all
34 const SessionExpirationUpdateCB& session_expiration_update_cb, 34 const SessionExpirationUpdateCB& session_expiration_update_cb,
35 const CdmCreatedCB& cdm_created_cb) { 35 const CdmCreatedCB& cdm_created_cb) {
36 DVLOG(2) << __FUNCTION__ << ": " << key_system; 36 DVLOG(2) << __FUNCTION__ << ": " << key_system;
37 37
38 if (!security_origin.is_valid()) { 38 if (!security_origin.is_valid()) {
39 base::ThreadTaskRunnerHandle::Get()->PostTask( 39 base::ThreadTaskRunnerHandle::Get()->PostTask(
40 FROM_HERE, base::Bind(cdm_created_cb, nullptr, "Invalid origin.")); 40 FROM_HERE, base::Bind(cdm_created_cb, nullptr, "Invalid origin."));
41 return; 41 return;
42 } 42 }
43 43
44 // When MojoRenderer is used, the real Renderer is running in a remote process,
45 // which cannot use an AesDecryptor running locally. In this case, always
46 // create the MojoCdm, giving the remote CDM a chance to handle |key_system|.
47 // Note: We should not run AesDecryptor in the browser process except for
48 // testing. See http://crbug.com/441957
49 #if !defined(ENABLE_MOJO_RENDERER)
yucliu1 2016/11/11 21:44:38 Can we have mojo cdm without mojo renderer?
xhwang 2016/11/11 21:45:54 Yes, MojoCdm can work with the existing local Rend
44 if (CanUseAesDecryptor(key_system)) { 50 if (CanUseAesDecryptor(key_system)) {
45 scoped_refptr<MediaKeys> cdm( 51 scoped_refptr<MediaKeys> cdm(
46 new AesDecryptor(security_origin, session_message_cb, session_closed_cb, 52 new AesDecryptor(security_origin, session_message_cb, session_closed_cb,
yucliu1 2016/11/12 00:26:24 I remember the AesDecryptor::GetCdmId returns kInv
xhwang 2016/11/12 00:30:01 These are all remote decoders, which will not work
47 session_keys_change_cb)); 53 session_keys_change_cb));
48 base::ThreadTaskRunnerHandle::Get()->PostTask( 54 base::ThreadTaskRunnerHandle::Get()->PostTask(
49 FROM_HERE, base::Bind(cdm_created_cb, cdm, "")); 55 FROM_HERE, base::Bind(cdm_created_cb, cdm, ""));
50 return; 56 return;
51 } 57 }
58 #endif
52 59
53 mojom::ContentDecryptionModulePtr cdm_ptr; 60 mojom::ContentDecryptionModulePtr cdm_ptr;
54 service_manager::GetInterface<mojom::ContentDecryptionModule>( 61 service_manager::GetInterface<mojom::ContentDecryptionModule>(
55 interface_provider_, &cdm_ptr); 62 interface_provider_, &cdm_ptr);
56 63
57 MojoCdm::Create(key_system, security_origin, cdm_config, std::move(cdm_ptr), 64 MojoCdm::Create(key_system, security_origin, cdm_config, std::move(cdm_ptr),
58 session_message_cb, session_closed_cb, session_keys_change_cb, 65 session_message_cb, session_closed_cb, session_keys_change_cb,
59 session_expiration_update_cb, cdm_created_cb); 66 session_expiration_update_cb, cdm_created_cb);
60 } 67 }
61 68
62 } // namespace media 69 } // namespace media
OLDNEW
« no previous file with comments | « content/browser/media/encrypted_media_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698