Skip to content

Commit c96fb64

Browse files
calvariseocanha
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 a087bcd commit c96fb64

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

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

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

31943194
auto pad = adoptGRef(gst_element_get_static_pad(decoder, "src"));
3195+
if (!pad) {
3196+
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());
3197+
return;
3198+
}
31953199
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 {
31963200
auto* player = static_cast<MediaPlayerPrivateGStreamer*>(userData);
31973201
if (GST_PAD_PROBE_INFO_TYPE(info) & GST_PAD_PROBE_TYPE_BUFFER) {

0 commit comments

Comments
 (0)