Macro qtTrIdx() replaced by tr() and QT_TRANSLATE_NOOP()
[mafwsubrenderer] / gst-plugins-base-subtitles0.10 / 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., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, 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 /* Since 0.10.23 */
39 #define GST_APP_SINK_CAST(obj) \
40   ((GstAppSink*)(obj))
41
42 typedef struct _GstAppSink GstAppSink;
43 typedef struct _GstAppSinkClass GstAppSinkClass;
44 typedef struct _GstAppSinkPrivate GstAppSinkPrivate;
45
46 /**
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 buffer is available. 
51  *       This callback is called from the steaming thread.
52  *       The new preroll buffer can be retrieved with
53  *       gst_app_sink_pull_preroll() either from this callback
54  *       or from any other thread.
55  * @new_buffer: Called when a new buffer is available. 
56  *       This callback is called from the steaming thread.
57  *       The new buffer can be retrieved with
58  *       gst_app_sink_pull_buffer() either from this callback
59  *       or from any other thread.
60  * @new_buffer_list: Called when a new bufferlist is available. 
61  *       This callback is called from the steaming thread.
62  *       The new bufferlist can be retrieved with
63  *       gst_app_sink_pull_buffer_list() either from this callback
64  *       or from any other thread.
65  *
66  * A set of callbacks that can be installed on the appsink with
67  * gst_app_sink_set_callbacks().
68  *
69  * Since: 0.10.23
70  */
71 typedef struct {
72   void          (*eos)              (GstAppSink *sink, gpointer user_data);
73   GstFlowReturn (*new_preroll)      (GstAppSink *sink, gpointer user_data);
74   GstFlowReturn (*new_buffer)       (GstAppSink *sink, gpointer user_data);
75   GstFlowReturn (*new_buffer_list)  (GstAppSink *sink, gpointer user_data);
76
77   /*< private >*/
78   gpointer     _gst_reserved[GST_PADDING - 1];
79 } GstAppSinkCallbacks;
80
81 struct _GstAppSink
82 {
83   GstBaseSink basesink;
84
85   /*< private >*/
86   GstAppSinkPrivate *priv;
87
88   /*< private >*/
89   gpointer     _gst_reserved[GST_PADDING];
90 };
91
92 struct _GstAppSinkClass
93 {
94   GstBaseSinkClass basesink_class;
95
96   /* signals */
97   void        (*eos)          (GstAppSink *sink);
98   void        (*new_preroll)  (GstAppSink *sink);
99   void        (*new_buffer)   (GstAppSink *sink);
100
101   /* actions */
102   GstBuffer     * (*pull_preroll)      (GstAppSink *sink);
103   GstBuffer     * (*pull_buffer)       (GstAppSink *sink);
104
105   /* ABI added */
106   GstBufferList * (*new_buffer_list)   (GstAppSink *sink);
107   GstBufferList * (*pull_buffer_list)  (GstAppSink *sink);
108
109   /*< private >*/
110   gpointer     _gst_reserved[GST_PADDING - 2];
111 };
112
113 GType gst_app_sink_get_type(void);
114
115 void            gst_app_sink_set_caps         (GstAppSink *appsink, const GstCaps *caps);
116 GstCaps *       gst_app_sink_get_caps         (GstAppSink *appsink);
117
118 gboolean        gst_app_sink_is_eos           (GstAppSink *appsink);
119
120 void            gst_app_sink_set_emit_signals (GstAppSink *appsink, gboolean emit);
121 gboolean        gst_app_sink_get_emit_signals (GstAppSink *appsink);
122
123 void            gst_app_sink_set_max_buffers  (GstAppSink *appsink, guint max);
124 guint           gst_app_sink_get_max_buffers  (GstAppSink *appsink);
125
126 void            gst_app_sink_set_drop         (GstAppSink *appsink, gboolean drop);
127 gboolean        gst_app_sink_get_drop         (GstAppSink *appsink);
128
129 GstBuffer *     gst_app_sink_pull_preroll     (GstAppSink *appsink);
130 GstBuffer *     gst_app_sink_pull_buffer      (GstAppSink *appsink);
131 GstBufferList * gst_app_sink_pull_buffer_list (GstAppSink *appsink);
132
133 void            gst_app_sink_set_callbacks    (GstAppSink * appsink,
134                                                GstAppSinkCallbacks *callbacks,
135                                                gpointer user_data,
136                                                GDestroyNotify notify);
137
138 G_END_DECLS
139
140 #endif
141