Package org.gstreamer.event

Examples of org.gstreamer.event.TagEvent


    }

    @Test
    public void addEventProbe() {
        Element elem = ElementFactory.make("identity", "src");
        Event ev = new TagEvent(new TagList());

        Pad sink = elem.getStaticPad("sink");

        final AtomicReference<Event> e = new AtomicReference<Event>();

        Pad.EVENT_PROBE event_probe = new Pad.EVENT_PROBE() {

            public boolean eventReceived(Pad pad, Event event) {
                e.set(event);
                return false;
            }
        };

        sink.addEventProbe(event_probe);
        sink.sendEvent(ev);
        assertEquals("event_prober.probeEvent() was not called", ev, e.get());

        sink.removeEventProbe(event_probe);

        Event ev2 = new TagEvent(new TagList());
        sink.sendEvent(ev2);
        assertNotSame("event_prober.probeEvent() should not have been called", ev2, e.get());
    }
View Full Code Here


        Event ev = gst.gst_event_new_tag(new TagList());
        assertNotNull("gst_event_new_tag returned null", ev);
        assertTrue("gst_event_new_tag returned a non-TAG event", ev instanceof TagEvent);
    }
    @Test public void TagEvent_testGC() throws Exception {
        TagEvent ev = new TagEvent(new TagList());
        @SuppressWarnings("unused")
        TagList tl = ev.getTagList();
        WeakReference<Event> evRef = new WeakReference<Event>(ev);
        ev = null;
        assertFalse("Event ref collected before TagList is unreferenced", waitGC(evRef));
        tl = null;
        assertTrue("Event ref not collected after TagList is unreferenced", waitGC(evRef));
View Full Code Here

TOP

Related Classes of org.gstreamer.event.TagEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.