patricecoulibaly
patricecoulibaly

Reputation: 1

Gstreamer-Interleave 2 files: how to capture End-Of-Stream on one stream from the pipeline?

I am interleaving 2 mono files to playout a stereo output file. one file is shorter than the other and I want to capture the EOS when the shorter file reaches end-of-streamer (EOS).

Unfortunately, when I used a gst_bus_add_watch() on the pipeline (see following code), my_callback() get called with EOS message ONLY when the resulted interleaved stream reaches end-of-file. In my case, that happens only when the longest file reaches EOS:

*loop = g_main_loop_new (NULL, FALSE);

pipeline = gst_pipeline_new ("pipeline");

bus = gst_pipeline_get_bus(GST_PIPELINE(pipeline));

gst_bus_add_watch(bus, my_callback, loop);

Is there a way to capture the EOS on one of the 2 streams (the shorted stream for example) (from my_callback()) when this stream reaches EOS? (gboolean my_bus_callback (GstBus *bus, GstMessage message,gpointer data))

Thank you

Upvotes: 0

Views: 788

Answers (1)

ensonic
ensonic

Reputation: 3450

It might be easier to implement a mode-flag on the interleave element.

What you can do now is to use a pad-probe on the sink pads of the interleave element and listen for eos-events there. You should be able to post them from the to the bus, but I haven't tried that.

Upvotes: 0

Related Questions