Changeset 273311 in webkit
- Timestamp:
- Feb 23, 2021, 9:09:50 AM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
platform/graphics/gstreamer/GStreamerCommon.cpp (modified) (1 diff)
-
platform/graphics/gstreamer/eme/CDMThunder.cpp (modified) (2 diffs)
-
platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r273310 r273311 1 2021-02-23 Xabier Rodriguez Calvar <calvaris@igalia.com> 2 3 [GStreamer][EME][Thunder] Initialize decryptor lazily 4 https://bugs.webkit.org/show_bug.cgi?id=222314 5 6 Reviewed by Philippe Normand. 7 8 In some cases, WebKit can be run before Thunder nano services are 9 up and without PSON, the result can be that you end up with WebKit 10 thinking there is no DRM system available. 11 12 First thing this patch does it removing the once flag so we keep 13 asking if there are DRM systems available if we are asked about 14 them from JS. 15 16 Second thing is that if we are queried from JS about the 17 availability of DRM systems and there are some available, we 18 initialize the decryptor. 19 20 * platform/graphics/gstreamer/GStreamerCommon.cpp: 21 (WebCore::registerWebKitGStreamerElements): 22 * platform/graphics/gstreamer/eme/CDMThunder.cpp: 23 (WebCore::CDMFactoryThunder::supportedKeySystems const): 24 * platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp: 25 1 26 2021-02-23 Don Olmstead <don.olmstead@sony.com> 2 27 -
trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp
r272129 r273311 312 312 #if ENABLE(ENCRYPTED_MEDIA) 313 313 gst_element_register(nullptr, "webkitclearkey", GST_RANK_PRIMARY + 200, WEBKIT_TYPE_MEDIA_CK_DECRYPT); 314 #if ENABLE(THUNDER)315 unsigned thunderRank = isThunderRanked() ? 300 : 100;316 gst_element_register(nullptr, "webkitthunder", GST_RANK_PRIMARY + thunderRank, WEBKIT_TYPE_MEDIA_THUNDER_DECRYPT);317 #endif318 314 #endif 319 315 -
trunk/Source/WebCore/platform/graphics/gstreamer/eme/CDMThunder.cpp
r272369 r273311 43 43 #include "NotImplemented.h" 44 44 #include "SharedBuffer.h" 45 #include "WebKitThunderDecryptorGStreamer.h" 45 46 #include <algorithm> 46 47 #include <iterator> … … 115 116 const Vector<String>& CDMFactoryThunder::supportedKeySystems() const 116 117 { 117 static std::once_flag onceFlag; 118 ASSERT(isMainThread()); 119 118 120 static Vector<String> supportedKeySystems; 119 std::call_once(onceFlag, []{121 if (supportedKeySystems.isEmpty()) { 120 122 std::string emptyString; 121 123 if (opencdm_is_type_supported(GStreamerEMEUtilities::s_WidevineKeySystem, emptyString.c_str()) == ERROR_NONE) 122 124 supportedKeySystems.append(GStreamerEMEUtilities::s_WidevineKeySystem); 125 if (!supportedKeySystems.isEmpty()) { 126 unsigned thunderRank = isThunderRanked() ? 300 : 100; 127 gst_element_register(nullptr, "webkitthunder", GST_RANK_PRIMARY + thunderRank, WEBKIT_TYPE_MEDIA_THUNDER_DECRYPT); 128 } 123 129 #ifndef NDEBUG 124 if (supportedKeySystems.isEmpty() && isThunderRanked()) {125 ASSERT_NOT_REACHED_WITH_MESSAGE("Thunder is up-ranked as preferred decryptor but Thunder is not supporting any encryption system. Is "130 else if (isThunderRanked()) 131 GST_WARNING("Thunder is up-ranked as preferred decryptor but Thunder is not supporting any encryption system. Is " 126 132 "Thunder running? Are the plugins built?"); 127 }128 133 #endif 129 }); 134 GST_DEBUG("%u supported key systems", supportedKeySystems.size()); 135 }; 130 136 return supportedKeySystems; 131 137 } -
trunk/Source/WebCore/platform/graphics/gstreamer/eme/WebKitThunderDecryptorGStreamer.cpp
r272369 r273311 71 71 GRefPtr<GstCaps> caps = adoptGRef(gst_caps_new_empty()); 72 72 73 if (CDMFactoryThunder::singleton().supportedKeySystems().isEmpty()) { 73 auto& supportedKeySystems = CDMFactoryThunder::singleton().supportedKeySystems(); 74 75 if (supportedKeySystems.isEmpty()) { 74 76 GST_WARNING("no supported key systems in Thunder, we won't be able to decrypt anything with the its decryptor"); 75 77 return caps; … … 80 82 cencEncryptionMediaTypes[i], nullptr)); 81 83 } 82 for (const auto& keySystem : CDMFactoryThunder::singleton().supportedKeySystems()) {84 for (const auto& keySystem : supportedKeySystems) { 83 85 for (int i = 0; cencEncryptionMediaTypes[i]; ++i) { 84 86 gst_caps_append_structure(caps.get(), gst_structure_new("application/x-cenc", "original-media-type", G_TYPE_STRING,
Note:
See TracChangeset
for help on using the changeset viewer.