Changeset 271399 in webkit


Ignore:
Timestamp:
Jan 12, 2021 4:33:25 AM (3 years ago)
Author:
Philippe Normand
Message:

[GStreamer] Bump version requirement
https://bugs.webkit.org/show_bug.cgi?id=220356

Reviewed by Xabier Rodriguez-Calvar.

.:

  • Source/cmake/GStreamerChecks.cmake: Bump required version to 1.14.

Source/WebCore:

Remove compile-time and runtime GStreamer version checks that are
not needed anymore since we now require at least GStreamer 1.14 at
configure time.

  • platform/GStreamer.cmake:
  • platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:

(_WebKitWebAudioSrcPrivate::_WebKitWebAudioSrcPrivate):
(webKitWebAudioSrcRenderAndPushFrames):
(webKitWebAudioSrcChangeState):

  • platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp:

(requestGLContext):
(webKitGLVideoSinkChangeState):

  • platform/graphics/gstreamer/GStreamerAudioMixer.cpp:

(WebCore::GStreamerAudioMixer::ensureState):

  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:

(WebCore::MediaPlayerPrivateGStreamer::wouldTaintOrigin const):
(WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
(WebCore::convertToInternalProtocol): Deleted.

  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
  • platform/graphics/gstreamer/PlatformDisplayGStreamer.cpp:

(PlatformDisplay::tryEnsureGstGLContext const):

  • platform/graphics/gstreamer/WebKitAudioSinkGStreamer.cpp:

(webKitAudioSinkChangeState):

  • platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:

(webKitWebSrcCreate):
(webKitWebSrcGetProtocols):
(convertPlaybinURI):

  • platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:

(WebCore::InitData::payloadContainerType const):

  • platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:

(transformCaps):

  • platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:

(webkitMediaStreamSrcChangeState):

Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r271398 r271399  
     12021-01-12  Philippe Normand  <pnormand@igalia.com>
     2
     3        [GStreamer] Bump version requirement
     4        https://bugs.webkit.org/show_bug.cgi?id=220356
     5
     6        Reviewed by Xabier Rodriguez-Calvar.
     7
     8        * Source/cmake/GStreamerChecks.cmake: Bump required version to 1.14.
     9
    1102021-01-12  Xabier Rodriguez Calvar  <calvaris@igalia.com>
    211
  • trunk/Source/WebCore/ChangeLog

    r271398 r271399  
     12021-01-12  Philippe Normand  <pnormand@igalia.com>
     2
     3        [GStreamer] Bump version requirement
     4        https://bugs.webkit.org/show_bug.cgi?id=220356
     5
     6        Reviewed by Xabier Rodriguez-Calvar.
     7
     8        Remove compile-time and runtime GStreamer version checks that are
     9        not needed anymore since we now require at least GStreamer 1.14 at
     10        configure time.
     11
     12        * platform/GStreamer.cmake:
     13        * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
     14        (_WebKitWebAudioSrcPrivate::_WebKitWebAudioSrcPrivate):
     15        (webKitWebAudioSrcRenderAndPushFrames):
     16        (webKitWebAudioSrcChangeState):
     17        * platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp:
     18        (requestGLContext):
     19        (webKitGLVideoSinkChangeState):
     20        * platform/graphics/gstreamer/GStreamerAudioMixer.cpp:
     21        (WebCore::GStreamerAudioMixer::ensureState):
     22        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
     23        (WebCore::MediaPlayerPrivateGStreamer::wouldTaintOrigin const):
     24        (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL):
     25        (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
     26        (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
     27        (WebCore::convertToInternalProtocol): Deleted.
     28        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
     29        * platform/graphics/gstreamer/PlatformDisplayGStreamer.cpp:
     30        (PlatformDisplay::tryEnsureGstGLContext const):
     31        * platform/graphics/gstreamer/WebKitAudioSinkGStreamer.cpp:
     32        (webKitAudioSinkChangeState):
     33        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
     34        (webKitWebSrcCreate):
     35        (webKitWebSrcGetProtocols):
     36        (convertPlaybinURI):
     37        * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
     38        (WebCore::InitData::payloadContainerType const):
     39        * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
     40        (transformCaps):
     41        * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
     42        (webkitMediaStreamSrcChangeState):
     43
    1442021-01-12  Xabier Rodriguez Calvar  <calvaris@igalia.com>
    245
  • trunk/Source/WebCore/platform/GStreamer.cmake

    r270190 r271399  
    142142
    143143    if (ENABLE_MEDIA_STREAM OR ENABLE_WEB_RTC)
    144         if (PC_GSTREAMER_VERSION VERSION_LESS "1.10")
    145             message(FATAL_ERROR "GStreamer 1.10 is needed for ENABLE_MEDIA_STREAM or ENABLE_WEB_RTC")
    146         else ()
    147             list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
    148                 ${GSTREAMER_CODECPARSERS_INCLUDE_DIRS}
     144        list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
     145            ${GSTREAMER_CODECPARSERS_INCLUDE_DIRS}
     146        )
     147        if (NOT USE_GSTREAMER_FULL)
     148            list(APPEND WebCore_LIBRARIES
     149                ${GSTREAMER_CODECPARSERS_LIBRARIES}
    149150            )
    150             if (NOT USE_GSTREAMER_FULL)
    151                 list(APPEND WebCore_LIBRARIES
    152                     ${GSTREAMER_CODECPARSERS_LIBRARIES}
    153                 )
    154             endif ()
    155151        endif ()
    156152    endif ()
  • trunk/Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp

    r271197 r271399  
    7979    GRefPtr<GstBufferPool> pool;
    8080
    81     bool enableGapBufferSupport;
    8281    bool hasRenderedAudibleFrame { false };
    8382
     
    9493
    9594        g_rec_mutex_init(&mutex);
    96 
    97         // GAP buffer support is enabled only for GStreamer 1.12.5 because of a
    98         // memory leak that was fixed in that version.
    99         // https://bugzilla.gnome.org/show_bug.cgi?id=793067
    100         enableGapBufferSupport = webkitGstCheckVersion(1, 12, 5);
    10195    }
    10296
     
    371365        GST_BUFFER_DURATION(buffer.get()) = duration;
    372366
    373         if (priv->enableGapBufferSupport && priv->bus->channel(i)->isSilent())
     367        if (priv->bus->channel(i)->isSilent())
    374368            GST_BUFFER_FLAG_SET(buffer.get(), GST_BUFFER_FLAG_GAP);
    375369
     
    431425    auto* priv = src->priv;
    432426
    433 #if GST_CHECK_VERSION(1, 14, 0)
    434427    GST_DEBUG_OBJECT(element, "%s", gst_state_change_get_name(transition));
    435 #endif
    436428
    437429    switch (transition) {
  • trunk/Source/WebCore/platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp

    r267138 r271399  
    134134        GstContext* appContext = gst_context_new("gst.gl.app_context", TRUE);
    135135        GstStructure* structure = gst_context_writable_structure(appContext);
    136 #if GST_CHECK_VERSION(1, 12, 0)
    137136        gst_structure_set(structure, "context", GST_TYPE_GL_CONTEXT, gstGLContext, nullptr);
    138 #else
    139         gst_structure_set(structure, "context", GST_GL_TYPE_CONTEXT, gstGLContext, nullptr);
    140 #endif
    141137        return adoptGRef(appContext);
    142138    }
     
    159155static GstStateChangeReturn webKitGLVideoSinkChangeState(GstElement* element, GstStateChange transition)
    160156{
    161 #if GST_CHECK_VERSION(1, 14, 0)
    162157    GST_DEBUG_OBJECT(element, "%s", gst_state_change_get_name(transition));
    163 #endif
    164158
    165159    switch (transition) {
    166160    case GST_STATE_CHANGE_NULL_TO_READY:
    167 #if GST_CHECK_VERSION(1, 14, 0)
    168161    case GST_STATE_CHANGE_READY_TO_READY:
    169 #endif
    170162    case GST_STATE_CHANGE_READY_TO_PAUSED: {
    171163        if (!setGLContext(element, GST_GL_DISPLAY_CONTEXT_TYPE))
  • trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerAudioMixer.cpp

    r267787 r271399  
    5858void GStreamerAudioMixer::ensureState(GstStateChange stateChange)
    5959{
    60 #if GST_CHECK_VERSION(1, 14, 0)
    6160    GST_DEBUG_OBJECT(m_pipeline.get(), "Handling %s transition (%u mixer pads)", gst_state_change_get_name(stateChange), m_mixer->numsinkpads);
    62 #endif
     61
    6362    switch (stateChange) {
    6463    case GST_STATE_CHANGE_READY_TO_PAUSED:
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp

    r271398 r271399  
    154154}
    155155
    156 static void convertToInternalProtocol(URL& url)
    157 {
    158     if (webkitGstCheckVersion(1, 12, 0))
    159         return;
    160     if (url.protocolIsInHTTPFamily() || url.protocolIsBlob())
    161         url.setProtocol(makeString("webkit+", url.protocol()));
    162 }
    163 
    164156static void initializeDebugCategory()
    165157{
     
    849841Optional<bool> MediaPlayerPrivateGStreamer::wouldTaintOrigin(const SecurityOrigin& origin) const
    850842{
    851     if (webkitGstCheckVersion(1, 12, 0)) {
    852         GST_TRACE_OBJECT(pipeline(), "Checking %u origins", m_origins.size());
    853         for (auto& responseOrigin : m_origins) {
    854             if (!origin.canAccess(*responseOrigin)) {
    855                 GST_DEBUG_OBJECT(pipeline(), "Found reachable response origin");
    856                 return true;
    857             }
    858         }
    859         GST_DEBUG_OBJECT(pipeline(), "No valid response origin found");
    860         return false;
    861     }
    862 
    863     // GStreamer < 1.12 has an incomplete uridownloader implementation so we
    864     // can't use WebKitWebSrc for adaptive fragments downloading if this
    865     // version is detected.
    866     return m_hasTaintedOrigin;
     843    GST_TRACE_OBJECT(pipeline(), "Checking %u origins", m_origins.size());
     844    for (auto& responseOrigin : m_origins) {
     845        if (!origin.canAccess(*responseOrigin)) {
     846            GST_DEBUG_OBJECT(pipeline(), "Found reachable response origin");
     847            return true;
     848        }
     849    }
     850    GST_DEBUG_OBJECT(pipeline(), "No valid response origin found");
     851    return false;
    867852}
    868853
     
    984969
    985970    m_url = URL(URL(), cleanURLString);
    986     convertToInternalProtocol(m_url);
    987971    GST_INFO_OBJECT(pipeline(), "Load %s", m_url.string().utf8().data());
    988972    g_object_set(m_pipeline.get(), "uri", m_url.string().utf8().data(), nullptr);
     
    19741958            if (const char* uri = gst_structure_get_string(structure, "uri")) {
    19751959                URL url(URL(), uri);
    1976                 convertToInternalProtocol(url);
    19771960                m_origins.add(SecurityOrigin::create(url));
    19781961
     
    20131996            if (gst_structure_get(structure, "read-position", G_TYPE_UINT64, &m_networkReadPosition, "size", G_TYPE_UINT64, &m_httpResponseTotalSize, nullptr))
    20141997                GST_DEBUG_OBJECT(pipeline(), "Updated network read position %" G_GUINT64_FORMAT ", size: %" G_GUINT64_FORMAT, m_networkReadPosition, m_httpResponseTotalSize);
    2015         } else if (gst_structure_has_name(structure, "adaptive-streaming-statistics")) {
    2016             if (WEBKIT_IS_WEB_SRC(m_source.get()) && !webkitGstCheckVersion(1, 12, 0)) {
    2017                 if (const char* uri = gst_structure_get_string(structure, "uri"))
    2018                     m_hasTaintedOrigin = webKitSrcWouldTaintOrigin(WEBKIT_WEB_SRC_CAST(m_source.get()), SecurityOrigin::create(URL(URL(), uri)));
    2019             }
    20201998        } else if (gst_structure_has_name(structure, "GstCacheDownloadComplete")) {
    20211999            GST_INFO_OBJECT(pipeline(), "Stream is fully downloaded, stopping monitoring downloading progress.");
     
    28172795    ASSERT(m_textAppSinkPad);
    28182796
    2819     GRefPtr<GstCaps> textCaps;
    2820     if (webkitGstCheckVersion(1, 14, 0))
    2821         textCaps = adoptGRef(gst_caps_new_empty_simple("application/x-subtitle-vtt"));
    2822     else
    2823         textCaps = adoptGRef(gst_caps_new_empty_simple("text/vtt"));
     2797    auto textCaps = adoptGRef(gst_caps_new_empty_simple("application/x-subtitle-vtt"));
    28242798    g_object_set(m_textAppSink.get(), "emit-signals", TRUE, "enable-last-sample", FALSE, "caps", textCaps.get(), nullptr);
    28252799    g_signal_connect_swapped(m_textAppSink.get(), "new-sample", G_CALLBACK(newTextSampleCallback), this);
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h

    r271302 r271399  
    5252// Include the <epoxy/gl.h> header before <gst/gl/gl.h>.
    5353#include <epoxy/gl.h>
    54 
    55 // Workaround build issue with RPi userland GLESv2 headers and libepoxy <https://webkit.org/b/185639>
    56 #if !GST_CHECK_VERSION(1, 14, 0)
    57 #include <gst/gl/gstglconfig.h>
    58 #if defined(GST_GL_HAVE_WINDOW_DISPMANX) && GST_GL_HAVE_WINDOW_DISPMANX
    59 #define __gl2_h_
    60 #undef GST_GL_HAVE_GLSYNC
    61 #define GST_GL_HAVE_GLSYNC 1
    62 #endif
    63 #endif // !GST_CHECK_VERSION(1, 14, 0)
    6454#endif // USE(LIBEPOXY)
    6555
  • trunk/Source/WebCore/platform/graphics/gstreamer/PlatformDisplayGStreamer.cpp

    r261854 r271399  
    9999        return false;
    100100
    101     bool shouldAdoptRef = webkitGstCheckVersion(1, 14, 0);
    102 
    103     if (shouldAdoptRef)
    104         m_gstGLDisplay = adoptGRef(createGstGLDisplay(*this));
    105     else
    106         m_gstGLDisplay = createGstGLDisplay(*this);
     101    m_gstGLDisplay = adoptGRef(createGstGLDisplay(*this));
    107102    if (!m_gstGLDisplay)
    108103        return false;
     
    110105    GstGLPlatform glPlatform = sharedContext->isEGLContext() ? GST_GL_PLATFORM_EGL : GST_GL_PLATFORM_GLX;
    111106
    112     if (shouldAdoptRef)
    113         m_gstGLContext = adoptGRef(gst_gl_context_new_wrapped(m_gstGLDisplay.get(), reinterpret_cast<guintptr>(contextHandle), glPlatform, glAPI));
    114     else
    115         m_gstGLContext = gst_gl_context_new_wrapped(m_gstGLDisplay.get(), reinterpret_cast<guintptr>(contextHandle), glPlatform, glAPI);
     107    m_gstGLContext = adoptGRef(gst_gl_context_new_wrapped(m_gstGLDisplay.get(), reinterpret_cast<guintptr>(contextHandle), glPlatform, glAPI));
    116108
    117109    // Activate and fill the GStreamer wrapped context with the Webkit's shared one.
  • trunk/Source/WebCore/platform/graphics/gstreamer/WebKitAudioSinkGStreamer.cpp

    r267787 r271399  
    257257    auto* priv = sink->priv;
    258258
    259 #if GST_CHECK_VERSION(1, 14, 0)
    260259    GST_DEBUG_OBJECT(sink, "Handling %s transition", gst_state_change_get_name(stateChange));
    261 #endif
    262260
    263261    auto& mixer = GStreamerAudioMixer::singleton();
  • trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp

    r269951 r271399  
    466466    //    "source-setup" event. This doesn't work for additional WebKitWebSrc elements created by adaptivedemux.
    467467    //
    468     // 2) A GstContext query made here. Because of a bug, this only works in GStreamer >= 1.12.
    469     //
    470     // As a compatibility workaround, the http: URI protocol is only registered for gst>=1.12; otherwise using
    471     // webkit+http:, which is used by MediaPlayerPrivateGStreamer but not by adaptivedemux's additional source
    472     // elements, therefore using souphttpsrc instead and not routing traffic through the NetworkProcess.
    473     if (webkitGstCheckVersion(1, 12, 0) && !members->player) {
     468    // 2) A GstContext query made here.
     469    if (!members->player) {
    474470        members.runUnlocked([src, baseSrc]() {
    475471            GRefPtr<GstQuery> query = adoptGRef(gst_query_new_context(WEBKIT_WEB_SRC_PLAYER_CONTEXT_TYPE_NAME));
     
    864860{
    865861    static const char* protocols[4];
    866     if (webkitGstCheckVersion(1, 12, 0)) {
    867         protocols[0] = "http";
    868         protocols[1] = "https";
    869         protocols[2] = "blob";
    870     } else {
    871         protocols[0] = "webkit+http";
    872         protocols[1] = "webkit+https";
    873         protocols[2] = "webkit+blob";
    874     }
     862    protocols[0] = "http";
     863    protocols[1] = "https";
     864    protocols[2] = "blob";
    875865    protocols[3] = nullptr;
    876866    return protocols;
     
    880870{
    881871    URL url(URL(), uriString);
    882     if (!webkitGstCheckVersion(1, 12, 0)) {
    883         ASSERT(url.protocol().substring(0, 7) == "webkit+");
    884         url.setProtocol(url.protocol().substring(7).toString());
    885     }
    886872    return url;
    887873}
  • trunk/Source/WebCore/platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h

    r269097 r271399  
    8080    String payloadContainerType() const
    8181    {
    82 #if GST_CHECK_VERSION(1, 15, 0)
     82#if GST_CHECK_VERSION(1, 16, 0)
    8383        if (m_systemId == GST_PROTECTION_UNSPECIFIED_SYSTEM_ID)
    8484            return "webm"_s;
  • trunk/Source/WebCore/platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp

    r269031 r271399  
    126126            // developement git master which will ship as version 1.16.0.
    127127            gst_structure_set_name(outgoingStructure.get(),
    128 #if GST_CHECK_VERSION(1, 15, 0)
     128#if GST_CHECK_VERSION(1, 16, 0)
    129129                !g_strcmp0(klass->protectionSystemId(self), GST_PROTECTION_UNSPECIFIED_SYSTEM_ID) ? "application/x-webm-enc" :
    130130#endif
  • trunk/Source/WebCore/platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp

    r271290 r271399  
    402402static GstStateChangeReturn webkitMediaStreamSrcChangeState(GstElement* element, GstStateChange transition)
    403403{
    404 #if GST_CHECK_VERSION(1, 14, 0)
    405404    GST_DEBUG_OBJECT(element, "%s", gst_state_change_get_name(transition));
    406 #endif
    407405
    408406    if (transition == GST_STATE_CHANGE_PAUSED_TO_READY)
  • trunk/Source/cmake/GStreamerChecks.cmake

    r268907 r271399  
    2929          endif ()
    3030
    31           find_package(GStreamer 1.10.0 REQUIRED COMPONENTS ${GSTREAMER_COMPONENTS})
     31          find_package(GStreamer 1.14.0 REQUIRED COMPONENTS ${GSTREAMER_COMPONENTS})
    3232
    3333          if (ENABLE_WEB_AUDIO)
     
    5353endif ()
    5454
    55 if (ENABLE_MEDIA_SOURCE AND PC_GSTREAMER_VERSION VERSION_LESS "1.14")
    56     message(FATAL_ERROR "GStreamer 1.14 is needed for ENABLE_MEDIA_SOURCE.")
    57 endif ()
    58 
    5955if (ENABLE_MEDIA_STREAM AND ENABLE_WEB_RTC)
    60     if (PC_GSTREAMER_VERSION VERSION_LESS "1.12")
    61         message(FATAL_ERROR "GStreamer 1.12 is needed for ENABLE_WEB_RTC.")
    62     endif ()
    6356    SET_AND_EXPOSE_TO_BUILD(USE_LIBWEBRTC TRUE)
    6457    SET_AND_EXPOSE_TO_BUILD(WEBRTC_WEBKIT_BUILD TRUE)
Note: See TracChangeset for help on using the changeset viewer.