How to avoid "Discont detected" message while pushing data using appsrc
roonie
mdzubair89 at yahoo.co.in
Fri Sep 19 00:14:28 PDT 2014
Thanks Prabhakar, I will check on the queue management.
Actually it differs file. I have 3 ts files. One plays audio instantly when
the application is started and I dont get "Discont detected" log, where as
for the other 2 ts files the application gets the whole file in buffer by
printing the log "Discont detected" and then it starts play the audio. There
is lot of delay.
Below is my continued code
{
app->audioqueue = gst_element_factory_make("queue","audioqueue");
app->audio_parser = gst_element_factory_make ("mpegaudioparse",
"audioparser");
if(EnableAudioDecoder == TRUE)
app->audio_decoder = gst_element_factory_make (audio_dec,
"audio_decoder");
else
app->audio_decoder = gst_element_factory_make ("beepdec",
"audio_decoder");
app->format = gst_element_factory_make ("capsfilter", "filter");
app->audio_convert = gst_element_factory_make ("audioconvert",
"audio_convert");
app->audio_sink = gst_element_factory_make ("autoaudiosink",
"audio_sink");
g_assert(app->audioqueue);
g_assert(app->audio_parser);
g_assert(app->audio_decoder);
g_assert(app->audio_convert);
g_assert(app->audio_sink);
filtercaps = gst_caps_new_simple ("audio/mpeg",NULL);
g_object_set (G_OBJECT (app->format), "caps", filtercaps, NULL);
g_object_set(G_OBJECT(app->src),"is-live",TRUE,NULL);
g_object_set(G_OBJECT(app->src),"block",TRUE,NULL);
g_object_set(G_OBJECT(app->src),"do-timestamp",TRUE,NULL);
gst_caps_unref (filtercaps);
gst_bin_add_many(GST_BIN(app->pipeline),
(GstElement*)app->src,app->demuxer,app->audioqueue,app->format,app->audio_parser,app->audio_decoder,app->audio_convert,app->audio_sink,
NULL);
if(!gst_element_link_filtered((GstElement*)app->src, app->demuxer
,caps)){
g_print("failed to link with caps");
}
if(!gst_element_link_many(app->audioqueue,app->format,app->audio_parser,app->audio_decoder,app->audio_convert,app->audio_sink,NULL)){
printf("failed to link audio elements");
}
else
printf("AUDIO ELEMENTS LINKED\n");
gst_element_get_static_pad(app->audio_sink, "sink");
g_signal_connect(app->src, "need-data", G_CALLBACK(start_feed), app);
g_signal_connect(app->src, "enough-data", G_CALLBACK(stop_feed), app);
g_signal_connect(app->demuxer, "pad-added", G_CALLBACK(on_pad_added),
app);
//state_ret = gst_element_set_state((GstElement*)app->pipeline,
GST_STATE_PLAYING);
state_ret = gst_element_set_state((GstElement*)app->pipeline,
GST_STATE_PLAYING);
GST_DEBUG_BIN_TO_DOT_FILE(GST_BIN(app->pipeline),GST_DEBUG_GRAPH_SHOW_ALL,"output.dot");
g_warning("set state returned %d\n", state_ret);
app->loop = g_main_loop_new(NULL, FALSE);
printf("Running main loop\n");
g_main_loop_run(app->loop);
}
Here I have used only the audio parser and decoder to parse the mpeg file.
Is there any property i have to set to play the audio instantly.?
Thank you
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/How-to-avoid-Discont-detected-message-while-pushing-data-using-appsrc-tp4668747p4668789.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list