Update to 2.0.0 tree from current Fremantle build
[opencv] / src / highgui / 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
39 typedef struct _GstAppSink GstAppSink;
40 typedef struct _GstAppSinkClass GstAppSinkClass;
41
42 struct _GstAppSink
43 {
44   GstBaseSink basesink;
45
46   /*< private >*/
47   GstCaps *caps;
48
49   GCond *cond;
50   GMutex *mutex;
51   GQueue *queue;
52   GstBuffer *preroll;
53   gboolean started;
54   gboolean is_eos;
55 };
56
57 struct _GstAppSinkClass
58 {
59   GstBaseSinkClass basesink_class;
60
61   /* signals */
62   gboolean    (*eos)          (GstAppSink *sink);
63   gboolean    (*new_preroll)  (GstAppSink *sink);
64   gboolean    (*new_buffer)   (GstAppSink *sink);
65
66   /* actions */
67   GstBuffer * (*pull_preroll)  (GstAppSink *sink);
68   GstBuffer * (*pull_buffer)   (GstAppSink *sink);
69 };
70
71 GType gst_app_sink_get_type(void);
72
73 GST_DEBUG_CATEGORY_EXTERN (app_sink_debug);
74
75 void            gst_app_sink_set_caps       (GstAppSink *appsink, const GstCaps *caps);
76 GstCaps *       gst_app_sink_get_caps       (GstAppSink *appsink);
77
78 gboolean        gst_app_sink_is_eos         (GstAppSink *appsink);
79
80 GstBuffer *     gst_app_sink_pull_preroll   (GstAppSink *appsink);
81 GstBuffer *     gst_app_sink_pull_buffer    (GstAppSink *appsink);
82 GstBuffer *     gst_app_sink_peek_buffer    (GstAppSink *appsink);
83
84 guint           gst_app_sink_get_queue_length (GstAppSink *appsink);
85
86 G_END_DECLS
87
88 #endif
89