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 Street, 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#ifdef __cplusplus
27extern "C" {
28#endif
29
30G_BEGIN_DECLS
31
32#define GST_TYPE_APP_SINK \
33 (gst_app_sink_get_type())
34#define GST_APP_SINK(obj) \
35 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_APP_SINK,GstAppSink))
36#define GST_APP_SINK_CLASS(klass) \
37 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_APP_SINK,GstAppSinkClass))
38#define GST_IS_APP_SINK(obj) \
39 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_APP_SINK))
40#define GST_IS_APP_SINK_CLASS(klass) \
41 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_APP_SINK))
42
43typedef struct _GstAppSink GstAppSink;
45
47{
48 GstBaseSink basesink;
49
50 /*< private >*/
51 GstCaps *caps;
52
53 GCond *cond;
54 GMutex *mutex;
55 GQueue *queue;
56 GstBuffer *preroll;
57 gboolean started;
58 gboolean is_eos;
59};
60
62{
63 GstBaseSinkClass basesink_class;
64
65 /* signals */
66 gboolean (*eos) (GstAppSink *sink);
67 gboolean (*new_preroll) (GstAppSink *sink);
68 gboolean (*new_buffer) (GstAppSink *sink);
69
70 /* actions */
71 GstBuffer * (*pull_preroll) (GstAppSink *sink);
72 GstBuffer * (*pull_buffer) (GstAppSink *sink);
73};
74
75GType gst_app_sink_get_type(void);
76
77GST_DEBUG_CATEGORY_EXTERN (app_sink_debug);
78
79void gst_app_sink_set_caps (GstAppSink *appsink, const GstCaps *caps);
80GstCaps * gst_app_sink_get_caps (GstAppSink *appsink);
81
82gboolean gst_app_sink_is_eos (GstAppSink *appsink);
83
84GstBuffer * gst_app_sink_pull_preroll (GstAppSink *appsink);
85GstBuffer * gst_app_sink_pull_buffer (GstAppSink *appsink);
86GstBuffer * gst_app_sink_peek_buffer (GstAppSink *appsink);
87
88guint gst_app_sink_get_queue_length (GstAppSink *appsink);
89
90gboolean appsink_plugin_init (GstPlugin * plugin);
91
92G_END_DECLS
93
94#ifdef __cplusplus
95}
96#endif
97
98#endif
99
Definition gstappsink.h:62
Definition gstappsink.h:47