/** * Add a listener for the <code>preroll-handoff</code> signal. * * @param listener The listener to be called when a {@link Buffer} is ready. */ public void connect(final PREROLL_HANDOFF listener) { connect(PREROLL_HANDOFF.class, listener, new PrerollHandoffCallback(listener)); } /**
/** * Add a listener for the <code>handoff</code> signal on this sink * * @param listener The listener to be called when a {@link Buffer} is ready. */ public void connect(final HANDOFF listener) { connect(HANDOFF.class, listener, new HandoffCallback(listener)); } /**
public BufferDataSink(String name, Pipeline pipeline, Listener listener) { super(initializer(gst.ptr_gst_bin_new(name))); this.listener = listener; Element element = pipeline.getElementByName(name); if (element != null) { // TODO: Fix. This doesn't work as it should. getElementByName() returns a // BaseSink which cannot be casted to FakeSink. sink = (BaseSink) element; sink.set("signal-handoffs", true); sink.set("sync", true); sink.set("preroll-queue-len", 1); sink.connect((BaseSink.HANDOFF) new SinkNewBufferListener()); sink.connect((BaseSink.PREROLL_HANDOFF) new SinkNewBufferListener()); } else { sink = null; throw new RuntimeException("Element with name " + name + " not found in the pipeline"); } }
public ByteDataSink(String name, Pipeline pipeline, Listener listener) { super(initializer(gst.ptr_gst_bin_new(name))); this.listener = listener; Element element = pipeline.getElementByName(name); if (element != null) { // TODO: Fix. This doesn't work as it should. getElementByName() returns a // BaseSink which cannot be casted to FakeSink. sink = (BaseSink) element; sink.set("signal-handoffs", true); sink.set("sync", true); sink.set("preroll-queue-len", 1); sink.connect((BaseSink.HANDOFF) new DataHandoffListener()); sink.connect((BaseSink.PREROLL_HANDOFF) new DataHandoffListener()); } else { sink = null; throw new RuntimeException("Element with name " + name + " not found in the pipeline"); } }
public RGBDataSink(String name, Pipeline pipeline, Listener listener) { super(initializer(gst.ptr_gst_bin_new(name))); this.listener = listener; Element element = pipeline.getElementByName(name); if (element != null) { // TODO: Fix. This doesn't work as it should. getElementByName() returns a // BaseSink which cannot be casted to FakeSink. videosink = (BaseSink) element; videosink.set("signal-handoffs", true); videosink.set("sync", true); videosink.set("preroll-queue-len", 1); videosink.connect((BaseSink.HANDOFF) new VideoHandoffListener()); videosink.connect((BaseSink.PREROLL_HANDOFF) new VideoHandoffListener()); } else { videosink = null; throw new RuntimeException("Element with name " + name + " not found in the pipeline"); } }
private void initSink(String name, String mask) { sink = (FakeSink) ElementFactory.make("fakesink", name); sink.set("signal-handoffs", true); sink.set("sync", true); sink.set("preroll-queue-len", 1); sink.connect((BaseSink.HANDOFF) new SinkNewBufferListener()); sink.connect((BaseSink.PREROLL_HANDOFF) new SinkNewBufferListener()); // // Convert the input into 32bit RGB so it can be fed directly to a BufferedImage // Element conv = ElementFactory.make("ffmpegcolorspace", "ColorConverter"); Element videofilter = ElementFactory.make("capsfilter", "ColorFilter"); StringBuilder caps = new StringBuilder("video/x-raw-rgb, bpp=32, depth=24, endianness=(int)4321, "); caps.append(mask); videofilter.setCaps(new Caps(caps.toString())); addMany(conv, videofilter, sink); Element.linkMany(conv, videofilter, sink); // // Link the ghost pads on the bin to the sink pad on the convertor // addPad(new GhostPad("sink", conv.getStaticPad("sink"))); }
/** * Creates a new instance of RGBDataSink with the given name. * * @param name The name used to identify this pipeline. */ public ByteDataSink(String name, Listener listener) { super(initializer(gst.ptr_gst_bin_new(name))); this.listener = listener; sink = (FakeSink) ElementFactory.make("fakesink", name); sink.set("signal-handoffs", true); sink.set("sync", true); sink.set("preroll-queue-len", 1); sink.connect((BaseSink.HANDOFF) new DataHandoffListener()); sink.connect((BaseSink.PREROLL_HANDOFF) new DataHandoffListener()); // // Adding identity element // Element conv = ElementFactory.make("identity", "Data"); addMany(conv, sink); Element.linkMany(conv, sink); // // Link the ghost pads on the bin to the sink pad on the convertor // addPad(new GhostPad("sink", conv.getStaticPad("sink"))); }