How to avoid "Discont detected" message while pushing data using appsrc
roonie
mdzubair89 at yahoo.co.in
Wed Sep 17 02:55:58 PDT 2014
Iam continously pushing data using while loop using the pull method.
i.e when it requires data it emits "need-data" signal.
Below is sample of my code
void gPTP_ISR()
{
char buffer[MPEG2TS_LOAD_SIZE];
while(1)
{
if ( rcr[WriteIndex].flag == FALSE )
{
memset(buffer,0,sizeof(buffer));
memset(rcr[WriteIndex].Output_Buffer,0,MPEG2TS_LOAD_SIZE);
size = fread(buffer,(MPEG2TS_LOAD_SIZE),1,gst_app.file);
memcpy(&rcr[WriteIndex].Output_Buffer, buffer,MPEG2TS_LOAD_SIZE);
rcr[WriteIndex].flag = TRUE;
WriteIndex = (WriteIndex + 1) % ( RING_BUFFER_FRAMES);
count++;
}
}
}
static gboolean read_data(gst_app_t *app)
{
GstBuffer *buffer;
guint8 *ptr;
GstFlowReturn ret;
ptr = g_malloc(MPEG2TS_LOAD_SIZE);
g_assert(ptr);
if ( rcr[ReadIndex].flag == TRUE)
{
memcpy(ptr,&rcr[ReadIndex].Output_Buffer,MPEG2TS_LOAD_SIZE);
rcr[ReadIndex].flag = FALSE;
ReadIndex = (ReadIndex + 1) % ( RING_BUFFER_FRAMES);
buffer = gst_buffer_new();
GST_BUFFER_MALLOCDATA(buffer) = ptr;
GST_BUFFER_SIZE(buffer) = MPEG2TS_LOAD_SIZE;
GST_BUFFER_DATA(buffer) = GST_BUFFER_MALLOCDATA(buffer);
ret = gst_app_src_push_buffer(app->src, buffer);
if(ret != GST_FLOW_OK){
g_print("push buffer returned %d for %d bytes \n", ret,
size);
return FALSE;
}
return TRUE;
}
static void start_feed (GstElement * pipeline, guint size, gst_app_t *app)
{
if (app->sourceid == 0) {
GST_DEBUG ("start feeding");
app->sourceid = g_idle_add ((GSourceFunc) read_data, app);
}
}
static void stop_feed (GstElement * pipeline, gst_app_t *app)
{
if (app->sourceid != 0) {
GST_DEBUG ("stop feeding");
g_source_remove (app->sourceid);
app->sourceid = 0;
}
}
While executing it, Video playback plays normally whereas i keep getting
this below log
Discont detected from 0:00:00.500000000 to 2:08:51.446400000
Discont detected from 0:00:00.500000000 to 2:08:51.472522000
Discont detected from 0:00:00.500000000 to 2:08:51.498644000
Discont detected from 0:00:00.500000000 to 2:08:51.524766000
Discont detected from 0:00:00.500000000 to 2:08:51.550888000
Discont detected from 0:00:00.500000000 to 2:08:51.577011000
Discont detected from 0:00:00.500000000 to 2:08:51.603133000
Discont detected from 0:00:00.500000000 to 2:08:51.629255000
Discont detected from 0:00:00.500000000 to 2:08:51.655377000
Discont detected from 0:00:00.500000000 to 2:08:51.681500000
Discont detected from 0:00:00.500000000 to 2:08:51.707622000
Discont detected from 0:00:00.500000000 to 2:08:51.733744000
Discont detected from 0:00:00.500000000 to 2:08:51.759866000
Discont detected from 0:00:00.500000000 to 2:08:51.785988000
Discont detected from 0:00:00.500000000 to 2:08:51.812111000
Discont detected from 0:00:00.500000000 to 2:08:51.838233000
I have used filesrc to play but i dont get these logs. Only when i use
appsrc i get these logs.
This doesnt create a problem for video playback,but for my audio playback
there is no audio output and I wonder if this is creating the problem.
Any ideas would be helpful?.
Thanks
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/How-to-avoid-Discont-detected-message-while-pushing-data-using-appsrc-tp4668747.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list