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

Side by Side Diff: chromecast/media/cdm/cast_cdm_factory.cc

Issue 2478453002: [Chromecast] Use CdmConfig to create CDM (Closed)
Patch Set: Nit 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
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 "chromecast/media/cdm/cast_cdm_factory.h" 5 #include "chromecast/media/cdm/cast_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 "chromecast/media/cdm/cast_cdm.h" 10 #include "chromecast/media/cdm/cast_cdm.h"
(...skipping 25 matching lines...) Expand all
36 const ::media::CdmConfig& cdm_config, 36 const ::media::CdmConfig& cdm_config,
37 const ::media::SessionMessageCB& session_message_cb, 37 const ::media::SessionMessageCB& session_message_cb,
38 const ::media::SessionClosedCB& session_closed_cb, 38 const ::media::SessionClosedCB& session_closed_cb,
39 const ::media::SessionKeysChangeCB& session_keys_change_cb, 39 const ::media::SessionKeysChangeCB& session_keys_change_cb,
40 const ::media::SessionExpirationUpdateCB& session_expiration_update_cb, 40 const ::media::SessionExpirationUpdateCB& session_expiration_update_cb,
41 const ::media::CdmCreatedCB& cdm_created_cb) { 41 const ::media::CdmCreatedCB& cdm_created_cb) {
42 // Bound |cdm_created_cb| so we always fire it asynchronously. 42 // Bound |cdm_created_cb| so we always fire it asynchronously.
43 ::media::CdmCreatedCB bound_cdm_created_cb = 43 ::media::CdmCreatedCB bound_cdm_created_cb =
44 ::media::BindToCurrentLoop(cdm_created_cb); 44 ::media::BindToCurrentLoop(cdm_created_cb);
45 45
46 DCHECK(!cdm_config.use_hw_secure_codecs)
47 << "Chromecast does not use |use_hw_secure_codecs|";
48
49 CastKeySystem cast_key_system(GetKeySystemByName(key_system)); 46 CastKeySystem cast_key_system(GetKeySystemByName(key_system));
50 47
51 scoped_refptr<chromecast::media::CastCdm> cast_cdm; 48 scoped_refptr<chromecast::media::CastCdm> cast_cdm;
52 if (cast_key_system == chromecast::media::KEY_SYSTEM_CLEAR_KEY) { 49 if (cast_key_system == chromecast::media::KEY_SYSTEM_CLEAR_KEY) {
53 // TODO(gunsch): handle ClearKey decryption. See crbug.com/441957 50 // TODO(gunsch): handle ClearKey decryption. See crbug.com/441957
54 } else { 51 } else {
55 cast_cdm = CreatePlatformBrowserCdm(cast_key_system, security_origin); 52 cast_cdm =
53 CreatePlatformBrowserCdm(cast_key_system, security_origin, cdm_config);
56 } 54 }
57 55
58 if (!cast_cdm) { 56 if (!cast_cdm) {
59 LOG(INFO) << "No matching key system found: " << cast_key_system; 57 LOG(INFO) << "No matching key system found: " << cast_key_system;
60 bound_cdm_created_cb.Run(nullptr, "No matching key system found."); 58 bound_cdm_created_cb.Run(nullptr, "No matching key system found.");
61 return; 59 return;
62 } 60 }
63 61
64 task_runner_->PostTask( 62 task_runner_->PostTask(
65 FROM_HERE, 63 FROM_HERE,
66 base::Bind(&CastCdm::Initialize, base::Unretained(cast_cdm.get()), 64 base::Bind(&CastCdm::Initialize, base::Unretained(cast_cdm.get()),
67 ::media::BindToCurrentLoop(session_message_cb), 65 ::media::BindToCurrentLoop(session_message_cb),
68 ::media::BindToCurrentLoop(session_closed_cb), 66 ::media::BindToCurrentLoop(session_closed_cb),
69 ::media::BindToCurrentLoop(session_keys_change_cb), 67 ::media::BindToCurrentLoop(session_keys_change_cb),
70 ::media::BindToCurrentLoop(session_expiration_update_cb))); 68 ::media::BindToCurrentLoop(session_expiration_update_cb)));
71 69
72 // When using Mojo media, we do not need to proxy calls to the CMA thread. All 70 // When using Mojo media, we do not need to proxy calls to the CMA thread. All
73 // calls are made on that thread already. 71 // calls are made on that thread already.
74 #if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) 72 #if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS)
75 bound_cdm_created_cb.Run(cast_cdm, ""); 73 bound_cdm_created_cb.Run(cast_cdm, "");
76 #else 74 #else
77 bound_cdm_created_cb.Run(new CastCdmProxy(cast_cdm, task_runner_), ""); 75 bound_cdm_created_cb.Run(new CastCdmProxy(cast_cdm, task_runner_), "");
78 #endif // defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) 76 #endif // defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS)
79 } 77 }
80 78
81 scoped_refptr<CastCdm> CastCdmFactory::CreatePlatformBrowserCdm( 79 scoped_refptr<CastCdm> CastCdmFactory::CreatePlatformBrowserCdm(
slan 2016/11/03 19:06:52 Unrelated: All references to "Browser" should be r
82 const CastKeySystem& cast_key_system, 80 const CastKeySystem& cast_key_system,
83 const GURL& security_origin) { 81 const GURL& security_origin,
82 const ::media::CdmConfig& cdm_config) {
84 return nullptr; 83 return nullptr;
85 } 84 }
86 85
87 } // namespace media 86 } // namespace media
88 } // namespace chromecast 87 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/media/cdm/cast_cdm_factory.h ('k') | chromecast/renderer/cast_content_renderer_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698