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

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

Issue 1128143005: MediaDrmBridge: Update ConvertInitDataType(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@init_data
Patch Set: comments addressed 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
« no previous file with comments | « no previous file | 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/base/android/media_drm_bridge.h" 5 #include "media/base/android/media_drm_bridge.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/android/build_info.h" 9 #include "base/android/build_info.h"
10 #include "base/android/jni_array.h" 10 #include "base/android/jni_array.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 return std::string(session_id_vector.begin(), session_id_vector.end()); 49 return std::string(session_id_vector.begin(), session_id_vector.end());
50 } 50 }
51 51
52 const uint8 kWidevineUuid[16] = { 52 const uint8 kWidevineUuid[16] = {
53 0xED, 0xEF, 0x8B, 0xA9, 0x79, 0xD6, 0x4A, 0xCE, 53 0xED, 0xEF, 0x8B, 0xA9, 0x79, 0xD6, 0x4A, 0xCE,
54 0xA3, 0xC8, 0x27, 0xDC, 0xD5, 0x1D, 0x21, 0xED }; 54 0xA3, 0xC8, 0x27, 0xDC, 0xD5, 0x1D, 0x21, 0xED };
55 55
56 // Convert |init_data_type| to a string supported by MediaDRM. 56 // Convert |init_data_type| to a string supported by MediaDRM.
57 // "audio"/"video" does not matter, so use "video". 57 // "audio"/"video" does not matter, so use "video".
58 std::string ConvertInitDataType(media::EmeInitDataType init_data_type) { 58 std::string ConvertInitDataType(media::EmeInitDataType init_data_type) {
59 // TODO(jrummell): API level >=20 supports "webm" and "cenc", so switch 59 // TODO(jrummell/xhwang): EME init data types like "webm" and "cenc" are
60 // to those strings. 60 // supported in API level >=21 for Widevine key system. Switch to use those
61 // strings when they are officially supported in Android for all key systems.
61 switch (init_data_type) { 62 switch (init_data_type) {
62 case media::EmeInitDataType::WEBM: 63 case media::EmeInitDataType::WEBM:
63 return "video/webm"; 64 return "video/webm";
64 case media::EmeInitDataType::CENC: 65 case media::EmeInitDataType::CENC:
65 return "video/mp4"; 66 return "video/mp4";
67 case media::EmeInitDataType::KEYIDS:
68 return "keyids";
66 default: 69 default:
67 NOTREACHED(); 70 NOTREACHED();
68 return "video/unknown"; 71 return "unknown";
69 } 72 }
70 } 73 }
71 74
72 class KeySystemManager { 75 class KeySystemManager {
73 public: 76 public:
74 KeySystemManager(); 77 KeySystemManager();
75 UUID GetUUID(const std::string& key_system); 78 UUID GetUUID(const std::string& key_system);
76 std::vector<std::string> GetPlatformKeySystemNames(); 79 std::vector<std::string> GetPlatformKeySystemNames();
77 80
78 private: 81 private:
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 JNIEnv* env = AttachCurrentThread(); 539 JNIEnv* env = AttachCurrentThread();
537 Java_MediaDrmBridge_resetDeviceCredentials(env, j_media_drm_.obj()); 540 Java_MediaDrmBridge_resetDeviceCredentials(env, j_media_drm_.obj());
538 } 541 }
539 542
540 void MediaDrmBridge::OnResetDeviceCredentialsCompleted( 543 void MediaDrmBridge::OnResetDeviceCredentialsCompleted(
541 JNIEnv* env, jobject, bool success) { 544 JNIEnv* env, jobject, bool success) {
542 base::ResetAndReturn(&reset_credentials_cb_).Run(success); 545 base::ResetAndReturn(&reset_credentials_cb_).Run(success);
543 } 546 }
544 547
545 } // namespace media 548 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698