I've implemented the code to get video stream from camera source over UDP. I need to check whether the source (camera) sending data or alive. Is there any way to check in using Gstreamer?
end-of-stream notification is not working to check udp source pipeline state.
SimpleVideoComponent vc = new SimpleVideoComponent();
Pipeline pipeline = new Pipeline("monitoring-pipe");
pipeline.getBus().connect((Bus.ERROR) this);
pipeline.getBus().connect((Bus.WARNING) this);
pipeline.getBus().connect((Bus.STATE_CHANGED) this);
pipeline.getBus().connect((Bus.EOS) this);
Element udpsrc = ElementFactory.make("udpsrc", "udpsrc");
udpsrc.set("port", monitoringPort);
vc.getElement().set("sync", false);
udpsrc.setCaps(Caps
.fromString("application/x-rtp, media=(string)video, encoding-name=(string)H264, payload=(int)101"));
Bin bin = Gst.parseBinFromDescription(
"rtph264depay ! video/x-h264, stream-format=byte-stream, profile=high ! h264parse ! queue ! avdec_h264 ! queue2 ! videoconvert",
true);
pipeline.addMany(udpsrc, bin, vc.getElement());
Element.linkMany(udpsrc, bin, vc.getElement());
pipeline.setState(State.PLAYING);