dynamically change of video sources with signal watch added

frank82 francescomarino84627 at gmail.com
Fri Aug 21 04:57:31 PDT 2015


If someone is interested, I found a solution to the problem. 
It is enough change the following lines

  if( !strcmp(GST_OBJECT_NAME (gstData->src),"camera1") )
    {
        next = gstData->v4lcamera;
    }
    else if( !strcmp(GST_OBJECT_NAME (gstData->src),"camera2"))
    {
        next = gstData->testsrc;
    }

to 

        if( !strcmp(GST_OBJECT_NAME (gstData->src),"camera1") )
	{
		gstData->next = gst_element_factory_make ("v4l2src", "camera2");
	}
	else if( !strcmp(GST_OBJECT_NAME (gstData->src),"camera2"))
	{
		gstData->next = gst_element_factory_make ("videotestsrc", "camera1");
	}

In this way, a new element is created whenever a switch occurs, and then the
old element is destroyed by gst_bin_remove().

Probably, adding and removing watcher to the pipeline bus freed the element
memory while removing it from the pipeline. 



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/dynamically-change-of-video-sources-with-signal-watch-added-tp4673234p4673302.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list