2 * Copyright (C) 2007 David Schleef <ds@schleef.org>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #ifndef _GST_APP_SINK_H_
21 #define _GST_APP_SINK_H_
24 #include <gst/base/gstbasesink.h>
28 #define GST_TYPE_APP_SINK \
29 (gst_app_sink_get_type())
30 #define GST_APP_SINK(obj) \
31 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_APP_SINK,GstAppSink))
32 #define GST_APP_SINK_CLASS(klass) \
33 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_APP_SINK,GstAppSinkClass))
34 #define GST_IS_APP_SINK(obj) \
35 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_APP_SINK))
36 #define GST_IS_APP_SINK_CLASS(klass) \
37 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_APP_SINK))
39 #define GST_APP_SINK_CAST(obj) \
42 typedef struct _GstAppSink GstAppSink;
43 typedef struct _GstAppSinkClass GstAppSinkClass;
44 typedef struct _GstAppSinkPrivate GstAppSinkPrivate;
47 * GstAppSinkCallbacks:
48 * @eos: Called when the end-of-stream has been reached. This callback
49 * is called from the steaming thread.
50 * @new_preroll: Called when a new preroll sample is available.
51 * This callback is called from the steaming thread.
52 * The new preroll sample can be retrieved with
53 * gst_app_sink_pull_preroll() either from this callback
54 * or from any other thread.
55 * @new_sample: Called when a new sample is available.
56 * This callback is called from the steaming thread.
57 * The new sample can be retrieved with
58 * gst_app_sink_pull_sample() either from this callback
59 * or from any other thread.
61 * A set of callbacks that can be installed on the appsink with
62 * gst_app_sink_set_callbacks().
67 void (*eos) (GstAppSink *sink, gpointer user_data);
68 GstFlowReturn (*new_preroll) (GstAppSink *sink, gpointer user_data);
69 GstFlowReturn (*new_sample) (GstAppSink *sink, gpointer user_data);
72 gpointer _gst_reserved[GST_PADDING];
73 } GstAppSinkCallbacks;
80 GstAppSinkPrivate *priv;
83 gpointer _gst_reserved[GST_PADDING];
86 struct _GstAppSinkClass
88 GstBaseSinkClass basesink_class;
91 void (*eos) (GstAppSink *sink);
92 void (*new_preroll) (GstAppSink *sink);
93 void (*new_sample) (GstAppSink *sink);
96 GstSample * (*pull_preroll) (GstAppSink *sink);
97 GstSample * (*pull_sample) (GstAppSink *sink);
100 gpointer _gst_reserved[GST_PADDING];
103 GType gst_app_sink_get_type(void);
105 void gst_app_sink_set_caps (GstAppSink *appsink, const GstCaps *caps);
106 GstCaps * gst_app_sink_get_caps (GstAppSink *appsink);
108 gboolean gst_app_sink_is_eos (GstAppSink *appsink);
110 void gst_app_sink_set_emit_signals (GstAppSink *appsink, gboolean emit);
111 gboolean gst_app_sink_get_emit_signals (GstAppSink *appsink);
113 void gst_app_sink_set_max_buffers (GstAppSink *appsink, guint max);
114 guint gst_app_sink_get_max_buffers (GstAppSink *appsink);
116 void gst_app_sink_set_drop (GstAppSink *appsink, gboolean drop);
117 gboolean gst_app_sink_get_drop (GstAppSink *appsink);
119 GstSample * gst_app_sink_pull_preroll (GstAppSink *appsink);
120 GstSample * gst_app_sink_pull_sample (GstAppSink *appsink);
122 void gst_app_sink_set_callbacks (GstAppSink * appsink,
123 GstAppSinkCallbacks *callbacks,
125 GDestroyNotify notify);