⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 264162 in webkit


Ignore:
Timestamp:
Jul 9, 2020, 2:24:58 AM (6 years ago)
Author:
Philippe Normand
Message:

[GStreamer][MSE] AV1 support
​https://bugs.webkit.org/show_bug.cgi?id=207547

Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

If only the av1dec decoder is available, consider AV1 decoding
support as disabled, because this plugin performs really badly.
However, if any other AV1 decoder is present, such as the
dav1d-based Rust decoder for instance, consider AV1 support as
enabled.

These checks are now performed by both RegistryScanner instances,
for MSE and non-MSE players.

  • platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:

(WebCore::GStreamerRegistryScanner::hasElementForMediaType const):
(WebCore::GStreamerRegistryScanner::initialize):

  • platform/graphics/gstreamer/GStreamerRegistryScanner.h:

LayoutTests:

  • platform/glib/TestExpectations: Mark media/media-can-play-av1.html as failing until the

Flatpak SDK ships gst-plugins-rs.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r264156 r264162  
     12020-07-09  Philippe Normand  <pnormand@igalia.com>
     2
     3        [GStreamer][MSE] AV1 support
     4        https://bugs.webkit.org/show_bug.cgi?id=207547
     5
     6        Reviewed by Xabier Rodriguez-Calvar.
     7
     8        * platform/glib/TestExpectations: Mark media/media-can-play-av1.html as failing until the
     9        Flatpak SDK ships gst-plugins-rs.
     10
    1112020-07-09  Carlos Garcia Campos  <cgarcia@igalia.com>
    212
  • trunk/LayoutTests/platform/glib/TestExpectations

    r264156 r264162  
    159159
    160160webkit.org/b/214031 imported/w3c/web-platform-tests/html/semantics/embedded-content/the-video-element/video-poster-shown-preload-auto.html [ ImageOnlyFailure ]
     161
     162webkit.org/b/207547 media/media-can-play-av1.html [ Failure ]
    161163
    162164#////////////////////////////////////////////////////////////////////////////////////////
  • trunk/Source/WebCore/ChangeLog

    r264161 r264162  
     12020-07-09  Philippe Normand  <pnormand@igalia.com>
     2
     3        [GStreamer][MSE] AV1 support
     4        https://bugs.webkit.org/show_bug.cgi?id=207547
     5
     6        Reviewed by Xabier Rodriguez-Calvar.
     7
     8        If only the av1dec decoder is available, consider AV1 decoding
     9        support as disabled, because this plugin performs really badly.
     10        However, if any other AV1 decoder is present, such as the
     11        dav1d-based Rust decoder for instance, consider AV1 support as
     12        enabled.
     13
     14        These checks are now performed by both RegistryScanner instances,
     15        for MSE and non-MSE players.
     16
     17        * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
     18        (WebCore::GStreamerRegistryScanner::hasElementForMediaType const):
     19        (WebCore::GStreamerRegistryScanner::initialize):
     20        * platform/graphics/gstreamer/GStreamerRegistryScanner.h:
     21
    1222020-07-09  Alicia Boya García  <aboya@igalia.com>
    223
  • trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.cpp

    r261986 r264162  
    6868}
    6969
    70 GStreamerRegistryScanner::RegistryLookupResult GStreamerRegistryScanner::hasElementForMediaType(GList* elementFactories, const char* capsString, bool shouldCheckHardwareClassifier) const
     70GStreamerRegistryScanner::RegistryLookupResult GStreamerRegistryScanner::hasElementForMediaType(GList* elementFactories, const char* capsString, bool shouldCheckHardwareClassifier, Optional<Vector<String>> blackList) const
    7171{
    7272    GRefPtr<GstCaps> caps = adoptGRef(gst_caps_from_string(capsString));
    … …  
    7474    bool isSupported = candidates;
    7575    bool isUsingHardware = false;
     76
     77    if (blackList.hasValue() && !blackList->isEmpty()) {
     78        bool hasValidCandidate = false;
     79        for (GList* factories = candidates; factories; factories = g_list_next(factories)) {
     80            String name(gst_plugin_feature_get_name(GST_PLUGIN_FEATURE_CAST(factories->data)));
     81            if (blackList->contains(name))
     82                continue;
     83            hasValidCandidate = true;
     84            break;
     85        }
     86        if (!hasValidCandidate) {
     87            GST_WARNING("All elements for caps %" GST_PTR_FORMAT " are blacklisted", caps.get());
     88            isSupported = false;
     89            shouldCheckHardwareClassifier = false;
     90        }
     91    }
    7692
    7793    if (shouldCheckHardwareClassifier) {
    … …  
    160176    }
    161177
    162     if (hasElementForMediaType(m_demuxerFactories, "video/x-matroska")) {
     178    bool matroskaSupported = hasElementForMediaType(m_demuxerFactories, "video/x-matroska");
     179    if (matroskaSupported) {
    163180        auto vp8DecoderAvailable = hasElementForMediaType(m_videoDecoderFactories, "video/x-vp8", true);
    164181        auto vp9DecoderAvailable = hasElementForMediaType(m_videoDecoderFactories, "video/x-vp9", true);
    … …  
    189206        m_codecMap.add(AtomString("avc*"), h264DecoderAvailable.isUsingHardware);
    190207        m_codecMap.add(AtomString("mp4v*"), h264DecoderAvailable.isUsingHardware);
     208    }
     209
     210    Vector<String> av1DecodersBlacklist { "av1dec"_s };
     211    if ((matroskaSupported || isContainerTypeSupported("video/mp4")) && hasElementForMediaType(m_videoDecoderFactories, "video/x-av1", false, makeOptional(WTFMove(av1DecodersBlacklist)))) {
     212        m_codecMap.add(AtomString("av01*"), false);
     213        m_codecMap.add(AtomString("x-av1"), false);
    191214    }
    192215
    … …  
    263286    }
    264287
    265     bool matroskaSupported = hasElementForMediaType(m_demuxerFactories, "video/x-matroska");
    266288    if (matroskaSupported) {
    267289        m_mimeTypeSet.add(AtomString("video/x-matroska"));
    … …  
    270292            m_mimeTypeSet.add(AtomString("video/webm"));
    271293    }
    272 
    273     if ((matroskaSupported || isContainerTypeSupported("video/mp4")) && hasElementForMediaType(m_videoDecoderFactories, "video/x-av1"))
    274         m_codecMap.add(AtomString("av01*"), false);
    275294}
    276295
  • trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.h

    r261986 r264162  
    7575    void fillMimeTypeSetFromCapsMapping(Vector<GstCapsWebKitMapping>&);
    7676
    77     RegistryLookupResult hasElementForMediaType(GList* elementFactories, const char* capsString, bool shouldCheckHardwareClassifier = false) const;
     77    RegistryLookupResult hasElementForMediaType(GList* elementFactories, const char* capsString, bool shouldCheckHardwareClassifier = false, Optional<Vector<String>> blackList = WTF::nullopt) const;
    7878
    7979    bool isAVC1CodecSupported(const String& codec, bool shouldCheckForHardwareUse) const;
Note: See TracChangeset for help on using the changeset viewer.