Skip to content

Commit 18da406

Browse files
calvariscadubentzen
authored andcommitted
[MediaStream][GStreamer] Hardware decoder/sinks do not have src pads
https://bugs.webkit.org/show_bug.cgi?id=276170 Reviewed by Philippe Normand. In the MediaStream use case, we are trying to get decoder stats from a pad probe at the src pad of the video decoder. The problem comes with the decoder/sink elements that don't have one because they are the end of the pipeline. * Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::configureVideoDecoder): Canonical link: https://commits.webkit.org/280622@main
1 parent d2b1a82 commit 18da406

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3042,6 +3042,10 @@ void MediaPlayerPrivateGStreamer::configureVideoDecoder(GstElement* decoder)
30423042
g_object_set(decoder, "max-errors", -1, nullptr);
30433043

30443044
auto pad = adoptGRef(gst_element_get_static_pad(decoder, "src"));
3045+
if (!pad) {
3046+
GST_INFO_OBJECT(pipeline(), "the decoder %s does not have a src pad, probably because it's a hardware decoder sink, can't get decoder stats", name.get());
3047+
return;
3048+
}
30453049
gst_pad_add_probe(pad.get(), static_cast<GstPadProbeType>(GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM | GST_PAD_PROBE_TYPE_BUFFER), [](GstPad*, GstPadProbeInfo* info, gpointer userData) -> GstPadProbeReturn {
30463050
auto* player = static_cast<MediaPlayerPrivateGStreamer*>(userData);
30473051
if (GST_PAD_PROBE_INFO_TYPE(info) & GST_PAD_PROBE_TYPE_BUFFER) {

0 commit comments

Comments
 (0)