Querying a pipeline with no sinks

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Querying a pipeline with no sinks

Tom Bailey
Good afternoon GStreamer gurus,

I have a question about the query logic in GstBin. The code in gst_bin_query() attempts to dispatch the query to any sinks in the bin. If there aren't any sinks it tries its src pads, and if there are no src pads it gives up and the query fails. But isn't it a legitimate use case to query DURATION or SEEKING on a pipeline which has no sinks, since these would usually be answered by the source or demuxer? If there aren't any sinks, shouldn't the query be dispatched on the sink pad of the "most downstream" element?

To give a concrete example, I'm trying to handle the case of a TV channel which goes off air for part of the day. When the channel goes off air the broadcaster sends an updated PMT which has no video or audio PIDs. This causes the demuxer to remove all its source pads, which causes all sinks to be removed from the pipeline. Upstream of the demuxer is a "timeshift" element that supports seeking, which can be used to rewind and replay some of the previously broadcast content, but this is not possible because once the sinks are removed I can no longer query the seekable range.

I've experimented with setting the GST_ELEMENT_FLAG_SINK on the demuxer when it removes the last source pad, i.e. making it pretend to be a sink, and this does allow the queries to be answered correctly, but it feels a bit hacky and I don't see any other demuxers doing this.

I'm not sure if there's a better way to solve this that I have missed, or if this is deficency of GstBin.

Any thoughts / suggestions gratefully received

Tom
This transmission contains information that may be confidential and contain personal views which are not necessarily those of YouView TV Ltd. YouView TV Ltd (Co No:7308805) is a limited liability company registered in England and Wales with its registered address at YouView TV Ltd, 3rd Floor, 10 Lower Thames Street, London, EC3R 6YT. For details see our web site at http://www.youview.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel