EOS problem in Gstreamer pipeline with webrtcbin
I am using GStreamer 1.18.4 using GstSharp binding. And I am using following pipeline:
filesrc name=source location=video.raw ! videoparse width=1920 height=1080 framerate=30/1 format=40 ! videoconvert ! openh264enc ! h264parse ! rtph264pay ! webrtcbin bundle-policy=max-bundle
I initialize pipeline with code:
_pipeline = (Gst.Pipeline)Gst.Parse.Launch("...");
_pipeline.MessageForward = true;
_pipeline.Bus.AddSignalWatch();
_pipeline.Bus.Message += HandleBusMessage;
_pipeline.SetState(Gst.State.Playing);
_loop.Run();
private void HandleBusMessage(object o, Gst.MessageArgs args) {
var msg = args.Message;
_logger.LogInformation($"Received message: {msg.Type}");
}
I need to stop the whole pipeline when filesrc read the whole file. I thought that I just need to handle the EOS message and exit the loop, but no EOS is received from the bus.
I never get EOS message type in HandleBusMessage method, when filesrc read whole file. I only get StreamStatus, Tag, StateChanged message types. I tried set the property "message-forward" on pipeline (I also try to set this property on the webrtcbin),but no Element message type is received in the method (https://gstreamer.freedesktop.org/documentation/gstreamer/gstbin.html?gi-language=c#GstBin:message-forward).
I also tried to remove the webrtcbin from the pipeline. Then the method HandleBusMessage is called also with Element and EOS message type. So the problem must be somehow with the webrtcbin element.
How can I get information that filesrc read whole file and generated EOS? Is webrtc handling event wrong?
Thanks