gstappsink.h
00001 /* GStreamer 00002 * Copyright (C) 2007 David Schleef <ds@schleef.org> 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Library General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 2 of the License, or (at your option) any later version. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public 00015 * License along with this library; if not, write to the 00016 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00017 * Boston, MA 02111-1307, USA. 00018 */ 00019 00020 #ifndef _GST_APP_SINK_H_ 00021 #define _GST_APP_SINK_H_ 00022 00023 #include <gst/gst.h> 00024 #include <gst/base/gstbasesink.h> 00025 00026 #ifdef __cplusplus 00027 extern "C" { 00028 #endif 00029 00030 G_BEGIN_DECLS 00031 00032 #define GST_TYPE_APP_SINK \ 00033 (gst_app_sink_get_type()) 00034 #define GST_APP_SINK(obj) \ 00035 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_APP_SINK,GstAppSink)) 00036 #define GST_APP_SINK_CLASS(klass) \ 00037 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_APP_SINK,GstAppSinkClass)) 00038 #define GST_IS_APP_SINK(obj) \ 00039 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_APP_SINK)) 00040 #define GST_IS_APP_SINK_CLASS(klass) \ 00041 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_APP_SINK)) 00042 00043 typedef struct _GstAppSink GstAppSink; 00044 typedef struct _GstAppSinkClass GstAppSinkClass; 00045 00046 struct _GstAppSink 00047 { 00048 GstBaseSink basesink; 00049 00050 /*< private >*/ 00051 GstCaps *caps; 00052 00053 GCond *cond; 00054 GMutex *mutex; 00055 GQueue *queue; 00056 GstBuffer *preroll; 00057 gboolean started; 00058 gboolean is_eos; 00059 }; 00060 00061 struct _GstAppSinkClass 00062 { 00063 GstBaseSinkClass basesink_class; 00064 00065 /* signals */ 00066 gboolean (*eos) (GstAppSink *sink); 00067 gboolean (*new_preroll) (GstAppSink *sink); 00068 gboolean (*new_buffer) (GstAppSink *sink); 00069 00070 /* actions */ 00071 GstBuffer * (*pull_preroll) (GstAppSink *sink); 00072 GstBuffer * (*pull_buffer) (GstAppSink *sink); 00073 }; 00074 00075 GType gst_app_sink_get_type(void); 00076 00077 GST_DEBUG_CATEGORY_EXTERN (app_sink_debug); 00078 00079 void gst_app_sink_set_caps (GstAppSink *appsink, const GstCaps *caps); 00080 GstCaps * gst_app_sink_get_caps (GstAppSink *appsink); 00081 00082 gboolean gst_app_sink_is_eos (GstAppSink *appsink); 00083 00084 GstBuffer * gst_app_sink_pull_preroll (GstAppSink *appsink); 00085 GstBuffer * gst_app_sink_pull_buffer (GstAppSink *appsink); 00086 GstBuffer * gst_app_sink_peek_buffer (GstAppSink *appsink); 00087 00088 guint gst_app_sink_get_queue_length (GstAppSink *appsink); 00089 00090 gboolean appsink_plugin_init (GstPlugin * plugin); 00091 00092 G_END_DECLS 00093 00094 #ifdef __cplusplus 00095 } 00096 #endif 00097 00098 #endif 00099