00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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
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
00066 gboolean (*eos) (GstAppSink *sink);
00067 gboolean (*new_preroll) (GstAppSink *sink);
00068 gboolean (*new_buffer) (GstAppSink *sink);
00069
00070
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