not as clever as I hoped :-(

James Linder jam at tigger.ws
Tue Aug 10 11:15:48 UTC 2021


G’day all

I took much of my stuff from basic_tutorial12.c so playing with it here:

when I run tutorial and send it SIGTERM the handler is immediatly invoked.
yet is never set
EOS is not sent (explicity, but happens)

If I let the clip play to the end then EOS message and yet is set.

What am I missing, in particular I want to send eos on SIGTERM

volatile int yet = 0;
GstElement *pipeline;

void handler (int signum)
{
  g_print ("[handler function] send eos] %d\n", gst_element_send_event (pipeline, gst_event_new_eos ()));
  while (!(yet)) {
      g_print ("%d\n", yet);
      g_usleep (100000);
  }
  g_print ("exit\n");
  exit (0);
}


and

 case GST_MESSAGE_EOS:
    /* end-of-stream */
    gst_element_set_state (data->pipeline, GST_STATE_READY);
    g_main_loop_quit (data->loop);
  yet = 1;
  g_print (“\nEOS\n");
    break;


In case it is interesting here are traces:

--------------------------------
tutorial run to end:
————————————————

jam at ws101:~> ./basic
Buffering (100%)
EOS

————————————————
tutorial gets SIGTERM
————————————————

jam at ws101:~> ./basic
[handler function] send eos] 1
0
0
0
forever
playback STOPS but yet is never set


More information about the gstreamer-devel mailing list