|
Packit |
971217 |
/* GStreamer
|
|
Packit |
971217 |
* Copyright (C) 2007 David Schleef <ds@schleef.org>
|
|
Packit |
971217 |
*
|
|
Packit |
971217 |
* This library is free software; you can redistribute it and/or
|
|
Packit |
971217 |
* modify it under the terms of the GNU Library General Public
|
|
Packit |
971217 |
* License as published by the Free Software Foundation; either
|
|
Packit |
971217 |
* version 2 of the License, or (at your option) any later version.
|
|
Packit |
971217 |
*
|
|
Packit |
971217 |
* This library is distributed in the hope that it will be useful,
|
|
Packit |
971217 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
971217 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
971217 |
* Library General Public License for more details.
|
|
Packit |
971217 |
*
|
|
Packit |
971217 |
* You should have received a copy of the GNU Library General Public
|
|
Packit |
971217 |
* License along with this library; if not, write to the
|
|
Packit |
971217 |
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
Packit |
971217 |
* Boston, MA 02110-1301, USA.
|
|
Packit |
971217 |
*/
|
|
Packit |
971217 |
|
|
Packit |
971217 |
#ifndef _GST_APP_SINK_H_
|
|
Packit |
971217 |
#define _GST_APP_SINK_H_
|
|
Packit |
971217 |
|
|
Packit |
971217 |
#include <gst/gst.h>
|
|
Packit |
971217 |
#include <gst/base/gstbasesink.h>
|
|
Packit |
971217 |
#include <gst/app/app-prelude.h>
|
|
Packit |
971217 |
|
|
Packit |
971217 |
G_BEGIN_DECLS
|
|
Packit |
971217 |
|
|
Packit |
971217 |
#define GST_TYPE_APP_SINK \
|
|
Packit |
971217 |
(gst_app_sink_get_type())
|
|
Packit |
971217 |
#define GST_APP_SINK(obj) \
|
|
Packit |
971217 |
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_APP_SINK,GstAppSink))
|
|
Packit |
971217 |
#define GST_APP_SINK_CLASS(klass) \
|
|
Packit |
971217 |
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_APP_SINK,GstAppSinkClass))
|
|
Packit |
971217 |
#define GST_IS_APP_SINK(obj) \
|
|
Packit |
971217 |
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_APP_SINK))
|
|
Packit |
971217 |
#define GST_IS_APP_SINK_CLASS(klass) \
|
|
Packit |
971217 |
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_APP_SINK))
|
|
Packit |
971217 |
#define GST_APP_SINK_CAST(obj) \
|
|
Packit |
971217 |
((GstAppSink*)(obj))
|
|
Packit |
971217 |
|
|
Packit |
971217 |
typedef struct _GstAppSink GstAppSink;
|
|
Packit |
971217 |
typedef struct _GstAppSinkClass GstAppSinkClass;
|
|
Packit |
971217 |
typedef struct _GstAppSinkPrivate GstAppSinkPrivate;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/* FIXME 2.0: Make the instance/class struct private */
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/**
|
|
Packit |
971217 |
* GstAppSinkCallbacks: (skip)
|
|
Packit |
971217 |
* @eos: Called when the end-of-stream has been reached. This callback
|
|
Packit |
971217 |
* is called from the streaming thread.
|
|
Packit |
971217 |
* @new_preroll: Called when a new preroll sample is available.
|
|
Packit |
971217 |
* This callback is called from the streaming thread.
|
|
Packit |
971217 |
* The new preroll sample can be retrieved with
|
|
Packit |
971217 |
* gst_app_sink_pull_preroll() either from this callback
|
|
Packit |
971217 |
* or from any other thread.
|
|
Packit |
971217 |
* @new_sample: Called when a new sample is available.
|
|
Packit |
971217 |
* This callback is called from the streaming thread.
|
|
Packit |
971217 |
* The new sample can be retrieved with
|
|
Packit |
971217 |
* gst_app_sink_pull_sample() either from this callback
|
|
Packit |
971217 |
* or from any other thread.
|
|
Packit |
971217 |
*
|
|
Packit |
971217 |
* A set of callbacks that can be installed on the appsink with
|
|
Packit |
971217 |
* gst_app_sink_set_callbacks().
|
|
Packit |
971217 |
*/
|
|
Packit |
971217 |
typedef struct {
|
|
Packit |
971217 |
void (*eos) (GstAppSink *appsink, gpointer user_data);
|
|
Packit |
971217 |
GstFlowReturn (*new_preroll) (GstAppSink *appsink, gpointer user_data);
|
|
Packit |
971217 |
GstFlowReturn (*new_sample) (GstAppSink *appsink, gpointer user_data);
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/*< private >*/
|
|
Packit |
971217 |
gpointer _gst_reserved[GST_PADDING];
|
|
Packit |
971217 |
} GstAppSinkCallbacks;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
struct _GstAppSink
|
|
Packit |
971217 |
{
|
|
Packit |
971217 |
GstBaseSink basesink;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/*< private >*/
|
|
Packit |
971217 |
GstAppSinkPrivate *priv;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/*< private >*/
|
|
Packit |
971217 |
gpointer _gst_reserved[GST_PADDING];
|
|
Packit |
971217 |
};
|
|
Packit |
971217 |
|
|
Packit |
971217 |
struct _GstAppSinkClass
|
|
Packit |
971217 |
{
|
|
Packit |
971217 |
GstBaseSinkClass basesink_class;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/* signals */
|
|
Packit |
971217 |
void (*eos) (GstAppSink *appsink);
|
|
Packit |
971217 |
GstFlowReturn (*new_preroll) (GstAppSink *appsink);
|
|
Packit |
971217 |
GstFlowReturn (*new_sample) (GstAppSink *appsink);
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/* actions */
|
|
Packit |
971217 |
GstSample * (*pull_preroll) (GstAppSink *appsink);
|
|
Packit |
971217 |
GstSample * (*pull_sample) (GstAppSink *appsink);
|
|
Packit |
971217 |
GstSample * (*try_pull_preroll) (GstAppSink *appsink, GstClockTime timeout);
|
|
Packit |
971217 |
GstSample * (*try_pull_sample) (GstAppSink *appsink, GstClockTime timeout);
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/*< private >*/
|
|
Packit |
971217 |
gpointer _gst_reserved[GST_PADDING - 2];
|
|
Packit |
971217 |
};
|
|
Packit |
971217 |
|
|
Packit |
971217 |
GST_APP_API
|
|
Packit |
971217 |
GType gst_app_sink_get_type (void);
|
|
Packit |
971217 |
|
|
Packit |
971217 |
GST_APP_API
|
|
Packit |
971217 |
void gst_app_sink_set_caps (GstAppSink *appsink, const GstCaps *caps);
|
|
Packit |
971217 |
|
|
Packit |
971217 |
GST_APP_API
|
|
Packit |
971217 |
GstCaps * gst_app_sink_get_caps (GstAppSink *appsink);
|
|
Packit |
971217 |
|
|
Packit |
971217 |
GST_APP_API
|
|
Packit |
971217 |
gboolean gst_app_sink_is_eos (GstAppSink *appsink);
|
|
Packit |
971217 |
|
|
Packit |
971217 |
GST_APP_API
|
|
Packit |
971217 |
void gst_app_sink_set_emit_signals (GstAppSink *appsink, gboolean emit);
|
|
Packit |
971217 |
|
|
Packit |
971217 |
GST_APP_API
|
|
Packit |
971217 |
gboolean gst_app_sink_get_emit_signals (GstAppSink *appsink);
|
|
Packit |
971217 |
|
|
Packit |
971217 |
GST_APP_API
|
|
Packit |
971217 |
void gst_app_sink_set_max_buffers (GstAppSink *appsink, guint max);
|
|
Packit |
971217 |
|
|
Packit |
971217 |
GST_APP_API
|
|
Packit |
971217 |
guint gst_app_sink_get_max_buffers (GstAppSink *appsink);
|
|
Packit |
971217 |
|
|
Packit |
971217 |
GST_APP_API
|
|
Packit |
971217 |
void gst_app_sink_set_drop (GstAppSink *appsink, gboolean drop);
|
|
Packit |
971217 |
|
|
Packit |
971217 |
GST_APP_API
|
|
Packit |
971217 |
gboolean gst_app_sink_get_drop (GstAppSink *appsink);
|
|
Packit |
971217 |
|
|
Packit |
971217 |
GST_APP_API
|
|
Packit |
971217 |
void gst_app_sink_set_buffer_list_support (GstAppSink *appsink, gboolean enable_lists);
|
|
Packit |
971217 |
|
|
Packit |
971217 |
GST_APP_API
|
|
Packit |
971217 |
gboolean gst_app_sink_get_buffer_list_support (GstAppSink *appsink);
|
|
Packit |
971217 |
|
|
Packit |
971217 |
GST_APP_API
|
|
Packit |
971217 |
void gst_app_sink_set_wait_on_eos (GstAppSink *appsink, gboolean wait);
|
|
Packit |
971217 |
|
|
Packit |
971217 |
GST_APP_API
|
|
Packit |
971217 |
gboolean gst_app_sink_get_wait_on_eos (GstAppSink *appsink);
|
|
Packit |
971217 |
|
|
Packit |
971217 |
GST_APP_API
|
|
Packit |
971217 |
GstSample * gst_app_sink_pull_preroll (GstAppSink *appsink);
|
|
Packit |
971217 |
|
|
Packit |
971217 |
GST_APP_API
|
|
Packit |
971217 |
GstSample * gst_app_sink_pull_sample (GstAppSink *appsink);
|
|
Packit |
971217 |
|
|
Packit |
971217 |
GST_APP_API
|
|
Packit |
971217 |
GstSample * gst_app_sink_try_pull_preroll (GstAppSink *appsink, GstClockTime timeout);
|
|
Packit |
971217 |
|
|
Packit |
971217 |
GST_APP_API
|
|
Packit |
971217 |
GstSample * gst_app_sink_try_pull_sample (GstAppSink *appsink, GstClockTime timeout);
|
|
Packit |
971217 |
|
|
Packit |
971217 |
GST_APP_API
|
|
Packit |
971217 |
void gst_app_sink_set_callbacks (GstAppSink * appsink,
|
|
Packit |
971217 |
GstAppSinkCallbacks *callbacks,
|
|
Packit |
971217 |
gpointer user_data,
|
|
Packit |
971217 |
GDestroyNotify notify);
|
|
Packit |
971217 |
|
|
Packit |
971217 |
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
|
|
Packit |
971217 |
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstAppSink, gst_object_unref)
|
|
Packit |
971217 |
#endif
|
|
Packit |
971217 |
|
|
Packit |
971217 |
G_END_DECLS
|
|
Packit |
971217 |
|
|
Packit |
971217 |
#endif
|
|
Packit |
971217 |
|