/* * Copyright (c) 2007, 2008 Wayne Meissner * * This file is part of gstreamer-java. * * This code is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License version 3 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * version 3 for more details. * * You should have received a copy of the GNU Lesser General Public License * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>. */ package org.freedesktop.gstreamer; import org.freedesktop.gstreamer.lowlevel.ReferenceManager; import org.freedesktop.gstreamer.lowlevel.annotations.HasSubtype; import static org.freedesktop.gstreamer.lowlevel.GstEventAPI.GSTEVENT_API; /** * Base type of all events. * * <p> Events are passed between elements in parallel to the data stream. Some events * are serialized with buffers, others are not. Some events only travel downstream, * others only upstream. Some events can travel both upstream and downstream. * * <p> The events are used to signal special conditions in the datastream such as * EOS (end of stream) or the start of a new stream-segment. * * <p> Events are also used to flush the pipeline of any pending data. * * @see Pad#pushEvent * @see Pad#sendEvent * @see Element#sendEvent */ @HasSubtype public class Event extends MiniObject { public static final String GTYPE_NAME = "GstEvent"; /** * This constructor is for internal use only. * @param init initialization data. */ public Event(Initializer init) { super(init); } /** * Gets the structure containing the data in this event. * * @return a structure. */ public Structure getStructure() { return ReferenceManager.addKeepAliveReference(GSTEVENT_API.gst_event_get_structure(this), this); } }