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

Side by Side Diff: media/base/android/browser_cdm_factory_android.cc

Issue 1408793009: media: Remove BrowserCdmFactory inferface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment for DEPS change. Created 5 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 | « media/base/android/browser_cdm_factory_android.h ('k') | media/base/browser_cdm_factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "media/base/android/browser_cdm_factory_android.h"
6
7 #include "base/command_line.h"
8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "media/base/android/media_drm_bridge.h"
11 #include "media/base/media_switches.h"
12 #include "third_party/widevine/cdm/widevine_cdm_common.h"
13
14 namespace media {
15
16 scoped_refptr<MediaKeys> BrowserCdmFactoryAndroid::CreateBrowserCdm(
17 const std::string& key_system,
18 bool use_hw_secure_codecs,
19 const SessionMessageCB& session_message_cb,
20 const SessionClosedCB& session_closed_cb,
21 const LegacySessionErrorCB& legacy_session_error_cb,
22 const SessionKeysChangeCB& session_keys_change_cb,
23 const SessionExpirationUpdateCB& session_expiration_update_cb) {
24 if (!MediaDrmBridge::IsKeySystemSupported(key_system)) {
25 NOTREACHED() << "Key system not supported unexpectedly: " << key_system;
26 return nullptr;
27 }
28
29 scoped_refptr<MediaDrmBridge> cdm(
30 MediaDrmBridge::Create(key_system, session_message_cb, session_closed_cb,
31 legacy_session_error_cb, session_keys_change_cb,
32 session_expiration_update_cb));
33 if (!cdm) {
34 NOTREACHED() << "MediaDrmBridge cannot be created for " << key_system;
35 return nullptr;
36 }
37
38 if (key_system == kWidevineKeySystem) {
39 MediaDrmBridge::SecurityLevel security_level =
40 use_hw_secure_codecs ? MediaDrmBridge::SECURITY_LEVEL_1
41 : MediaDrmBridge::SECURITY_LEVEL_3;
42 if (!cdm->SetSecurityLevel(security_level)) {
43 DVLOG(1) << "failed to set security level " << security_level;
44 return nullptr;
45 }
46 } else {
47 // Assume other key systems require hardware-secure codecs and thus do not
48 // support full compositing.
49 if (!use_hw_secure_codecs) {
50 NOTREACHED()
51 << key_system
52 << " may require use_video_overlay_for_embedded_encrypted_video";
53 return nullptr;
54 }
55 }
56
57 return cdm;
58 }
59
60 } // namespace media
OLDNEW
« no previous file with comments | « media/base/android/browser_cdm_factory_android.h ('k') | media/base/browser_cdm_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698