Not able to push RTP data from appsrc to rtpjitterbuffer

avbagno bagno.vladimirovna at gmail.com
Fri Nov 25 16:41:39 UTC 2016


Hi!
I have similar problem with appsrc and rtpklvpay. I'm using Gstreamet 1.9.1.
Here is my code
if (NULL == (video_ctx->pipeline = gst_pipeline_new("receiver")))
		{
			ERROR_LOG("Can't create pipeline");
			return;
		}

	    if (NULL == (video_ctx->klv_sink =  gst_element_factory_make("udpsink",
NULL)))
		{
			ERROR_LOG("Can't create klv sink element");
			return;
		}
		g_object_set(G_OBJECT(video_ctx->klv_sink), "host", "192.168.0.112",
NULL);
		g_object_set(G_OBJECT(video_ctx->klv_sink), "port", 3600,  NULL);

		video_ctx->klv_src = gst_element_factory_make ("appsrc", NULL);
		g_object_set (G_OBJECT (video_ctx->klv_src), "caps",
			gst_caps_new_empty_simple("meta/x-klv"), NULL);

		//init rtp klvpay
		if (NULL == (video_ctx->rtpklvpay = gst_element_factory_make("rtpklvpay",
NULL)))
		{
			ERROR_LOG("Can't create rtp klv pay");
			return;
		}

		gst_bin_add_many(GST_BIN(video_ctx->pipeline),
		   video_ctx->klv_src,
			video_ctx->rtpklvpay, video_ctx->klv_sink,
			NULL);


		if (0 == gst_element_link(video_ctx->klv_src, video_ctx->rtpklvpay))
		{
			 ERROR_LOG("Can't link klv_src and rtpklvpay element");
			 return;
		}
		if (0 == gst_element_link(video_ctx->rtpklvpay, video_ctx->klv_sink))
		{
			 ERROR_LOG("Can't link rtpklvpay and klvsink");
			 return;
		}

		g_object_set (G_OBJECT (video_ctx->klv_src),
			"stream-type", 0,
			"format", GST_FORMAT_TIME, NULL);
		g_signal_connect (video_ctx->klv_src, "need-data",
G_CALLBACK(klv_src_nedd_data), video_ctx->klv_ctx);

		if ((bus = gst_pipeline_get_bus(GST_PIPELINE(video_ctx->pipeline))) !=
NULL) {
			gst_bus_add_watch(bus, &onBusMessage, video_ctx);
			gst_object_unref(bus);
			bus = NULL;
		}

		success = gst_element_set_state(video_ctx->pipeline, GST_STATE_PLAYING) !=
GST_STATE_CHANGE_FAILURE;

static void
klv_src_nedd_data(GstElement *appsrc,
	guint unused_size,
	gpointer user_data)
{
	...
	buffer = gst_buffer_new_allocate (NULL, buf->buf_len, NULL);
	/* this makes the image black/white */
	gst_buffer_fill (buffer, 0, buf->buffer, buf->buf_len);

	GST_BUFFER_PTS (buffer) = timestamp;
	GST_BUFFER_DURATION (buffer) = gst_util_uint64_scale_int (1, GST_SECOND,
2);

	timestamp += GST_BUFFER_DURATION (buffer);

	DEBUG_LOG("Push buffer to appsrc");
	g_signal_emit_by_name (appsrc, "push-buffer", buffer, &ret);
	gst_buffer_unref (buffer);
	...
}

Logs from appsrc
0:00:00.031915510 21224 0x7fb634005360 DEBUG                 appsrc
gstappsrc.c:1305:gst_app_src_set_caps:<appsrc0> setting caps to meta/x-klv
0:00:00.033226895 21224 0x7fb634005360 DEBUG                 appsrc
gstappsrc.c:673:gst_app_src_internal_get_caps:<appsrc0> caps: (NULL)
0:00:00.033255827 21224 0x7fb634005360 DEBUG                 appsrc
gstappsrc.c:673:gst_app_src_internal_get_caps:<appsrc0> caps: (NULL)
0:00:00.033287408 21224 0x7fb634005360 DEBUG                 appsrc
gstappsrc.c:1469:gst_app_src_set_stream_type:<appsrc0> setting stream_type
of 0
0:00:00.033440116 21224 0x7fb634005360 DEBUG                 appsrc
gstappsrc.c:850:gst_app_src_start:<appsrc0> starting
0:00:00.033589791 21224       0xbd5b70 DEBUG                 appsrc
gstappsrc.c:673:gst_app_src_internal_get_caps:<appsrc0> caps: (NULL)
0:00:00.033672264 21224       0xbd5b70 DEBUG                 appsrc
gstappsrc.c:1792:gst_app_src_push_buffer_full:<appsrc0> queueing buffer
0x7fb638005060
0:00:00.033681282 21224       0xbd5b70 DEBUG                 appsrc
gstappsrc.c:1202:gst_app_src_create:<appsrc0> we have buffer 0x7fb638005060
of size 47

After first call to need_data pipe stopped.
Please give me a prompt, what I'm doing wrong.
Thanks!

Sebastian Dröge-3 wrote
> On Tue, 2016-11-15 at 04:34 -0800, ShivaKumar wrote:
>> Hi All,
>> 
>> I have an issue in pushing data from appsrc to rtpjitterbuffer in Gst
>> 1.0.
>> Thee pipeline goes like this.
>> 
>> appsrc   !  "application/x-rtp, media=(string)video,
>> clock-rate=(int)90000,
>> payload=(int)33" ! rtpjitterbuffer ! .... 
>> 
>> I am getting the internal data flow error with error -5
>> 
>> ERROR: from element /GstPipeline:pipeline0/GstFileSrc:filesrc0: Internal
>> data flow error.
>> streaming task paused, reason error (-5)
>> 
>> Can anyone help to analyse what is wrong here.
> 
> You have to provide more details about your pipeline, what other
> elements are there, what are you pushing from the appsrc? Also a debug
> log should point you to where things actually go wrong.
> 
> -- 
> Sebastian Dröge, Centricular Ltd · http://www.centricular.com
> _______________________________________________
> gstreamer-devel mailing list

> gstreamer-devel at .freedesktop

> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> 
> 
> signature.asc (981 bytes)
> <http://gstreamer-devel.966125.n4.nabble.com/attachment/4680698/0/signature.asc>





--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Not-able-to-push-RTP-data-from-appsrc-to-rtpjitterbuffer-tp4680696p4680889.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list