appsrc frozen on the second run

tjirasu tonyjirasupakorn at gmail.com
Sun Oct 25 02:14:33 UTC 2020


I have an application that playback a mpegts file using appsrc.
My pipeline is as follow. 

apprsc->tsdemux->h264parse->omxh264dec->videoconvert->kmssink

It always play the file to the EOS. But playing the second time always
froze.

Here's a snippet of my 1st run follow by the 2nd run...the video is about 30
seconds long

*1st run:*
appsrc gstappsrc.c:865:gst_app_src_start:<appsrc0>[00m starting
appsrc gstappsrc.c:688:gst_app_src_internal_get_caps:<appsrc1>[00m caps:
(NULL)
appsrc gstappsrc.c:1863:gst_app_src_push_internal:<appsrc0>[00m queueing
buffer 0x7f9001b020
appsrc gstappsrc.c:1863:gst_app_src_push_internal:<appsrc0>[00m queueing
buffer 0x7f9001b130
appsrc gstappsrc.c:1819:gst_app_src_push_internal:<appsrc0>[00m queue filled
(100000 >= 100000)
appsrc gstappsrc.c:1819:gst_app_src_push_internal:<appsrc0>[00m queue filled
(100000 >= 100000)

*2nd run:*
appsrc gstappsrc.c:865:gst_app_src_start:<appsrc1>[00m starting
appsrc gstappsrc.c:688:gst_app_src_internal_get_caps:<appsrc1>[00m caps:
(NULL)
appsrc gstappsrc.c:835:gst_app_src_unlock:<appsrc1>[00m unlock start
appsrc gstappsrc.c:1290:gst_app_src_create:<appsrc1>[00m we are flushing
appsrc gstappsrc.c:850:gst_app_src_unlock_stop:<appsrc1>[00m unlock stop

Here's the full debug log on appsrc  debug.log
<http://gstreamer-devel.966125.n4.nabble.com/file/t379691/debug.log>  

In the push_data callback, once it reaches the EOS, I also create a function
to flush and return FALSE.

Here's a snippet of my code:

void send_eos_and_flush(CustomData *data)
{
  GstFlowReturn ret;
  ret = gst_app_src_end_of_stream(data->appsrc);
  if(ret != GST_FLOW_OK)
    printf("GST_FLOW not okay: GstFlowReturn(%i)\n", ret);  

  GstEvent* flush_start = gst_event_new_flush_start();

  ret = gst_element_send_event(GST_ELEMENT(data->pipeline), flush_start);
  if (!ret)
    printf("failed to send flush-start event: GstFlowReturn(%i)\n", ret);

  GstEvent* flush_stop = gst_event_new_flush_stop(FALSE);

  ret = gst_element_send_event(GST_ELEMENT(data->pipeline), flush_stop);
  if (!ret)
    printf("failed to send flush-stop event: GstFlowReturn(%i)\n", ret);
}

*Question*: Should I send_event to data->pipeline or data->appsrc?

Last, maybe I could be looking at the wrong place. Could it be the
*tsdemux*?

Any advice is much appreciated.
~tjirasu



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list