2007-03-11 00:48:26 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 2007 David Schleef <ds@schleef.org>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
2012-11-03 23:05:09 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2007-03-11 00:48:26 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _GST_APP_SINK_H_
|
|
|
|
#define _GST_APP_SINK_H_
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
|
|
|
#include <gst/base/gstbasesink.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
#define GST_TYPE_APP_SINK \
|
|
|
|
(gst_app_sink_get_type())
|
|
|
|
#define GST_APP_SINK(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_APP_SINK,GstAppSink))
|
|
|
|
#define GST_APP_SINK_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_APP_SINK,GstAppSinkClass))
|
|
|
|
#define GST_IS_APP_SINK(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_APP_SINK))
|
|
|
|
#define GST_IS_APP_SINK_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_APP_SINK))
|
2009-04-16 10:12:44 +00:00
|
|
|
#define GST_APP_SINK_CAST(obj) \
|
|
|
|
((GstAppSink*)(obj))
|
2007-03-11 00:48:26 +00:00
|
|
|
|
|
|
|
typedef struct _GstAppSink GstAppSink;
|
|
|
|
typedef struct _GstAppSinkClass GstAppSinkClass;
|
gst-libs/gst/app/: Move private data into a private instance struct. Add padding to instance and class structures exp...
Original commit message from CVS:
* gst-libs/gst/app/gstappsink.c: (_GstAppSinkPrivate),
(gst_app_sink_class_init), (gst_app_sink_init),
(gst_app_sink_dispose), (gst_app_sink_finalize),
(gst_app_sink_unlock_start), (gst_app_sink_unlock_stop),
(gst_app_sink_flush_unlocked), (gst_app_sink_start),
(gst_app_sink_stop), (gst_app_sink_event), (gst_app_sink_preroll),
(gst_app_sink_render), (gst_app_sink_getcaps),
(gst_app_sink_set_caps), (gst_app_sink_get_caps),
(gst_app_sink_is_eos), (gst_app_sink_set_emit_signals),
(gst_app_sink_get_emit_signals), (gst_app_sink_set_max_buffers),
(gst_app_sink_get_max_buffers), (gst_app_sink_set_drop),
(gst_app_sink_get_drop), (gst_app_sink_pull_preroll),
(gst_app_sink_pull_buffer)::
* gst-libs/gst/app/gstappsink.h: (GstAppSinkPrivate), (_GstAppSink)::
* gst-libs/gst/app/gstappsrc.c: (_GstAppSrcPrivate),
(gst_app_src_class_init), (gst_app_src_init),
(gst_app_src_flush_queued), (gst_app_src_dispose),
(gst_app_src_finalize), (gst_app_src_set_property),
(gst_app_src_get_property), (gst_app_src_unlock),
(gst_app_src_unlock_stop), (gst_app_src_start), (gst_app_src_stop),
(gst_app_src_is_seekable), (gst_app_src_check_get_range),
(gst_app_src_query), (gst_app_src_do_seek), (gst_app_src_create),
(gst_app_src_set_caps), (gst_app_src_get_caps),
(gst_app_src_set_size), (gst_app_src_get_size),
(gst_app_src_set_stream_type), (gst_app_src_get_stream_type),
(gst_app_src_set_max_bytes), (gst_app_src_get_max_bytes),
(gst_app_src_set_latencies), (gst_app_src_set_latency),
(gst_app_src_get_latency), (gst_app_src_push_buffer_full),
(gst_app_src_push_buffer_action), (gst_app_src_end_of_stream)::
* gst-libs/gst/app/gstappsrc.h: (GstAppSrcPrivate)::
Move private data into a private instance struct. Add padding to
instance and class structures exposed in public headers. Add
Since markers to the gtk-doc blurbs (#566750).
2009-01-06 10:56:45 +00:00
|
|
|
typedef struct _GstAppSinkPrivate GstAppSinkPrivate;
|
2007-03-11 00:48:26 +00:00
|
|
|
|
2014-09-15 21:41:55 +00:00
|
|
|
/* FIXME 2.0: Make the instance/class struct private */
|
|
|
|
|
2009-02-19 09:44:31 +00:00
|
|
|
/**
|
2012-06-29 22:46:46 +00:00
|
|
|
* GstAppSinkCallbacks: (skip)
|
2009-04-09 21:46:17 +00:00
|
|
|
* @eos: Called when the end-of-stream has been reached. This callback
|
2015-09-18 15:48:49 +00:00
|
|
|
* is called from the streaming thread.
|
2011-12-01 15:48:49 +00:00
|
|
|
* @new_preroll: Called when a new preroll sample is available.
|
2015-09-18 15:48:49 +00:00
|
|
|
* This callback is called from the streaming thread.
|
2011-12-01 15:48:49 +00:00
|
|
|
* The new preroll sample can be retrieved with
|
2009-02-19 09:44:31 +00:00
|
|
|
* gst_app_sink_pull_preroll() either from this callback
|
|
|
|
* or from any other thread.
|
2011-12-01 15:48:49 +00:00
|
|
|
* @new_sample: Called when a new sample is available.
|
2015-09-18 15:48:49 +00:00
|
|
|
* This callback is called from the streaming thread.
|
2011-12-01 15:48:49 +00:00
|
|
|
* The new sample can be retrieved with
|
|
|
|
* gst_app_sink_pull_sample() either from this callback
|
2009-06-29 10:14:43 +00:00
|
|
|
* or from any other thread.
|
2009-02-19 09:44:31 +00:00
|
|
|
*
|
|
|
|
* A set of callbacks that can be installed on the appsink with
|
|
|
|
* gst_app_sink_set_callbacks().
|
|
|
|
*/
|
|
|
|
typedef struct {
|
2012-06-29 22:52:23 +00:00
|
|
|
void (*eos) (GstAppSink *appsink, gpointer user_data);
|
|
|
|
GstFlowReturn (*new_preroll) (GstAppSink *appsink, gpointer user_data);
|
|
|
|
GstFlowReturn (*new_sample) (GstAppSink *appsink, gpointer user_data);
|
2009-02-26 10:42:44 +00:00
|
|
|
|
|
|
|
/*< private >*/
|
2011-11-10 12:45:39 +00:00
|
|
|
gpointer _gst_reserved[GST_PADDING];
|
2009-02-19 09:44:31 +00:00
|
|
|
} GstAppSinkCallbacks;
|
|
|
|
|
2007-03-11 00:48:26 +00:00
|
|
|
struct _GstAppSink
|
|
|
|
{
|
|
|
|
GstBaseSink basesink;
|
|
|
|
|
|
|
|
/*< private >*/
|
gst-libs/gst/app/: Move private data into a private instance struct. Add padding to instance and class structures exp...
Original commit message from CVS:
* gst-libs/gst/app/gstappsink.c: (_GstAppSinkPrivate),
(gst_app_sink_class_init), (gst_app_sink_init),
(gst_app_sink_dispose), (gst_app_sink_finalize),
(gst_app_sink_unlock_start), (gst_app_sink_unlock_stop),
(gst_app_sink_flush_unlocked), (gst_app_sink_start),
(gst_app_sink_stop), (gst_app_sink_event), (gst_app_sink_preroll),
(gst_app_sink_render), (gst_app_sink_getcaps),
(gst_app_sink_set_caps), (gst_app_sink_get_caps),
(gst_app_sink_is_eos), (gst_app_sink_set_emit_signals),
(gst_app_sink_get_emit_signals), (gst_app_sink_set_max_buffers),
(gst_app_sink_get_max_buffers), (gst_app_sink_set_drop),
(gst_app_sink_get_drop), (gst_app_sink_pull_preroll),
(gst_app_sink_pull_buffer)::
* gst-libs/gst/app/gstappsink.h: (GstAppSinkPrivate), (_GstAppSink)::
* gst-libs/gst/app/gstappsrc.c: (_GstAppSrcPrivate),
(gst_app_src_class_init), (gst_app_src_init),
(gst_app_src_flush_queued), (gst_app_src_dispose),
(gst_app_src_finalize), (gst_app_src_set_property),
(gst_app_src_get_property), (gst_app_src_unlock),
(gst_app_src_unlock_stop), (gst_app_src_start), (gst_app_src_stop),
(gst_app_src_is_seekable), (gst_app_src_check_get_range),
(gst_app_src_query), (gst_app_src_do_seek), (gst_app_src_create),
(gst_app_src_set_caps), (gst_app_src_get_caps),
(gst_app_src_set_size), (gst_app_src_get_size),
(gst_app_src_set_stream_type), (gst_app_src_get_stream_type),
(gst_app_src_set_max_bytes), (gst_app_src_get_max_bytes),
(gst_app_src_set_latencies), (gst_app_src_set_latency),
(gst_app_src_get_latency), (gst_app_src_push_buffer_full),
(gst_app_src_push_buffer_action), (gst_app_src_end_of_stream)::
* gst-libs/gst/app/gstappsrc.h: (GstAppSrcPrivate)::
Move private data into a private instance struct. Add padding to
instance and class structures exposed in public headers. Add
Since markers to the gtk-doc blurbs (#566750).
2009-01-06 10:56:45 +00:00
|
|
|
GstAppSinkPrivate *priv;
|
|
|
|
|
|
|
|
/*< private >*/
|
|
|
|
gpointer _gst_reserved[GST_PADDING];
|
2007-03-11 00:48:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GstAppSinkClass
|
|
|
|
{
|
|
|
|
GstBaseSinkClass basesink_class;
|
gst-libs/gst/app/gstappsink.*: Add properties, signals and actions to access the element even without linking to the ...
Original commit message from CVS:
* gst-libs/gst/app/gstappsink.c: (gst_app_marshal_OBJECT__VOID),
(gst_app_sink_class_init), (gst_app_sink_init),
(gst_app_sink_dispose), (gst_app_sink_finalize),
(gst_app_sink_set_property), (gst_app_sink_get_property),
(gst_app_sink_flush_unlocked), (gst_app_sink_start),
(gst_app_sink_event), (gst_app_sink_getcaps),
(gst_app_sink_set_caps), (gst_app_sink_get_caps),
(gst_app_sink_is_eos), (gst_app_sink_pull_preroll),
(gst_app_sink_pull_buffer):
* gst-libs/gst/app/gstappsink.h:
Add properties, signals and actions to access the element even without
linking to the library.
Fix some method names and signatures.
2007-09-20 13:59:50 +00:00
|
|
|
|
|
|
|
/* signals */
|
2012-09-14 11:31:36 +00:00
|
|
|
void (*eos) (GstAppSink *appsink);
|
|
|
|
GstFlowReturn (*new_preroll) (GstAppSink *appsink);
|
|
|
|
GstFlowReturn (*new_sample) (GstAppSink *appsink);
|
gst-libs/gst/app/gstappsink.*: Add properties, signals and actions to access the element even without linking to the ...
Original commit message from CVS:
* gst-libs/gst/app/gstappsink.c: (gst_app_marshal_OBJECT__VOID),
(gst_app_sink_class_init), (gst_app_sink_init),
(gst_app_sink_dispose), (gst_app_sink_finalize),
(gst_app_sink_set_property), (gst_app_sink_get_property),
(gst_app_sink_flush_unlocked), (gst_app_sink_start),
(gst_app_sink_event), (gst_app_sink_getcaps),
(gst_app_sink_set_caps), (gst_app_sink_get_caps),
(gst_app_sink_is_eos), (gst_app_sink_pull_preroll),
(gst_app_sink_pull_buffer):
* gst-libs/gst/app/gstappsink.h:
Add properties, signals and actions to access the element even without
linking to the library.
Fix some method names and signatures.
2007-09-20 13:59:50 +00:00
|
|
|
|
|
|
|
/* actions */
|
2012-09-14 11:31:36 +00:00
|
|
|
GstSample * (*pull_preroll) (GstAppSink *appsink);
|
|
|
|
GstSample * (*pull_sample) (GstAppSink *appsink);
|
2016-07-15 11:20:29 +00:00
|
|
|
GstSample * (*try_pull_preroll) (GstAppSink *appsink, GstClockTime timeout);
|
|
|
|
GstSample * (*try_pull_sample) (GstAppSink *appsink, GstClockTime timeout);
|
gst-libs/gst/app/: Move private data into a private instance struct. Add padding to instance and class structures exp...
Original commit message from CVS:
* gst-libs/gst/app/gstappsink.c: (_GstAppSinkPrivate),
(gst_app_sink_class_init), (gst_app_sink_init),
(gst_app_sink_dispose), (gst_app_sink_finalize),
(gst_app_sink_unlock_start), (gst_app_sink_unlock_stop),
(gst_app_sink_flush_unlocked), (gst_app_sink_start),
(gst_app_sink_stop), (gst_app_sink_event), (gst_app_sink_preroll),
(gst_app_sink_render), (gst_app_sink_getcaps),
(gst_app_sink_set_caps), (gst_app_sink_get_caps),
(gst_app_sink_is_eos), (gst_app_sink_set_emit_signals),
(gst_app_sink_get_emit_signals), (gst_app_sink_set_max_buffers),
(gst_app_sink_get_max_buffers), (gst_app_sink_set_drop),
(gst_app_sink_get_drop), (gst_app_sink_pull_preroll),
(gst_app_sink_pull_buffer)::
* gst-libs/gst/app/gstappsink.h: (GstAppSinkPrivate), (_GstAppSink)::
* gst-libs/gst/app/gstappsrc.c: (_GstAppSrcPrivate),
(gst_app_src_class_init), (gst_app_src_init),
(gst_app_src_flush_queued), (gst_app_src_dispose),
(gst_app_src_finalize), (gst_app_src_set_property),
(gst_app_src_get_property), (gst_app_src_unlock),
(gst_app_src_unlock_stop), (gst_app_src_start), (gst_app_src_stop),
(gst_app_src_is_seekable), (gst_app_src_check_get_range),
(gst_app_src_query), (gst_app_src_do_seek), (gst_app_src_create),
(gst_app_src_set_caps), (gst_app_src_get_caps),
(gst_app_src_set_size), (gst_app_src_get_size),
(gst_app_src_set_stream_type), (gst_app_src_get_stream_type),
(gst_app_src_set_max_bytes), (gst_app_src_get_max_bytes),
(gst_app_src_set_latencies), (gst_app_src_set_latency),
(gst_app_src_get_latency), (gst_app_src_push_buffer_full),
(gst_app_src_push_buffer_action), (gst_app_src_end_of_stream)::
* gst-libs/gst/app/gstappsrc.h: (GstAppSrcPrivate)::
Move private data into a private instance struct. Add padding to
instance and class structures exposed in public headers. Add
Since markers to the gtk-doc blurbs (#566750).
2009-01-06 10:56:45 +00:00
|
|
|
|
|
|
|
/*< private >*/
|
2016-07-15 11:20:29 +00:00
|
|
|
gpointer _gst_reserved[GST_PADDING - 2];
|
2007-03-11 00:48:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
GType gst_app_sink_get_type(void);
|
|
|
|
|
gst-libs/gst/app/gstappsink.*: Add more docs.
Original commit message from CVS:
* gst-libs/gst/app/gstappsink.c: (gst_app_sink_class_init),
(gst_app_sink_init), (gst_app_sink_set_property),
(gst_app_sink_get_property), (gst_app_sink_event),
(gst_app_sink_preroll), (gst_app_sink_render),
(gst_app_sink_set_emit_signals), (gst_app_sink_get_emit_signals),
(gst_app_sink_set_max_buffers), (gst_app_sink_get_max_buffers),
(gst_app_sink_pull_buffer):
* gst-libs/gst/app/gstappsink.h:
Add more docs.
Add signals for when preroll and render buffers are available.
Add property to control signal emission.
Add property to control the max queue size.
2008-04-25 18:18:47 +00:00
|
|
|
void gst_app_sink_set_caps (GstAppSink *appsink, const GstCaps *caps);
|
|
|
|
GstCaps * gst_app_sink_get_caps (GstAppSink *appsink);
|
gst-libs/gst/app/gstappsink.*: Make love to appsink.
Original commit message from CVS:
* gst-libs/gst/app/gstappsink.c: (gst_app_sink_base_init),
(gst_app_sink_class_init), (gst_app_sink_dispose),
(gst_app_sink_flush_unlocked), (gst_app_sink_start),
(gst_app_sink_stop), (gst_app_sink_event), (gst_app_sink_preroll),
(gst_app_sink_render), (gst_app_sink_get_caps),
(gst_app_sink_set_caps), (gst_app_sink_end_of_stream),
(gst_app_sink_pull_preroll), (gst_app_sink_pull_buffer):
* gst-libs/gst/app/gstappsink.h:
Make love to appsink.
Make it support pulling of the preroll buffer.
Add docs and debug statements.
Fix some races wrt to EOS handling and stopping.
Implement getcaps.
Implement FLUSHING.
API: gst_app_sink_pull_preroll()
2007-08-14 17:38:05 +00:00
|
|
|
|
gst-libs/gst/app/gstappsink.*: Add more docs.
Original commit message from CVS:
* gst-libs/gst/app/gstappsink.c: (gst_app_sink_class_init),
(gst_app_sink_init), (gst_app_sink_set_property),
(gst_app_sink_get_property), (gst_app_sink_event),
(gst_app_sink_preroll), (gst_app_sink_render),
(gst_app_sink_set_emit_signals), (gst_app_sink_get_emit_signals),
(gst_app_sink_set_max_buffers), (gst_app_sink_get_max_buffers),
(gst_app_sink_pull_buffer):
* gst-libs/gst/app/gstappsink.h:
Add more docs.
Add signals for when preroll and render buffers are available.
Add property to control signal emission.
Add property to control the max queue size.
2008-04-25 18:18:47 +00:00
|
|
|
gboolean gst_app_sink_is_eos (GstAppSink *appsink);
|
gst-libs/gst/app/gstappsink.*: Make love to appsink.
Original commit message from CVS:
* gst-libs/gst/app/gstappsink.c: (gst_app_sink_base_init),
(gst_app_sink_class_init), (gst_app_sink_dispose),
(gst_app_sink_flush_unlocked), (gst_app_sink_start),
(gst_app_sink_stop), (gst_app_sink_event), (gst_app_sink_preroll),
(gst_app_sink_render), (gst_app_sink_get_caps),
(gst_app_sink_set_caps), (gst_app_sink_end_of_stream),
(gst_app_sink_pull_preroll), (gst_app_sink_pull_buffer):
* gst-libs/gst/app/gstappsink.h:
Make love to appsink.
Make it support pulling of the preroll buffer.
Add docs and debug statements.
Fix some races wrt to EOS handling and stopping.
Implement getcaps.
Implement FLUSHING.
API: gst_app_sink_pull_preroll()
2007-08-14 17:38:05 +00:00
|
|
|
|
gst-libs/gst/app/gstappsink.*: Add more docs.
Original commit message from CVS:
* gst-libs/gst/app/gstappsink.c: (gst_app_sink_class_init),
(gst_app_sink_init), (gst_app_sink_set_property),
(gst_app_sink_get_property), (gst_app_sink_event),
(gst_app_sink_preroll), (gst_app_sink_render),
(gst_app_sink_set_emit_signals), (gst_app_sink_get_emit_signals),
(gst_app_sink_set_max_buffers), (gst_app_sink_get_max_buffers),
(gst_app_sink_pull_buffer):
* gst-libs/gst/app/gstappsink.h:
Add more docs.
Add signals for when preroll and render buffers are available.
Add property to control signal emission.
Add property to control the max queue size.
2008-04-25 18:18:47 +00:00
|
|
|
void gst_app_sink_set_emit_signals (GstAppSink *appsink, gboolean emit);
|
|
|
|
gboolean gst_app_sink_get_emit_signals (GstAppSink *appsink);
|
|
|
|
|
|
|
|
void gst_app_sink_set_max_buffers (GstAppSink *appsink, guint max);
|
|
|
|
guint gst_app_sink_get_max_buffers (GstAppSink *appsink);
|
|
|
|
|
gst-libs/gst/app/gstappsink.*: Start some docs.
Original commit message from CVS:
* gst-libs/gst/app/gstappsink.c: (gst_app_sink_class_init),
(gst_app_sink_init), (gst_app_sink_set_property),
(gst_app_sink_get_property), (gst_app_sink_unlock_start),
(gst_app_sink_unlock_stop), (gst_app_sink_flush_unlocked),
(gst_app_sink_start), (gst_app_sink_stop), (gst_app_sink_event),
(gst_app_sink_preroll), (gst_app_sink_render),
(gst_app_sink_set_caps), (gst_app_sink_set_drop),
(gst_app_sink_get_drop):
* gst-libs/gst/app/gstappsink.h:
Start some docs.
Add property to drop buffers when the queue is filled
Fix unlocking and flushing when the queues are filled.
2008-05-05 10:27:45 +00:00
|
|
|
void gst_app_sink_set_drop (GstAppSink *appsink, gboolean drop);
|
|
|
|
gboolean gst_app_sink_get_drop (GstAppSink *appsink);
|
|
|
|
|
2015-10-15 14:38:16 +00:00
|
|
|
void gst_app_sink_set_wait_on_eos (GstAppSink *appsink, gboolean wait);
|
|
|
|
gboolean gst_app_sink_get_wait_on_eos (GstAppSink *appsink);
|
|
|
|
|
2011-12-01 15:48:49 +00:00
|
|
|
GstSample * gst_app_sink_pull_preroll (GstAppSink *appsink);
|
|
|
|
GstSample * gst_app_sink_pull_sample (GstAppSink *appsink);
|
2016-07-15 11:20:29 +00:00
|
|
|
GstSample * gst_app_sink_try_pull_preroll (GstAppSink *appsink, GstClockTime timeout);
|
|
|
|
GstSample * gst_app_sink_try_pull_sample (GstAppSink *appsink, GstClockTime timeout);
|
2007-03-11 00:48:26 +00:00
|
|
|
|
2009-02-19 09:44:31 +00:00
|
|
|
void gst_app_sink_set_callbacks (GstAppSink * appsink,
|
|
|
|
GstAppSinkCallbacks *callbacks,
|
2011-11-11 16:52:36 +00:00
|
|
|
gpointer user_data,
|
|
|
|
GDestroyNotify notify);
|
2009-02-19 09:44:31 +00:00
|
|
|
|
2015-11-10 17:54:23 +00:00
|
|
|
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
|
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstAppSink, gst_object_unref)
|
|
|
|
#endif
|
|
|
|
|
2007-03-11 00:48:26 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|