Switch between pipeline 1 and pipeline 2: using the same hardware devices (under Linux)

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

Switch between pipeline 1 and pipeline 2: using the same hardware devices (under Linux)

Maurer, Marie

Hi,

 

assuming I have 2 pipelines (environment Linux, i.MX6, but does not matter…)

 

Pipeline 1)   v4l2src -> something -> v4l2sink

 

and

 

Pipeline 2)   v4l2src -> something -> v4l2sink

 

Note: Both use the same hardware resources.

 

Now I want to switch from pipeline 1 to pipeline 2 and vice versa.

 

Is it correct to switch pipeline 1 to state NULL, then I must wait till it reaches state NULL,

and then I can immediately (re-) use v4l2src and v4l2sink? Or would READY be also enough?

Or is NULL not enough to say that devices are now really closed?

 

Or am I forced to just try to create pipeline 2 and when it fails (with a certain error), retry creation and it hopefully works, in bad case till a retry counter times out?

 

Best regards,

 

Marie

 

 

 


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

Re: Switch between pipeline 1 and pipeline 2: using the same hardware devices (under Linux)

Tim Müller
On Tue, 2018-05-22 at 13:56 +0000, Maurer, Marie wrote:

Hi Marie,

> Now I want to switch from pipeline 1 to pipeline 2 and vice versa.

Do you actually want to switch source and/or sink to a different device
or configuration, or do you just want to switch filters in the middle
of the pipeline?

> Is it correct to switch pipeline 1 to state NULL, then I must wait
> till it reaches state NULL,

State changes to NULL should be synchronous, so when

 gst_element_set_state (pipeline, GST_STATE_NULL);

returns you *should* be able to re-start the pipeline immediately right
there and then (modulo driver shenanigans).

Cheers
-Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel