synchronize clock with gst_net_provider_new.

modelvincent vincent.decaux at oxytronic.fr
Mon May 18 07:48:25 PDT 2015


Hello, 

I'm trying to synchronize several client video to one server but I have some
problems with the net_provider functions.

I haven't found a lot of example using these functions so I'm not sure of
how to use them.

For the moment, on my master side, I've constructed my pipeline and I do the
following commands:

- data.netclock=gst_pipeline_get_clock((GstPipeline*)data.pipeline);
- gst_pipeline_use_clock((GstPipeline*)data.pipeline,data.netclock);
- gst_element_set_base_time(data.pipeline,0);
- data.basetime = gst_clock_get_time(data.netclock);
- data.provider=gst_net_time_provider_new(data.netclock, NULL, 5637);
-
gst_pipeline_set_new_stream_time((GstPipeline*)data.pipeline,data.basetime);
- gst_element_set_start_time(data.pipeline,GST_CLOCK_TIME_NONE);
- ret=gst_element_set_state (data.pipeline, GST_STATE_PLAYING);


and on the slave side, I do the following commands:
-
gst_pipeline_set_new_stream_time((GstPipeline*)data.pipeline,GST_CLOCK_TIME_NONE);
- data.netclock =  gst_net_client_clock_new(NULL, "127.0.0.1", 5637,0);
	if(data.netclock == NULL)
	{
		g_print("Failed to create client\n");
	}

- gst_element_set_start_time(data.pipeline,GST_CLOCK_TIME_NONE);
- gst_element_set_base_time(data.pipeline, 0);
- gst_pipeline_use_clock((GstPipeline*)data.pipeline,data.netclock);
	

But nothing seem to happen, my first problem is that even if my server is
not started, my gst_net_client_clock_new return a value on client side.

The second problem is that if I start the client first, then I start the
server, both movie are launching but are not synchronized, but if I quit the
server side, my client continue to play the movie but at full speed, so the
client is detecting that something has been lost on the server, but Even if
I pause the server, the client continue to play his movie.

I have'nt found explicite example so I'm not sure if I need to create a
thread or something on the side client to wait until the server is present
before to gst_net_client_clock_new?

if someone could give me an example of a simple software using this
functionnality, it would be great !

Thanks in advance, 

Vincent







--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/synchronize-clock-with-gst-net-provider-new-tp4671909.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list