blocking execution until multifilesink gets an EOS event

themanonthemoon adkyriazis at gmail.com
Wed Jun 5 18:31:48 UTC 2019


I send an EOS event through a particular branch of my pipeline, and I'm
pretty confident the EOS event is being received by the sink, but I want to
be able to block execution until it is received.

My pipeline looks like this
                                                     other_queue --->
<stuff> ---> fakesink           
                                                   /
source stuff ---> encoder ---> tee
                                                   \
                                                     saving_queue --->
<stuff> ---> splitmuxsink

my code looks like this:



/* send EOS logic */
GstPad* saving_queue_src_pad = gst_element_get_static_pad(saving_queue,
"src");

gst_pad_add_probe(saving_queue_src_pad, GST_PAD_PROBE_TYPE_BLOCK |
GST_PAD_PROBE_TYPE_BUFFER, block_saving_callback, this, NULL);

g_object_set(pipeline, "message-forward", true, NULL);

GstPad* peer_pad = gst_pad_get_peer(saving_queue_src_pad),;
gst_pad_send_event(peer_pad, gst_event_new_eos());


/* wait for EOS */
GstClockTime timeout = 10 * GST_SECOND;
GstMessage* msg;

msg = gst_bus_timed_pop_filtered(
    gst_element_get_bus(pipeline), timeout,
    static_cast<GstMessageType>(GST_MESSAGE_EOS | GST_MESSAGE_ERROR));

if (msg == NULL) {
  std::cout << "EOS timeout" << std::endl;
} else if (GST_MESSAGE_TYPE(msg) == GST_MESSAGE_ERROR) {
  std::cout << "EOS error" << std::endl;
} else {
  std::cout << "EOS received by splitmuxsink" << std::endl;
}

if (msg) gst_message_unref(msg);
gst_message_unref(saving_queue_src_pad);
gst_message_unref(peer_pad);




I am finding that this always times out. My questions:

1. Is there something clearly wrong with this code?
2. Is it possible to only check the splitmuxsink element to see if it got an
EOS?

One more thing, due to the way my code is structured, it is important for
this to be checked synchronously (as a blocking call) rather than
asynchronously.




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


More information about the gstreamer-devel mailing list