WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-162914-20161016190620.patch (text/plain), 5.21 KB, created by
Enrique Ocaña
on 2016-10-16 12:09:52 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Enrique Ocaña
Created:
2016-10-16 12:09:52 PDT
Size:
5.21 KB
patch
obsolete
>Subversion Revision: 207345 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 56ee576bdc2fcf821eedf1a4e35b93623257b468..9ce6ba74c8e959a1afe28ac4e1de88cbeac32eb6 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,5 +1,21 @@ > 2016-10-04 Enrique Ocaña González <eocanha@igalia.com> > >+ [GStreamer][EME] Utility function to create decryptor >+ https://bugs.webkit.org/show_bug.cgi?id=162914 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add a utility function to find a suitable GStreamer decryptor element. >+ >+ This patch is authored by Philippe Normand <philn@igalia.com>. >+ >+ * platform/graphics/gstreamer/GStreamerUtilities.cpp: >+ (WebCore::createGstDecryptor): >+ (WebCore::gstRegistryHasElementForMediaType): Deleted. >+ * platform/graphics/gstreamer/GStreamerUtilities.h: >+ >+2016-10-04 Enrique Ocaña González <eocanha@igalia.com> >+ > [GStreamer][MSE][EME] Remove MSE code from regular player and add EME support > https://bugs.webkit.org/show_bug.cgi?id=162911 > >diff --git a/Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.cpp b/Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.cpp >index b6b14a54ba998fc388a67f52c4276bb1db8080b6..76c03ed3f032105ad810b06b53d68c7330a63193 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.cpp >@@ -1,5 +1,6 @@ > /* >- * Copyright (C) 2012 Igalia S.L >+ * Copyright (C) 2012, 2015, 2016 Igalia S.L >+ * Copyright (C) 2015, 2016 Metrological Group B.V. > * > * This library is free software; you can redistribute it and/or > * modify it under the terms of the GNU Lesser General Public >@@ -196,6 +197,46 @@ bool gstRegistryHasElementForMediaType(GList* elementFactories, const char* caps > return result; > } > >+#if GST_CHECK_VERSION(1, 5, 3) && ENABLE(LEGACY_ENCRYPTED_MEDIA) >+GstElement* createGstDecryptor(const gchar* protectionSystem) >+{ >+ GstElement* decryptor = nullptr; >+ GList* decryptors = gst_element_factory_list_get_elements(GST_ELEMENT_FACTORY_TYPE_DECRYPTOR, GST_RANK_MARGINAL); >+ >+ GST_TRACE("looking for decryptor for %s", protectionSystem); >+ >+ for (GList* walk = decryptors; !decryptor && walk; walk = g_list_next(walk)) { >+ GstElementFactory* factory = reinterpret_cast<GstElementFactory*>(walk->data); >+ >+ GST_TRACE("checking factory %s", GST_OBJECT_NAME(factory)); >+ >+ for (const GList* current = gst_element_factory_get_static_pad_templates(factory); current && !decryptor; current = g_list_next(current)) { >+ GstStaticPadTemplate* staticPadTemplate = static_cast<GstStaticPadTemplate*>(current->data); >+ GRefPtr<GstCaps> caps = adoptGRef(gst_static_pad_template_get_caps(staticPadTemplate)); >+ unsigned length = gst_caps_get_size(caps.get()); >+ >+ GST_TRACE("factory %s caps has size %u", GST_OBJECT_NAME(factory), length); >+ for (unsigned i = 0; !decryptor && i < length; ++i) { >+ GstStructure* structure = gst_caps_get_structure(caps.get(), i); >+ GST_TRACE("checking structure %s", gst_structure_get_name(structure)); >+ if (gst_structure_has_field_typed(structure, GST_PROTECTION_SYSTEM_ID_CAPS_FIELD, G_TYPE_STRING)) { >+ const gchar* sysId = gst_structure_get_string(structure, GST_PROTECTION_SYSTEM_ID_CAPS_FIELD); >+ GST_TRACE("structure %s has protection system %s", gst_structure_get_name(structure), sysId); >+ if (!g_ascii_strcasecmp(protectionSystem, sysId)) { >+ GST_DEBUG("found decryptor %s for %s", GST_OBJECT_NAME(factory), protectionSystem); >+ decryptor = gst_element_factory_create(factory, nullptr); >+ break; >+ } >+ } >+ } >+ } >+ } >+ gst_plugin_feature_list_free(decryptors); >+ GST_TRACE("returning decryptor %p", decryptor); >+ return decryptor; >+} >+#endif >+ > } > > #endif // USE(GSTREAMER) >diff --git a/Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.h b/Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.h >index b235172d0a1967c993ca825dbc89ac2bd21c0c0a..27659bf0bf98c2bc542f02bb109b8f3a4e6dbd0d 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.h >+++ b/Source/WebCore/platform/graphics/gstreamer/GStreamerUtilities.h >@@ -1,5 +1,6 @@ > /* >- * Copyright (C) 2012 Igalia S.L >+ * Copyright (C) 2012, 2015, 2016 Igalia S.L >+ * Copyright (C) 2015, 2016 Metrological Group B.V. > * > * This library is free software; you can redistribute it and/or > * modify it under the terms of the GNU Lesser General Public >@@ -16,6 +17,8 @@ > * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA > */ > >+#pragma once >+ > #include "Logging.h" > > #include <gst/gst.h> >@@ -61,4 +64,8 @@ bool initializeGStreamer(); > unsigned getGstPlayFlag(const char* nick); > GstClockTime toGstClockTime(float time); > bool gstRegistryHasElementForMediaType(GList* elementFactories, const char* capsString); >+ >+#if GST_CHECK_VERSION(1, 5, 3) && ENABLE(LEGACY_ENCRYPTED_MEDIA) >+GstElement* createGstDecryptor(const gchar* protectionSystem); >+#endif > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 162914
:
290610
|
291769
|
292899