appsink: Fix 'steaming' typo in API doc
[platform/upstream/gstreamer.git] / gst-libs / gst / app / gstappsink.h
1 /* GStreamer
2  * Copyright (C) 2007 David Schleef <ds@schleef.org>
3  *
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.
8  *
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.
13  *
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., 51 Franklin St, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19
20 #ifndef _GST_APP_SINK_H_
21 #define _GST_APP_SINK_H_
22
23 #include <gst/gst.h>
24 #include <gst/base/gstbasesink.h>
25
26 G_BEGIN_DECLS
27
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))
38 #define GST_APP_SINK_CAST(obj) \
39   ((GstAppSink*)(obj))
40
41 typedef struct _GstAppSink GstAppSink;
42 typedef struct _GstAppSinkClass GstAppSinkClass;
43 typedef struct _GstAppSinkPrivate GstAppSinkPrivate;
44
45 /* FIXME 2.0: Make the instance/class struct private */
46
47 /**
48  * GstAppSinkCallbacks: (skip)
49  * @eos: Called when the end-of-stream has been reached. This callback
50  *       is called from the streaming thread.
51  * @new_preroll: Called when a new preroll sample is available.
52  *       This callback is called from the streaming thread.
53  *       The new preroll sample can be retrieved with
54  *       gst_app_sink_pull_preroll() either from this callback
55  *       or from any other thread.
56  * @new_sample: Called when a new sample is available.
57  *       This callback is called from the streaming thread.
58  *       The new sample can be retrieved with
59  *       gst_app_sink_pull_sample() either from this callback
60  *       or from any other thread.
61  *
62  * A set of callbacks that can be installed on the appsink with
63  * gst_app_sink_set_callbacks().
64  */
65 typedef struct {
66   void          (*eos)              (GstAppSink *appsink, gpointer user_data);
67   GstFlowReturn (*new_preroll)      (GstAppSink *appsink, gpointer user_data);
68   GstFlowReturn (*new_sample)       (GstAppSink *appsink, gpointer user_data);
69
70   /*< private >*/
71   gpointer     _gst_reserved[GST_PADDING];
72 } GstAppSinkCallbacks;
73
74 struct _GstAppSink
75 {
76   GstBaseSink basesink;
77
78   /*< private >*/
79   GstAppSinkPrivate *priv;
80
81   /*< private >*/
82   gpointer     _gst_reserved[GST_PADDING];
83 };
84
85 struct _GstAppSinkClass
86 {
87   GstBaseSinkClass basesink_class;
88
89   /* signals */
90   void          (*eos)              (GstAppSink *appsink);
91   GstFlowReturn (*new_preroll)      (GstAppSink *appsink);
92   GstFlowReturn (*new_sample)       (GstAppSink *appsink);
93
94   /* actions */
95   GstSample *   (*pull_preroll)      (GstAppSink *appsink);
96   GstSample *   (*pull_sample)       (GstAppSink *appsink);
97
98   /*< private >*/
99   gpointer     _gst_reserved[GST_PADDING];
100 };
101
102 GType gst_app_sink_get_type(void);
103
104 void            gst_app_sink_set_caps         (GstAppSink *appsink, const GstCaps *caps);
105 GstCaps *       gst_app_sink_get_caps         (GstAppSink *appsink);
106
107 gboolean        gst_app_sink_is_eos           (GstAppSink *appsink);
108
109 void            gst_app_sink_set_emit_signals (GstAppSink *appsink, gboolean emit);
110 gboolean        gst_app_sink_get_emit_signals (GstAppSink *appsink);
111
112 void            gst_app_sink_set_max_buffers  (GstAppSink *appsink, guint max);
113 guint           gst_app_sink_get_max_buffers  (GstAppSink *appsink);
114
115 void            gst_app_sink_set_drop         (GstAppSink *appsink, gboolean drop);
116 gboolean        gst_app_sink_get_drop         (GstAppSink *appsink);
117
118 GstSample *     gst_app_sink_pull_preroll     (GstAppSink *appsink);
119 GstSample *     gst_app_sink_pull_sample      (GstAppSink *appsink);
120
121 void            gst_app_sink_set_callbacks    (GstAppSink * appsink,
122                                                GstAppSinkCallbacks *callbacks,
123                                                gpointer user_data,
124                                                GDestroyNotify notify);
125
126 G_END_DECLS
127
128 #endif
129