Removing audio and video sink on playing pipeline

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

Removing audio and video sink on playing pipeline

DeepakRohan
This post was updated on .
Hi,
      I am trying to remove audio and video elements after the audio and video input selector elements respectively for audio and video disable. I have a callback function every 200ms. In which after 6 seconds of playback I add IDLE probe on the audio input-selector source pad. In the probe callback, I remove audio elements after audio input-selector till alsasink. Then add fakesink and link the same with the audio input selector's source pad.

For audio playback, the video playback hangs after pushing few buffers to the fakesink element(verified by using the "dump" property of the fakesink element). Also the output playback position changes from 6sec to 36.5sec. This output position varies as I change the max-size-time property of my video queue element. Currently it's 30sec hence video playback position jumps from 6s to 36.5s.

The same with video disable also.
I am setting the state of the audio and video elements to NULL and then removing them from the bin. I may have re-usability issues later during enabling them.

Can anyone tell me what are the steps that I need to follow so that I can implement the disable and enable functionality correctly.

Thank You in Advance.
Reply | Threaded
Open this post in threaded view
|

Removing audio and video sink on playing pipeline

DeepakRohan
Hi,
      When I try to set the state on the alsasink to NULL, I get this message "GST_MESSAGE_CLOCK_LOST".
In the below link
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstMessage.html#gst-message-new-clock-provide
they say that the application has to set the pipeline's state to paused followed by playing state.

Should I handle this message as per the link.
As a application guy, am I allowed to change the state of the pipeline in a gstreamer bus call, which is one of the gstreamer streaming thread.

What are the things I need to handle while removing audio and video sink from a playing pipeline.
Reply | Threaded
Open this post in threaded view
|

Re: Removing audio and video sink on playing pipeline

DeepakRohan
Enabling the fakesink element's sync property to TRUE SOLVED the jump from 6 to 36 second.
When a clock provider is removed from the pipeline, GST_MESSAGE_CLOCK_LOST if thrown on the pipelines bus.
Application has to catch the message and perform the mentioned things as per the below link
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstMessage.html#gst-message-new-clock-provide

Problem Fixed for me after following the above.