Using appsrc with m2ts files not showing any playback

mwei bluestring at live.com
Wed Feb 17 21:34:13 UTC 2016


Hi all,

I am trying to incorporate gstreamer to show playback in my current
application. There is a loader in this application which reads the files and
then sends it through gstreamer. It sends it to gstreamer in chunks and
hence why I am using an appsrc instead of something else. After pushing the
buffer through appsrc, it goes through the tsdemux and the video pad is
being added from the src. Currently, my pipeline looks like this:  appsrc !
tsdemux ! h264parse ! avdec_h264 ! videoconvert ! xvimagesink.

I have gotten this to work with PS streams using a similar pipeline. appsrc
! mpegpsdemux ! mpeg2dec ! videoconvert ! xvimagesink.  

I am thinking that there might be something missing while configuring the
appsrc, but I'm not sure. Any suggestions? 

Here is how I am setting up the appsrc.

    g_object_set(appSource, "format", GST_FORMAT_TIME, NULL);

    /* this causes appSource to block more buffers being pushed to it when
its queue is full */
    g_object_set(appSource, "block", true, NULL);
    g_object_set(appSource, "is-live", true, NULL);
    g_object_set(appSource, "min-latency", 0, NULL);
    g_object_set(appSource, "max-latency", gst_util_uint64_scale_int (1,
GST_SECOND, 30), NULL);
    g_object_set(appSource, "do-timestamp", true, NULL);

When the application receives from data from the loader, it calls push
buffer like so:

After reading a chunk of data in the file, that is put into a Buffer and
this function gets called.

void pushBuffer(Buffer* buffer)
{
    GstBuffer* newBuffer;                           
    GstMapInfo mapInfo;									
    (void)mapInfo;

    // Create a new buffer
    newBuffer = gst_buffer_new_allocate(NULL,buffer->ReadRemaining(),NULL);

    // Get the information about the newly created buffer
    gst_buffer_map(newBuffer, &mapInfo, GST_MAP_WRITE);

    /* Copy avp buffer's data into newBuffer's data */
    memcpy(mapInfo.data, buffer->ReadPointer(), buffer->ReadRemaining());
    mapInfo.size = buffer->ReadRemaining();

    gst_buffer_unmap (newBuffer, &mapInfo);
    gst_app_src_push_buffer(GetAppSrc(), newBuffer);
}


Thanks,
mwei





--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Using-appsrc-with-m2ts-files-not-showing-any-playback-tp4675911.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list