gst-libs/gst/app/gstappsink.*: Add more docs.
[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., 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   gboolean emit_signals;
49   guint max_buffers;
50
51   GCond *cond;
52   GMutex *mutex;
53   GQueue *queue;
54   GstBuffer *preroll;
55   gboolean started;
56   gboolean is_eos;
57 };
58
59 struct _GstAppSinkClass
60 {
61   GstBaseSinkClass basesink_class;
62
63   /* signals */
64   gboolean    (*eos)          (GstAppSink *sink);
65   gboolean    (*new_preroll)  (GstAppSink *sink);
66   gboolean    (*new_buffer)   (GstAppSink *sink);
67
68   /* actions */
69   GstBuffer * (*pull_preroll)  (GstAppSink *sink);
70   GstBuffer * (*pull_buffer)   (GstAppSink *sink);
71 };
72
73 GType gst_app_sink_get_type(void);
74
75 GST_DEBUG_CATEGORY_EXTERN (app_sink_debug);
76
77 void            gst_app_sink_set_caps         (GstAppSink *appsink, const GstCaps *caps);
78 GstCaps *       gst_app_sink_get_caps         (GstAppSink *appsink);
79
80 gboolean        gst_app_sink_is_eos           (GstAppSink *appsink);
81
82 void            gst_app_sink_set_emit_signals (GstAppSink *appsink, gboolean emit);
83 gboolean        gst_app_sink_get_emit_signals (GstAppSink *appsink);
84
85 void            gst_app_sink_set_max_buffers  (GstAppSink *appsink, guint max);
86 guint           gst_app_sink_get_max_buffers  (GstAppSink *appsink);
87
88 GstBuffer *     gst_app_sink_pull_preroll     (GstAppSink *appsink);
89 GstBuffer *     gst_app_sink_pull_buffer      (GstAppSink *appsink);
90
91 G_END_DECLS
92
93 #endif
94