Title: [294228] trunk/Source/WebCore
Revision
294228
Author
commit-qu...@webkit.org
Date
2022-05-16 05:23:09 -0700 (Mon, 16 May 2022)

Log Message

[GStreamer] Add basic video meta handling in sinks
https://bugs.webkit.org/show_bug.cgi?id=240429

Patch by Philippe Normand <pnorm...@igalia.com> on 2022-05-16
Reviewed by Xabier Rodriguez-Calvar.

By handling allocation queries and advertising video meta handling to upstream elements, our
video sinks are now more efficient, especially on Raspberry Pi 4 with the v4l2 stateless
H.264 decoder.

* platform/graphics/gstreamer/GStreamerVideoSinkCommon.cpp:
(webKitVideoSinkSetMediaPlayerPrivate):

Canonical link: https://commits.webkit.org/250586@main

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (294227 => 294228)


--- trunk/Source/WebCore/ChangeLog	2022-05-16 11:43:54 UTC (rev 294227)
+++ trunk/Source/WebCore/ChangeLog	2022-05-16 12:23:09 UTC (rev 294228)
@@ -1,3 +1,17 @@
+2022-05-15  Philippe Normand  <ph...@igalia.com>
+
+        [GStreamer] Add basic video meta handling in sinks
+        https://bugs.webkit.org/show_bug.cgi?id=240429
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        By handling allocation queries and advertising video meta handling to upstream elements, our
+        video sinks are now more efficient, especially on Raspberry Pi 4 with the v4l2 stateless
+        H.264 decoder.
+
+        * platform/graphics/gstreamer/GStreamerVideoSinkCommon.cpp:
+        (webKitVideoSinkSetMediaPlayerPrivate):
+
 2022-05-16  Tim Nguyen  <n...@apple.com>
 
         [css-ui] Make inner-spin-button/sliderthumb-horizontal/sliderthumb-vertical appearance values internal

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerVideoSinkCommon.cpp (294227 => 294228)


--- trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerVideoSinkCommon.cpp	2022-05-16 11:43:54 UTC (rev 294227)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerVideoSinkCommon.cpp	2022-05-16 12:23:09 UTC (rev 294228)
@@ -64,14 +64,20 @@
             return GST_PAD_PROBE_OK;
         }
 
-        // In some platforms (e.g. OpenMAX on the Raspberry Pi) when a resolution change occurs the
-        // pipeline has to be drained before a frame with the new resolution can be decoded.
-        // In this context, it's important that we don't hold references to any previous frame
-        // (e.g. m_sample) so that decoding can continue.
-        // We are also not supposed to keep the original frame after a flush.
         if (info->type & GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM) {
-            if (GST_QUERY_TYPE(GST_PAD_PROBE_INFO_QUERY(info)) != GST_QUERY_DRAIN)
+            auto* query = GST_PAD_PROBE_INFO_QUERY(info);
+            if (GST_QUERY_TYPE(query) == GST_QUERY_ALLOCATION) {
+                gst_query_add_allocation_meta(query, GST_VIDEO_META_API_TYPE, nullptr);
                 return GST_PAD_PROBE_OK;
+            }
+
+            // In some platforms (e.g. OpenMAX on the Raspberry Pi) when a resolution change occurs the
+            // pipeline has to be drained before a frame with the new resolution can be decoded.
+            // In this context, it's important that we don't hold references to any previous frame
+            // (e.g. m_sample) so that decoding can continue.
+            // We are also not supposed to keep the original frame after a flush.
+            if (GST_QUERY_TYPE(query) != GST_QUERY_DRAIN)
+                return GST_PAD_PROBE_OK;
             GST_DEBUG("Acting upon DRAIN query");
         }
         if (info->type & GST_PAD_PROBE_TYPE_EVENT_FLUSH) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to