|
Packit |
f546b1 |
/* GStreamer
|
|
Packit |
f546b1 |
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
|
|
Packit |
f546b1 |
* 2000 Wim Taymans <wtay@chello.be>
|
|
Packit |
f546b1 |
* 2005 Wim Taymans <wim@fluendo.com>
|
|
Packit |
f546b1 |
*
|
|
Packit |
f546b1 |
* gstpushsrc.h:
|
|
Packit |
f546b1 |
*
|
|
Packit |
f546b1 |
* This library is free software; you can redistribute it and/or
|
|
Packit |
f546b1 |
* modify it under the terms of the GNU Library General Public
|
|
Packit |
f546b1 |
* License as published by the Free Software Foundation; either
|
|
Packit |
f546b1 |
* version 2 of the License, or (at your option) any later version.
|
|
Packit |
f546b1 |
*
|
|
Packit |
f546b1 |
* This library is distributed in the hope that it will be useful,
|
|
Packit |
f546b1 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
f546b1 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
f546b1 |
* Library General Public License for more details.
|
|
Packit |
f546b1 |
*
|
|
Packit |
f546b1 |
* You should have received a copy of the GNU Library General Public
|
|
Packit |
f546b1 |
* License along with this library; if not, write to the
|
|
Packit |
f546b1 |
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
Packit |
f546b1 |
* Boston, MA 02110-1301, USA.
|
|
Packit |
f546b1 |
*/
|
|
Packit |
f546b1 |
|
|
Packit |
f546b1 |
#ifndef __GST_PUSH_SRC_H__
|
|
Packit |
f546b1 |
#define __GST_PUSH_SRC_H__
|
|
Packit |
f546b1 |
|
|
Packit |
f546b1 |
#include <gst/gst.h>
|
|
Packit |
f546b1 |
#include <gst/base/gstbasesrc.h>
|
|
Packit |
f546b1 |
|
|
Packit |
f546b1 |
G_BEGIN_DECLS
|
|
Packit |
f546b1 |
|
|
Packit |
f546b1 |
#define GST_TYPE_PUSH_SRC (gst_push_src_get_type())
|
|
Packit |
f546b1 |
#define GST_PUSH_SRC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PUSH_SRC,GstPushSrc))
|
|
Packit |
f546b1 |
#define GST_PUSH_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PUSH_SRC,GstPushSrcClass))
|
|
Packit |
f546b1 |
#define GST_PUSH_SRC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_PUSH_SRC, GstPushSrcClass))
|
|
Packit |
f546b1 |
#define GST_IS_PUSH_SRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PUSH_SRC))
|
|
Packit |
f546b1 |
#define GST_IS_PUSH_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PUSH_SRC))
|
|
Packit |
f546b1 |
|
|
Packit |
f546b1 |
typedef struct _GstPushSrc GstPushSrc;
|
|
Packit |
f546b1 |
typedef struct _GstPushSrcClass GstPushSrcClass;
|
|
Packit |
f546b1 |
|
|
Packit |
f546b1 |
/**
|
|
Packit |
f546b1 |
* GstPushSrc:
|
|
Packit |
f546b1 |
*
|
|
Packit |
f546b1 |
* The opaque #GstPushSrc data structure.
|
|
Packit |
f546b1 |
*/
|
|
Packit |
f546b1 |
struct _GstPushSrc {
|
|
Packit |
f546b1 |
GstBaseSrc parent;
|
|
Packit |
f546b1 |
|
|
Packit |
f546b1 |
/*< private >*/
|
|
Packit |
f546b1 |
gpointer _gst_reserved[GST_PADDING];
|
|
Packit |
f546b1 |
};
|
|
Packit |
f546b1 |
|
|
Packit |
f546b1 |
/**
|
|
Packit |
f546b1 |
* GstPushSrcClass:
|
|
Packit |
f546b1 |
* @parent_class: Element parent class
|
|
Packit |
f546b1 |
* @create: Ask the subclass to create a buffer. The subclass decides which
|
|
Packit |
f546b1 |
* size this buffer should be. Other then that, refer to
|
|
Packit |
f546b1 |
* #GstBaseSrc.create() for more details. If this method is
|
|
Packit |
f546b1 |
* not implemented, @alloc followed by @fill will be called.
|
|
Packit |
f546b1 |
* @alloc: Ask the subclass to allocate a buffer. The subclass decides which
|
|
Packit |
f546b1 |
* size this buffer should be. The default implementation will create
|
|
Packit |
f546b1 |
* a new buffer from the negotiated allocator.
|
|
Packit |
f546b1 |
* @fill: Ask the subclass to fill the buffer with data.
|
|
Packit |
f546b1 |
*
|
|
Packit |
f546b1 |
* Subclasses can override any of the available virtual methods or not, as
|
|
Packit |
f546b1 |
* needed. At the minimum, the @fill method should be overridden to produce
|
|
Packit |
f546b1 |
* buffers.
|
|
Packit |
f546b1 |
*/
|
|
Packit |
f546b1 |
struct _GstPushSrcClass {
|
|
Packit |
f546b1 |
GstBaseSrcClass parent_class;
|
|
Packit |
f546b1 |
|
|
Packit |
f546b1 |
/* ask the subclass to create a buffer, the default implementation
|
|
Packit |
f546b1 |
* uses alloc and fill */
|
|
Packit |
f546b1 |
GstFlowReturn (*create) (GstPushSrc *src, GstBuffer **buf);
|
|
Packit |
f546b1 |
/* allocate memory for a buffer */
|
|
Packit |
f546b1 |
GstFlowReturn (*alloc) (GstPushSrc *src, GstBuffer **buf);
|
|
Packit |
f546b1 |
/* ask the subclass to fill a buffer */
|
|
Packit |
f546b1 |
GstFlowReturn (*fill) (GstPushSrc *src, GstBuffer *buf);
|
|
Packit |
f546b1 |
|
|
Packit |
f546b1 |
/*< private >*/
|
|
Packit |
f546b1 |
gpointer _gst_reserved[GST_PADDING];
|
|
Packit |
f546b1 |
};
|
|
Packit |
f546b1 |
|
|
Packit |
f546b1 |
GST_BASE_API
|
|
Packit |
f546b1 |
GType gst_push_src_get_type (void);
|
|
Packit |
f546b1 |
|
|
Packit |
f546b1 |
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
|
|
Packit |
f546b1 |
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstPushSrc, gst_object_unref)
|
|
Packit |
f546b1 |
#endif
|
|
Packit |
f546b1 |
|
|
Packit |
f546b1 |
G_END_DECLS
|
|
Packit |
f546b1 |
|
|
Packit |
f546b1 |
#endif /* __GST_PUSH_SRC_H__ */
|