GstGhostPad with no target stops pipeline entering the PLAYING state - how do I work around this?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

GstGhostPad with no target stops pipeline entering the PLAYING state - how do I work around this?

Graham Leggett
Hi all,

I have a transcoder bin that encapsulates decodebin, and what I want to do is “tap off” raw streams and perform actions with them, like this:

somesrc ! transcoder name=transcoder ! somesink    transcoder. ! capsfilter caps=video/x-raw ! othersink

The pipeline above is static, but the decodebin buried inside transcoder is dynamic. What I want to achieve is to hide the dynamic nature of decodebin: when a video/x-raw is present, I want it to flow to othersink, but when a video/x-raw is absent, I want the pipeline to do nothing until the video/x-raw is present again.

So far, the source template looks like this:

static GstStaticPadTemplate gst_transcoder_src_template =
GST_STATIC_PAD_TEMPLATE ("src_%u",
    GST_PAD_SRC,
    GST_PAD_REQUEST,
    GST_STATIC_CAPS_ANY);

There is a request_new_pad() function that responds by creating a ghost pad, ready for the target to be wired up when the video stream appears.

The problem I have is that if there is no target on one of the ghost pads (for example, the ghost pad wants video but there is no video in the stream), the transcoder element never enters the PLAYING state, and while data flows into transcoder, nothing flows out of transcoder. The pipeline stalls when the buffers get full.

What is the correct way to handle a pad that you want to exist, but don’t want to use at the moment?

To use the common water analogy, I have a bunch of pipes set up to handle video, but when there is no video I expect no video to flow through these pipes, but I want the audio to flow down the other pipes.

If the video disappears from the stream I want to shut off the video pipe again, but leave the stream in place until video starts arriving again.

I’d tried setting the active on the ghost pads to FALSE, but this makes no difference, the pipeline refuses to enter the PLAYING state, and the change_state() callback in transcoder is never called.

What is the “right” way to do this?

Regards,
Graham



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: GstGhostPad with no target stops pipeline entering the PLAYING state - how do I work around this?

Yasushi SHOJI-2
Hi,

On Mon, May 15, 2017 at 4:16 AM, Graham Leggett <[hidden email]> wrote:
> What is the correct way to handle a pad that you want to exist, but don’t want to use at the moment?

link to fakesink?
-- 
          yashi


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: GstGhostPad with no target stops pipeline entering the PLAYING state - how do I work around this?

Nicolas Dufresne-5
Le mardi 20 juin 2017 à 11:37 +0900, Yasushi SHOJI a écrit :
> Hi,
>
> On Mon, May 15, 2017 at 4:16 AM, Graham Leggett <[hidden email]>
> wrote:
> > What is the correct way to handle a pad that you want to exist, but
> don’t want to use at the moment?
>
> link to fakesink?

that, or an inputselector, a tee, a valve, it all depends on what
you'll do with these pads later.

cheer,
Nicolas
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (188 bytes) Download Attachment