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
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
|
|
|
#include <gst/base/gstbasesink.h>
|
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
|
|
|
#include <gst/gstbuffer.h>
|
2007-03-11 00:48:26 +00:00
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include "gstappsink.h"
|
|
|
|
|
|
|
|
|
|
|
|
GST_DEBUG_CATEGORY (app_sink_debug);
|
|
|
|
#define GST_CAT_DEFAULT app_sink_debug
|
|
|
|
|
|
|
|
static const GstElementDetails app_sink_details =
|
|
|
|
GST_ELEMENT_DETAILS ("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
|
|
|
"Generic/Sink",
|
|
|
|
"Allow the application to get access to raw buffer",
|
|
|
|
"David Schleef <ds@schleef.org>, Wim Taymans <wim.taymans@gmail.com");
|
2007-03-11 00:48:26 +00:00
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
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 */
|
|
|
|
SIGNAL_EOS,
|
|
|
|
SIGNAL_NEW_PREROLL,
|
|
|
|
SIGNAL_NEW_BUFFER,
|
|
|
|
|
|
|
|
/* acions */
|
|
|
|
SIGNAL_PULL_PREROLL,
|
|
|
|
SIGNAL_PULL_BUFFER,
|
|
|
|
|
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
PROP_0,
|
|
|
|
PROP_CAPS,
|
|
|
|
PROP_EOS
|
2007-03-11 00:48:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static GstStaticPadTemplate gst_app_sink_template =
|
|
|
|
GST_STATIC_PAD_TEMPLATE ("sink",
|
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS_ANY);
|
|
|
|
|
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
|
|
|
static void gst_app_sink_dispose (GObject * object);
|
|
|
|
static void gst_app_sink_finalize (GObject * object);
|
|
|
|
|
2007-03-11 00:48:26 +00:00
|
|
|
static void gst_app_sink_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec);
|
|
|
|
static void gst_app_sink_get_property (GObject * object, guint prop_id,
|
|
|
|
GValue * value, GParamSpec * pspec);
|
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
|
|
|
|
2007-03-11 00:48:26 +00:00
|
|
|
static gboolean gst_app_sink_start (GstBaseSink * psink);
|
|
|
|
static gboolean gst_app_sink_stop (GstBaseSink * psink);
|
|
|
|
static gboolean gst_app_sink_event (GstBaseSink * sink, GstEvent * event);
|
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
|
|
|
static GstFlowReturn gst_app_sink_preroll (GstBaseSink * psink,
|
|
|
|
GstBuffer * buffer);
|
2007-03-11 00:48:26 +00:00
|
|
|
static GstFlowReturn gst_app_sink_render (GstBaseSink * psink,
|
|
|
|
GstBuffer * buffer);
|
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
|
|
|
static GstCaps *gst_app_sink_getcaps (GstBaseSink * psink);
|
|
|
|
|
|
|
|
static guint gst_app_sink_signals[LAST_SIGNAL] = { 0 };
|
2007-03-11 00:48:26 +00:00
|
|
|
|
|
|
|
GST_BOILERPLATE (GstAppSink, gst_app_sink, GstBaseSink, GST_TYPE_BASE_SINK);
|
|
|
|
|
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
|
|
|
void
|
|
|
|
gst_app_marshal_OBJECT__VOID (GClosure * closure,
|
|
|
|
GValue * return_value,
|
|
|
|
guint n_param_values,
|
|
|
|
const GValue * param_values,
|
|
|
|
gpointer invocation_hint, gpointer marshal_data)
|
|
|
|
{
|
|
|
|
typedef GstBuffer *(*GMarshalFunc_OBJECT__VOID) (gpointer data1,
|
|
|
|
gpointer data2);
|
|
|
|
register GMarshalFunc_OBJECT__VOID callback;
|
|
|
|
register GCClosure *cc = (GCClosure *) closure;
|
|
|
|
register gpointer data1, data2;
|
|
|
|
GstBuffer *v_return;
|
|
|
|
|
|
|
|
g_return_if_fail (return_value != NULL);
|
|
|
|
g_return_if_fail (n_param_values == 1);
|
|
|
|
|
|
|
|
if (G_CCLOSURE_SWAP_DATA (closure)) {
|
|
|
|
data1 = closure->data;
|
|
|
|
data2 = g_value_peek_pointer (param_values + 0);
|
|
|
|
} else {
|
|
|
|
data1 = g_value_peek_pointer (param_values + 0);
|
|
|
|
data2 = closure->data;
|
|
|
|
}
|
|
|
|
callback =
|
|
|
|
(GMarshalFunc_OBJECT__VOID) (marshal_data ? marshal_data : cc->callback);
|
|
|
|
|
|
|
|
v_return = callback (data1, data2);
|
|
|
|
|
|
|
|
gst_value_take_buffer (return_value, v_return);
|
|
|
|
}
|
|
|
|
|
2007-03-11 00:48:26 +00:00
|
|
|
static void
|
|
|
|
gst_app_sink_base_init (gpointer g_class)
|
|
|
|
{
|
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
|
|
|
|
|
|
|
GST_DEBUG_CATEGORY_INIT (app_sink_debug, "appsink", 0, "appsink element");
|
|
|
|
|
|
|
|
gst_element_class_set_details (element_class, &app_sink_details);
|
|
|
|
|
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&gst_app_sink_template));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_app_sink_class_init (GstAppSinkClass * klass)
|
|
|
|
{
|
|
|
|
GObjectClass *gobject_class = (GObjectClass *) klass;
|
|
|
|
GstBaseSinkClass *basesink_class = (GstBaseSinkClass *) klass;
|
|
|
|
|
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
|
|
|
gobject_class->dispose = gst_app_sink_dispose;
|
|
|
|
gobject_class->finalize = gst_app_sink_finalize;
|
|
|
|
|
2007-03-11 00:48:26 +00:00
|
|
|
gobject_class->set_property = gst_app_sink_set_property;
|
|
|
|
gobject_class->get_property = gst_app_sink_get_property;
|
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
|
|
|
|
|
|
|
g_object_class_install_property (gobject_class, PROP_CAPS,
|
|
|
|
g_param_spec_boxed ("caps", "Caps",
|
|
|
|
"The caps of the sink pad", GST_TYPE_CAPS, G_PARAM_READWRITE));
|
|
|
|
|
|
|
|
g_object_class_install_property (gobject_class, PROP_EOS,
|
|
|
|
g_param_spec_boolean ("eos", "EOS",
|
|
|
|
"Check if the sink is EOS", TRUE, G_PARAM_READABLE));
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GstAppSink::eos:
|
|
|
|
* @appsink: the appsink element that emited the signal
|
|
|
|
*
|
|
|
|
* Signal that the end-of-stream has been reached.
|
|
|
|
*/
|
|
|
|
gst_app_sink_signals[SIGNAL_EOS] =
|
|
|
|
g_signal_new ("eos", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (GstAppSinkClass, eos),
|
|
|
|
NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, G_TYPE_NONE);
|
|
|
|
/**
|
|
|
|
* GstAppSink::new-preroll:
|
|
|
|
* @appsink: the appsink element that emited the signal
|
|
|
|
* @buffer: the buffer that caused the preroll
|
|
|
|
*
|
|
|
|
* Signal that a new preroll buffer is available.
|
|
|
|
*/
|
|
|
|
gst_app_sink_signals[SIGNAL_NEW_PREROLL] =
|
|
|
|
g_signal_new ("new-preroll", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (GstAppSinkClass, new_preroll),
|
|
|
|
NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 0,
|
|
|
|
GST_TYPE_BUFFER);
|
|
|
|
/**
|
|
|
|
* GstAppSink::new-buffer:
|
|
|
|
* @appsink: the appsink element that emited the signal
|
|
|
|
* @buffer: the buffer that is available
|
|
|
|
*
|
|
|
|
* Signal that a new buffer is available.
|
|
|
|
*/
|
|
|
|
gst_app_sink_signals[SIGNAL_NEW_BUFFER] =
|
|
|
|
g_signal_new ("new-buffer", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (GstAppSinkClass, new_buffer),
|
|
|
|
NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 0,
|
|
|
|
GST_TYPE_BUFFER);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GstAppSink::pull-preroll:
|
|
|
|
* @appsink: the appsink element to emit this signal on
|
|
|
|
*
|
|
|
|
* Get the last preroll buffer on @appsink.
|
|
|
|
*/
|
|
|
|
gst_app_sink_signals[SIGNAL_PULL_PREROLL] =
|
|
|
|
g_signal_new ("pull-preroll", G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstAppSinkClass, pull_preroll), NULL,
|
|
|
|
NULL, gst_app_marshal_OBJECT__VOID, GST_TYPE_BUFFER, 0, G_TYPE_NONE);
|
|
|
|
/**
|
|
|
|
* GstAppSink::pull-buffer:
|
|
|
|
* @appsink: the appsink element to emit this signal on
|
|
|
|
*
|
|
|
|
* Get the next buffer buffer on @appsink.
|
|
|
|
*/
|
|
|
|
gst_app_sink_signals[SIGNAL_PULL_PREROLL] =
|
|
|
|
g_signal_new ("pull-buffer", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
|
|
|
|
G_STRUCT_OFFSET (GstAppSinkClass, pull_buffer),
|
|
|
|
NULL, NULL, gst_app_marshal_OBJECT__VOID, GST_TYPE_BUFFER, 0,
|
|
|
|
G_TYPE_NONE);
|
2007-03-11 00:48:26 +00:00
|
|
|
|
|
|
|
basesink_class->start = gst_app_sink_start;
|
|
|
|
basesink_class->stop = gst_app_sink_stop;
|
|
|
|
basesink_class->event = gst_app_sink_event;
|
2007-08-16 17:11:48 +00:00
|
|
|
basesink_class->preroll = gst_app_sink_preroll;
|
2007-03-11 00:48:26 +00:00
|
|
|
basesink_class->render = gst_app_sink_render;
|
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
|
|
|
basesink_class->get_caps = gst_app_sink_getcaps;
|
|
|
|
|
|
|
|
klass->pull_preroll = gst_app_sink_pull_preroll;
|
|
|
|
klass->pull_buffer = gst_app_sink_pull_buffer;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_app_sink_init (GstAppSink * appsink, GstAppSinkClass * klass)
|
|
|
|
{
|
|
|
|
appsink->mutex = g_mutex_new ();
|
|
|
|
appsink->cond = g_cond_new ();
|
|
|
|
appsink->queue = g_queue_new ();
|
2007-03-11 00:48:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_app_sink_dispose (GObject * obj)
|
|
|
|
{
|
|
|
|
GstAppSink *appsink = GST_APP_SINK (obj);
|
|
|
|
|
|
|
|
if (appsink->caps) {
|
|
|
|
gst_caps_unref (appsink->caps);
|
|
|
|
appsink->caps = NULL;
|
|
|
|
}
|
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
|
|
|
if (appsink->preroll) {
|
|
|
|
gst_buffer_unref (appsink->preroll);
|
|
|
|
appsink->preroll = NULL;
|
|
|
|
}
|
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
|
|
|
g_queue_foreach (appsink->queue, (GFunc) gst_mini_object_unref, NULL);
|
2007-03-11 00:48:26 +00:00
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->dispose (obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
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
|
|
|
gst_app_sink_finalize (GObject * obj)
|
2007-03-11 00:48:26 +00:00
|
|
|
{
|
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
|
|
|
GstAppSink *appsink = GST_APP_SINK (obj);
|
|
|
|
|
|
|
|
g_mutex_free (appsink->mutex);
|
|
|
|
g_cond_free (appsink->cond);
|
|
|
|
g_queue_free (appsink->queue);
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (obj);
|
2007-03-11 00:48:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_app_sink_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec)
|
|
|
|
{
|
|
|
|
GstAppSink *appsink = GST_APP_SINK (object);
|
|
|
|
|
|
|
|
switch (prop_id) {
|
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
|
|
|
case PROP_CAPS:
|
|
|
|
gst_app_sink_set_caps (appsink, gst_value_get_caps (value));
|
|
|
|
break;
|
2007-03-11 00:48:26 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_app_sink_get_property (GObject * object, guint prop_id, GValue * value,
|
|
|
|
GParamSpec * pspec)
|
|
|
|
{
|
|
|
|
GstAppSink *appsink = GST_APP_SINK (object);
|
|
|
|
|
|
|
|
switch (prop_id) {
|
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
|
|
|
case PROP_CAPS:
|
|
|
|
{
|
|
|
|
GstCaps *caps;
|
|
|
|
|
|
|
|
caps = gst_app_sink_get_caps (appsink);
|
|
|
|
gst_value_set_caps (value, caps);
|
|
|
|
if (caps)
|
|
|
|
gst_caps_unref (caps);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case PROP_EOS:
|
|
|
|
g_value_set_boolean (value, gst_app_sink_is_eos (appsink));
|
|
|
|
break;
|
2007-03-11 00:48:26 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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
|
|
|
static void
|
|
|
|
gst_app_sink_flush_unlocked (GstAppSink * appsink)
|
|
|
|
{
|
2007-08-14 17:47:34 +00:00
|
|
|
GstBuffer *buffer;
|
|
|
|
|
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_DEBUG_OBJECT (appsink, "flushing 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
|
|
|
appsink->is_eos = FALSE;
|
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_buffer_replace (&appsink->preroll, NULL);
|
2007-08-14 17:47:34 +00:00
|
|
|
while ((buffer = g_queue_pop_head (appsink->queue)))
|
|
|
|
gst_buffer_unref (buffer);
|
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
|
|
|
g_cond_signal (appsink->cond);
|
|
|
|
}
|
|
|
|
|
2007-03-11 00:48:26 +00:00
|
|
|
static gboolean
|
|
|
|
gst_app_sink_start (GstBaseSink * psink)
|
|
|
|
{
|
|
|
|
GstAppSink *appsink = GST_APP_SINK (psink);
|
|
|
|
|
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
|
|
|
g_mutex_lock (appsink->mutex);
|
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
|
|
|
appsink->is_eos = FALSE;
|
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
|
|
|
appsink->started = TRUE;
|
|
|
|
GST_DEBUG_OBJECT (appsink, "starting");
|
|
|
|
g_mutex_unlock (appsink->mutex);
|
2007-03-11 00:48:26 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_app_sink_stop (GstBaseSink * psink)
|
|
|
|
{
|
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
|
|
|
GstAppSink *appsink = GST_APP_SINK (psink);
|
|
|
|
|
|
|
|
g_mutex_lock (appsink->mutex);
|
|
|
|
GST_DEBUG_OBJECT (appsink, "stopping");
|
|
|
|
appsink->started = FALSE;
|
|
|
|
gst_app_sink_flush_unlocked (appsink);
|
|
|
|
g_mutex_unlock (appsink->mutex);
|
2007-03-11 00:48:26 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_app_sink_event (GstBaseSink * sink, GstEvent * event)
|
|
|
|
{
|
|
|
|
GstAppSink *appsink = GST_APP_SINK (sink);
|
|
|
|
|
|
|
|
switch (event->type) {
|
|
|
|
case GST_EVENT_EOS:
|
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
|
|
|
g_mutex_lock (appsink->mutex);
|
|
|
|
GST_DEBUG_OBJECT (appsink, "receiving EOS");
|
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
|
|
|
appsink->is_eos = TRUE;
|
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
|
|
|
g_cond_signal (appsink->cond);
|
|
|
|
g_mutex_unlock (appsink->mutex);
|
|
|
|
break;
|
|
|
|
case GST_EVENT_FLUSH_START:
|
|
|
|
break;
|
|
|
|
case GST_EVENT_FLUSH_STOP:
|
|
|
|
g_mutex_lock (appsink->mutex);
|
|
|
|
GST_DEBUG_OBJECT (appsink, "received FLUSH_STOP");
|
|
|
|
gst_app_sink_flush_unlocked (appsink);
|
|
|
|
g_mutex_unlock (appsink->mutex);
|
2007-03-11 00:48:26 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
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
|
|
|
return TRUE;
|
|
|
|
}
|
2007-03-11 00:48:26 +00:00
|
|
|
|
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
|
|
|
static GstFlowReturn
|
|
|
|
gst_app_sink_preroll (GstBaseSink * psink, GstBuffer * buffer)
|
|
|
|
{
|
|
|
|
GstAppSink *appsink = GST_APP_SINK (psink);
|
|
|
|
|
|
|
|
g_mutex_lock (appsink->mutex);
|
|
|
|
GST_DEBUG_OBJECT (appsink, "setting preroll buffer %p", buffer);
|
|
|
|
gst_buffer_replace (&appsink->preroll, buffer);
|
|
|
|
g_cond_signal (appsink->cond);
|
|
|
|
g_mutex_unlock (appsink->mutex);
|
|
|
|
|
|
|
|
return GST_FLOW_OK;
|
2007-03-11 00:48:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GstFlowReturn
|
|
|
|
gst_app_sink_render (GstBaseSink * psink, GstBuffer * buffer)
|
|
|
|
{
|
|
|
|
GstAppSink *appsink = GST_APP_SINK (psink);
|
|
|
|
|
|
|
|
g_mutex_lock (appsink->mutex);
|
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_DEBUG_OBJECT (appsink, "pushing render buffer %p on queue", buffer);
|
2007-03-11 00:48:26 +00:00
|
|
|
g_queue_push_tail (appsink->queue, gst_buffer_ref (buffer));
|
|
|
|
g_cond_signal (appsink->cond);
|
|
|
|
g_mutex_unlock (appsink->mutex);
|
|
|
|
|
|
|
|
return GST_FLOW_OK;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
static GstCaps *
|
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
|
|
|
gst_app_sink_getcaps (GstBaseSink * psink)
|
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
|
|
|
{
|
|
|
|
GstCaps *caps;
|
|
|
|
|
|
|
|
GstAppSink *appsink = GST_APP_SINK (psink);
|
2007-03-11 00:48:26 +00:00
|
|
|
|
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_OBJECT_LOCK (appsink);
|
|
|
|
if ((caps = appsink->caps))
|
|
|
|
gst_caps_ref (caps);
|
2007-09-12 08:38:21 +00:00
|
|
|
GST_DEBUG_OBJECT (appsink, "got caps %" GST_PTR_FORMAT, caps);
|
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_OBJECT_UNLOCK (appsink);
|
2007-03-11 00:48:26 +00:00
|
|
|
|
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
|
|
|
return caps;
|
|
|
|
}
|
2007-03-11 00:48:26 +00:00
|
|
|
|
|
|
|
/* external API */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_app_sink_set_caps:
|
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
|
|
|
* @appsink: a #GstAppSink
|
|
|
|
* @caps: caps to set
|
2007-03-11 00:48:26 +00:00
|
|
|
*
|
|
|
|
* Set the capabilities on the appsink element. This function takes
|
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
|
|
|
* a copy of the caps structure. After calling this method, the sink will only
|
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
|
|
|
* accept caps that match @caps. If @caps is non-fixed, you must check the caps
|
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
|
|
|
* on the buffers to get the actual used caps.
|
2007-03-11 00:48:26 +00:00
|
|
|
*/
|
|
|
|
void
|
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
|
|
|
gst_app_sink_set_caps (GstAppSink * appsink, const GstCaps * caps)
|
2007-03-11 00:48:26 +00:00
|
|
|
{
|
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
|
|
|
GstCaps *old;
|
|
|
|
|
2007-03-11 00:48:26 +00:00
|
|
|
g_return_if_fail (appsink != NULL);
|
|
|
|
g_return_if_fail (GST_IS_APP_SINK (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_OBJECT_LOCK (appsink);
|
2007-09-12 08:38:21 +00:00
|
|
|
GST_DEBUG_OBJECT (appsink, "setting caps to %" GST_PTR_FORMAT, caps);
|
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
|
|
|
old = appsink->caps;
|
|
|
|
if (caps)
|
|
|
|
appsink->caps = gst_caps_copy (caps);
|
|
|
|
else
|
|
|
|
appsink->caps = NULL;
|
|
|
|
if (old)
|
|
|
|
gst_caps_unref (old);
|
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_OBJECT_UNLOCK (appsink);
|
2007-03-11 00:48:26 +00:00
|
|
|
}
|
|
|
|
|
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 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
|
|
|
* gst_app_sink_get_caps:
|
|
|
|
* @appsink: a #GstAppSink
|
|
|
|
*
|
|
|
|
* Get the configured caps on @appsink.
|
|
|
|
*
|
|
|
|
* Returns: the #GstCaps accepted by the sink. gst_caps_unref() after usage.
|
|
|
|
*/
|
|
|
|
GstCaps *
|
|
|
|
gst_app_sink_get_caps (GstAppSink * appsink)
|
|
|
|
{
|
|
|
|
GstCaps *caps;
|
|
|
|
|
|
|
|
g_return_val_if_fail (appsink != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GST_IS_APP_SINK (appsink), NULL);
|
|
|
|
|
|
|
|
GST_OBJECT_LOCK (appsink);
|
|
|
|
if ((caps = appsink->caps))
|
|
|
|
gst_caps_ref (caps);
|
|
|
|
GST_DEBUG_OBJECT (appsink, "getting caps of %" GST_PTR_FORMAT, caps);
|
|
|
|
GST_OBJECT_UNLOCK (appsink);
|
|
|
|
|
|
|
|
return caps;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_app_sink_is_eos:
|
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
|
|
|
* @appsink: a #GstAppSink
|
|
|
|
*
|
|
|
|
* Check if @appsink is EOS, which is when no more buffers can be pulled because
|
|
|
|
* an EOS event was received.
|
|
|
|
*
|
|
|
|
* This function also returns %TRUE when the appsink is not in the PAUSED or
|
|
|
|
* PLAYING state.
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if no more buffers can be pulled and the appsink is EOS.
|
|
|
|
*/
|
2007-03-11 00:48:26 +00:00
|
|
|
gboolean
|
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
|
|
|
gst_app_sink_is_eos (GstAppSink * appsink)
|
2007-03-11 00:48:26 +00:00
|
|
|
{
|
|
|
|
gboolean ret;
|
|
|
|
|
|
|
|
g_return_val_if_fail (appsink != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (GST_IS_APP_SINK (appsink), FALSE);
|
|
|
|
|
|
|
|
g_mutex_lock (appsink->mutex);
|
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
|
|
|
if (!appsink->started)
|
|
|
|
goto not_started;
|
|
|
|
|
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
|
|
|
if (appsink->is_eos && g_queue_is_empty (appsink->queue)) {
|
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_DEBUG_OBJECT (appsink, "we are EOS and the queue is empty");
|
2007-03-11 00:48:26 +00:00
|
|
|
ret = TRUE;
|
|
|
|
} else {
|
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_DEBUG_OBJECT (appsink, "we are not yet EOS");
|
2007-03-11 00:48:26 +00:00
|
|
|
ret = FALSE;
|
|
|
|
}
|
|
|
|
g_mutex_unlock (appsink->mutex);
|
|
|
|
|
|
|
|
return ret;
|
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
|
|
|
|
|
|
|
not_started:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (appsink, "we are stopped, return TRUE");
|
|
|
|
g_mutex_unlock (appsink->mutex);
|
|
|
|
return TRUE;
|
|
|
|
}
|
2007-03-11 00:48:26 +00:00
|
|
|
}
|
|
|
|
|
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_app_sink_pull_preroll:
|
|
|
|
* @appsink: a #GstAppSink
|
|
|
|
*
|
|
|
|
* Get the last preroll buffer in @appsink. This was the buffer that caused the
|
|
|
|
* appsink to preroll in the PAUSED state. This buffer can be pulled many times
|
|
|
|
* and remains available to the application even after EOS.
|
|
|
|
*
|
|
|
|
* This function is typically used when dealing with a pipeline in the PAUSED
|
|
|
|
* state. Calling this function after doing a seek will give the buffer right
|
|
|
|
* after the seek position.
|
|
|
|
*
|
|
|
|
* Note that the preroll buffer will also be returned as the first buffer
|
|
|
|
* when calling gst_app_sink_pull_buffer().
|
|
|
|
*
|
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
|
|
|
* If an EOS event was received before any buffers, this function returns
|
|
|
|
* %NULL. Use gst_app_sink_is_eos () to check for the EOS condition.
|
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
|
|
|
*
|
|
|
|
* This function blocks until a preroll buffer or EOS is received or the appsink
|
|
|
|
* element is set to the READY/NULL state.
|
|
|
|
*
|
|
|
|
* Returns: a #GstBuffer or NULL when the appsink is stopped or EOS.
|
|
|
|
*/
|
|
|
|
GstBuffer *
|
|
|
|
gst_app_sink_pull_preroll (GstAppSink * appsink)
|
|
|
|
{
|
|
|
|
GstBuffer *buf = NULL;
|
|
|
|
|
|
|
|
g_return_val_if_fail (appsink != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GST_IS_APP_SINK (appsink), NULL);
|
|
|
|
|
|
|
|
g_mutex_lock (appsink->mutex);
|
|
|
|
|
|
|
|
while (TRUE) {
|
|
|
|
GST_DEBUG_OBJECT (appsink, "trying to grab a buffer");
|
|
|
|
if (!appsink->started)
|
|
|
|
goto not_started;
|
|
|
|
|
|
|
|
if (appsink->preroll != NULL)
|
|
|
|
break;
|
|
|
|
|
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
|
|
|
if (appsink->is_eos)
|
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
|
|
|
goto eos;
|
|
|
|
|
|
|
|
/* nothing to return, wait */
|
|
|
|
GST_DEBUG_OBJECT (appsink, "waiting for the preroll buffer");
|
|
|
|
g_cond_wait (appsink->cond, appsink->mutex);
|
|
|
|
}
|
|
|
|
buf = gst_buffer_ref (appsink->preroll);
|
|
|
|
GST_DEBUG_OBJECT (appsink, "we have the preroll buffer %p", buf);
|
|
|
|
g_mutex_unlock (appsink->mutex);
|
|
|
|
|
|
|
|
return buf;
|
|
|
|
|
|
|
|
/* special conditions */
|
|
|
|
eos:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (appsink, "we are EOS, return NULL");
|
|
|
|
g_mutex_unlock (appsink->mutex);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
not_started:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (appsink, "we are stopped, return NULL");
|
|
|
|
g_mutex_unlock (appsink->mutex);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_app_sink_pull_buffer:
|
|
|
|
* @appsink: a #GstAppSink
|
|
|
|
*
|
|
|
|
* This function blocks until a buffer or EOS becomes available or the appsink
|
|
|
|
* element is set to the READY/NULL state.
|
|
|
|
*
|
|
|
|
* This function will only return buffers when the appsink is in the PLAYING
|
|
|
|
* state. All rendered buffers will be put in a queue so that the application
|
|
|
|
* can pull buffers at its own rate. Note that when the application does not
|
|
|
|
* pull buffers fast enough, the queued buffers could consume a lot of memory,
|
|
|
|
* especially when dealing with raw video frames.
|
|
|
|
*
|
|
|
|
* If an EOS event was received before any buffers, this function returns
|
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
|
|
|
* %NULL. Use gst_app_sink_is_eos () to check for the EOS condition.
|
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
|
|
|
*
|
|
|
|
* Returns: a #GstBuffer or NULL when the appsink is stopped or EOS.
|
|
|
|
*/
|
2007-03-11 00:48:26 +00:00
|
|
|
GstBuffer *
|
|
|
|
gst_app_sink_pull_buffer (GstAppSink * appsink)
|
|
|
|
{
|
|
|
|
GstBuffer *buf = NULL;
|
|
|
|
|
|
|
|
g_return_val_if_fail (appsink != NULL, NULL);
|
|
|
|
g_return_val_if_fail (GST_IS_APP_SINK (appsink), NULL);
|
|
|
|
|
|
|
|
g_mutex_lock (appsink->mutex);
|
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
|
|
|
|
|
|
|
while (TRUE) {
|
|
|
|
GST_DEBUG_OBJECT (appsink, "trying to grab a buffer");
|
|
|
|
if (!appsink->started)
|
|
|
|
goto not_started;
|
|
|
|
|
|
|
|
if (!g_queue_is_empty (appsink->queue))
|
|
|
|
break;
|
|
|
|
|
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
|
|
|
if (appsink->is_eos)
|
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
|
|
|
goto eos;
|
2007-03-11 00:48:26 +00:00
|
|
|
|
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
|
|
|
/* nothing to return, wait */
|
|
|
|
GST_DEBUG_OBJECT (appsink, "waiting for a buffer");
|
2007-03-11 00:48:26 +00:00
|
|
|
g_cond_wait (appsink->cond, appsink->mutex);
|
|
|
|
}
|
|
|
|
buf = g_queue_pop_head (appsink->queue);
|
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_DEBUG_OBJECT (appsink, "we have a buffer %p", buf);
|
2007-03-11 00:48:26 +00:00
|
|
|
g_mutex_unlock (appsink->mutex);
|
|
|
|
|
|
|
|
return buf;
|
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
|
|
|
|
|
|
|
/* special conditions */
|
|
|
|
eos:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (appsink, "we are EOS, return NULL");
|
|
|
|
g_mutex_unlock (appsink->mutex);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
not_started:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (appsink, "we are stopped, return NULL");
|
|
|
|
g_mutex_unlock (appsink->mutex);
|
|
|
|
return NULL;
|
|
|
|
}
|
2007-03-11 00:48:26 +00:00
|
|
|
}
|