2000-12-29 05:38:06 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
|
|
|
|
* 2000 Wim Taymans <wtay@chello.be>
|
2003-04-17 09:19:34 +00:00
|
|
|
* 2003 Colin Walters <cwalters@gnome.org>
|
2005-03-21 17:34:02 +00:00
|
|
|
* 2005 Wim Taymans <wim@fluendo.com>
|
2000-12-29 05:38:06 +00:00
|
|
|
*
|
2001-01-20 17:59:25 +00:00
|
|
|
* gstqueue.c:
|
2000-01-30 09:03:00 +00:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
2005-10-15 16:01:57 +00:00
|
|
|
|
2005-09-02 16:17:23 +00:00
|
|
|
/**
|
2005-12-01 12:29:34 +00:00
|
|
|
* SECTION:element-queue
|
2005-09-02 16:17:23 +00:00
|
|
|
* @short_description: Simple asynchronous data queue.
|
|
|
|
*
|
|
|
|
* Data is queued till max_level buffers have been stored. Any subsequent
|
|
|
|
* buffers sent to this filter will block until free space becomes available in
|
2006-03-13 11:11:16 +00:00
|
|
|
* the buffer. The queue will create a new thread on the source pad to
|
|
|
|
* decouple the processing on sink and source pad.
|
2005-10-15 15:30:24 +00:00
|
|
|
*
|
2005-09-02 16:17:23 +00:00
|
|
|
* You can query how many buffers are queued with the level argument.
|
2005-10-15 15:30:24 +00:00
|
|
|
*
|
2005-09-02 16:17:23 +00:00
|
|
|
* The default queue length is set to 100.
|
2005-10-15 15:30:24 +00:00
|
|
|
*
|
2005-09-02 16:17:23 +00:00
|
|
|
* The queue blocks by default.
|
|
|
|
*/
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2005-11-29 19:47:00 +00:00
|
|
|
#include "gst/gst_private.h"
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2005-11-29 19:47:00 +00:00
|
|
|
#include <gst/gst.h>
|
2001-01-19 00:02:53 +00:00
|
|
|
#include "gstqueue.h"
|
2005-11-29 19:47:00 +00:00
|
|
|
|
|
|
|
#include "../../gst/gst-i18n-lib.h"
|
2000-01-30 09:03:00 +00:00
|
|
|
|
gst/: s/gst_pad_new/&_from_template/ register pad templates in the base_init function add static pad template definit...
Original commit message from CVS:
* gst/autoplug/gstspideridentity.c:
(gst_spider_identity_request_new_pad):
* gst/elements/gstaggregator.c: (gst_aggregator_base_init),
(gst_aggregator_init):
* gst/elements/gstfakesink.c: (gst_fakesink_base_init),
(gst_fakesink_init):
* gst/elements/gstfakesrc.c: (gst_fakesrc_base_init),
(gst_fakesrc_init):
* gst/elements/gstfdsink.c: (gst_fdsink_base_init),
(gst_fdsink_init):
* gst/elements/gstfdsrc.c: (gst_fdsrc_base_init), (gst_fdsrc_init):
* gst/elements/gstfilesink.c: (gst_filesink_base_init),
(gst_filesink_init):
* gst/elements/gstfilesrc.c: (gst_filesrc_base_init),
(gst_filesrc_init):
* gst/elements/gstidentity.c: (gst_identity_base_init),
(gst_identity_init):
* gst/elements/gstmultifilesrc.c: (gst_multifilesrc_base_init),
(gst_multifilesrc_init):
* gst/elements/gstpipefilter.c: (gst_pipefilter_base_init),
(gst_pipefilter_init):
* gst/elements/gststatistics.c: (gst_statistics_base_init),
(gst_statistics_init):
* gst/elements/gsttee.c: (gst_tee_base_init), (gst_tee_init):
* gst/gstqueue.c: (gst_queue_base_init), (gst_queue_init):
s/gst_pad_new/&_from_template/
register pad templates in the base_init function
add static pad template definitions
2004-08-17 14:11:23 +00:00
|
|
|
static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
|
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS_ANY);
|
|
|
|
|
|
|
|
static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
|
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS_ANY);
|
|
|
|
|
2005-11-30 09:59:04 +00:00
|
|
|
GST_DEBUG_CATEGORY_STATIC (queue_debug);
|
|
|
|
#define GST_CAT_DEFAULT (queue_debug)
|
gst/elements/gstfilesrc.c: compute mapsize correctly
Original commit message from CVS:
* gst/elements/gstfilesrc.c: (gst_filesrc_get_mmap):
compute mapsize correctly
* gst/elements/gstfilesrc.c: (gst_filesrc_get_mmap):
use correct datatypes when calling a varargs function
* gst/elements/gsttypefindelement.c: (stop_typefinding):
push a DISCONT event as first thing
* gst/gst_private.h:
* gst/gstinfo.c: (_gst_debug_init):
remove GST_DATAFLOW debugging category
* gst/gstbin.c: (gst_bin_iterate):
use GST_SCHEDULING category
* gst/gstpad.c: (gst_pad_get_type), (_invent_event),
(gst_pad_push), (gst_pad_pull), (gst_pad_call_chain_function),
(gst_pad_call_get_function):
add GST_DATAFLOW to easily track flow of buffers or events.
* gst/gstqueue.c: (gst_queue_get_type),
(gst_queue_handle_pending_events), (gst_queue_chain),
(gst_queue_get), (gst_queue_handle_src_event):
use own static debugging category GST_DATAFLOW for dataflow,
use DEBUG category for showing which path events go, use LOG
category for buffers.
2004-05-11 16:20:41 +00:00
|
|
|
GST_DEBUG_CATEGORY_STATIC (queue_dataflow);
|
2005-01-08 18:10:50 +00:00
|
|
|
|
2006-01-19 13:30:31 +00:00
|
|
|
#define STATUS(queue, pad, msg) \
|
2005-01-08 18:10:50 +00:00
|
|
|
GST_CAT_LOG_OBJECT (queue_dataflow, queue, \
|
2005-12-06 19:29:15 +00:00
|
|
|
"(%s:%s) " msg ": %u of %u-%u buffers, %u of %u-%u " \
|
|
|
|
"bytes, %" G_GUINT64_FORMAT " of %" G_GUINT64_FORMAT \
|
|
|
|
"-%" G_GUINT64_FORMAT " ns, %u elements", \
|
|
|
|
GST_DEBUG_PAD_NAME (pad), \
|
|
|
|
queue->cur_level.buffers, \
|
|
|
|
queue->min_threshold.buffers, \
|
|
|
|
queue->max_size.buffers, \
|
|
|
|
queue->cur_level.bytes, \
|
|
|
|
queue->min_threshold.bytes, \
|
|
|
|
queue->max_size.bytes, \
|
|
|
|
queue->cur_level.time, \
|
|
|
|
queue->min_threshold.time, \
|
|
|
|
queue->max_size.time, \
|
|
|
|
queue->queue->length)
|
gst/elements/gstfilesrc.c: compute mapsize correctly
Original commit message from CVS:
* gst/elements/gstfilesrc.c: (gst_filesrc_get_mmap):
compute mapsize correctly
* gst/elements/gstfilesrc.c: (gst_filesrc_get_mmap):
use correct datatypes when calling a varargs function
* gst/elements/gsttypefindelement.c: (stop_typefinding):
push a DISCONT event as first thing
* gst/gst_private.h:
* gst/gstinfo.c: (_gst_debug_init):
remove GST_DATAFLOW debugging category
* gst/gstbin.c: (gst_bin_iterate):
use GST_SCHEDULING category
* gst/gstpad.c: (gst_pad_get_type), (_invent_event),
(gst_pad_push), (gst_pad_pull), (gst_pad_call_chain_function),
(gst_pad_call_get_function):
add GST_DATAFLOW to easily track flow of buffers or events.
* gst/gstqueue.c: (gst_queue_get_type),
(gst_queue_handle_pending_events), (gst_queue_chain),
(gst_queue_get), (gst_queue_handle_src_event):
use own static debugging category GST_DATAFLOW for dataflow,
use DEBUG category for showing which path events go, use LOG
category for buffers.
2004-05-11 16:20:41 +00:00
|
|
|
|
2006-04-28 18:55:17 +00:00
|
|
|
static const GstElementDetails gst_queue_details = GST_ELEMENT_DETAILS ("Queue",
|
2004-03-13 15:27:01 +00:00
|
|
|
"Generic",
|
|
|
|
"Simple data queue",
|
|
|
|
"Erik Walthinsen <omega@cse.ogi.edu>");
|
2000-01-30 09:03:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* Queue signals and args */
|
2004-03-13 15:27:01 +00:00
|
|
|
enum
|
|
|
|
{
|
2003-12-13 17:12:46 +00:00
|
|
|
SIGNAL_UNDERRUN,
|
|
|
|
SIGNAL_RUNNING,
|
|
|
|
SIGNAL_OVERRUN,
|
2000-01-30 09:03:00 +00:00
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
enum
|
|
|
|
{
|
2000-01-30 09:03:00 +00:00
|
|
|
ARG_0,
|
2003-12-13 17:12:46 +00:00
|
|
|
/* FIXME: don't we have another way of doing this
|
|
|
|
* "Gstreamer format" (frame/byte/time) queries? */
|
|
|
|
ARG_CUR_LEVEL_BUFFERS,
|
|
|
|
ARG_CUR_LEVEL_BYTES,
|
|
|
|
ARG_CUR_LEVEL_TIME,
|
|
|
|
ARG_MAX_SIZE_BUFFERS,
|
|
|
|
ARG_MAX_SIZE_BYTES,
|
|
|
|
ARG_MAX_SIZE_TIME,
|
2004-01-15 20:37:07 +00:00
|
|
|
ARG_MIN_THRESHOLD_BUFFERS,
|
|
|
|
ARG_MIN_THRESHOLD_BYTES,
|
|
|
|
ARG_MIN_THRESHOLD_TIME,
|
2001-05-25 21:00:07 +00:00
|
|
|
ARG_LEAKY,
|
2005-10-08 14:57:09 +00:00
|
|
|
/* FILL ME */
|
2000-01-30 09:03:00 +00:00
|
|
|
};
|
|
|
|
|
2005-12-06 19:29:15 +00:00
|
|
|
#define GST_QUEUE_MUTEX_LOCK(q) G_STMT_START { \
|
|
|
|
GST_CAT_LOG_OBJECT (queue_dataflow, q, \
|
|
|
|
"locking qlock from thread %p", \
|
|
|
|
g_thread_self ()); \
|
|
|
|
g_mutex_lock (q->qlock); \
|
|
|
|
GST_CAT_LOG_OBJECT (queue_dataflow, q, \
|
|
|
|
"locked qlock from thread %p", \
|
|
|
|
g_thread_self ()); \
|
2004-07-09 11:23:55 +00:00
|
|
|
} G_STMT_END
|
|
|
|
|
2005-12-06 19:29:15 +00:00
|
|
|
#define GST_QUEUE_MUTEX_LOCK_CHECK(q,label) G_STMT_START { \
|
|
|
|
GST_QUEUE_MUTEX_LOCK (q); \
|
|
|
|
if (q->srcresult != GST_FLOW_OK) \
|
|
|
|
goto label; \
|
gst/base/gstbasesrc.*: Add a gboolean to decide when to push out a discont.
Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_do_seek), (gst_base_src_loop), (gst_base_src_start):
* gst/base/gstbasesrc.h:
Add a gboolean to decide when to push out a discont.
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_sink_activate_push), (gst_queue_src_activate_push),
(gst_queue_set_property), (gst_queue_get_property):
Some cleanups.
* tests/threadstate/threadstate1.c: (main):
Make a thread test compile and run... very silly..
2005-07-20 10:58:10 +00:00
|
|
|
} G_STMT_END
|
|
|
|
|
2005-12-06 19:29:15 +00:00
|
|
|
#define GST_QUEUE_MUTEX_UNLOCK(q) G_STMT_START { \
|
|
|
|
GST_CAT_LOG_OBJECT (queue_dataflow, q, \
|
|
|
|
"unlocking qlock from thread %p", \
|
|
|
|
g_thread_self ()); \
|
|
|
|
g_mutex_unlock (q->qlock); \
|
2004-07-09 11:23:55 +00:00
|
|
|
} G_STMT_END
|
|
|
|
|
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
static void gst_queue_base_init (GstQueueClass * klass);
|
|
|
|
static void gst_queue_class_init (GstQueueClass * klass);
|
|
|
|
static void gst_queue_init (GstQueue * queue);
|
2004-07-09 11:23:55 +00:00
|
|
|
static void gst_queue_finalize (GObject * object);
|
2004-03-13 15:27:01 +00:00
|
|
|
|
|
|
|
static void gst_queue_set_property (GObject * object,
|
|
|
|
guint prop_id, const GValue * value, GParamSpec * pspec);
|
|
|
|
static void gst_queue_get_property (GObject * object,
|
|
|
|
guint prop_id, GValue * value, GParamSpec * pspec);
|
|
|
|
|
2005-03-21 17:34:02 +00:00
|
|
|
static GstFlowReturn gst_queue_chain (GstPad * pad, GstBuffer * buffer);
|
gst/: Bufferalloc: return GstFlowReturn to more accuratly report why allocation failed.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_basesink_pad_buffer_alloc),
(gst_base_sink_buffer_alloc), (gst_basesink_preroll_queue_push),
(gst_basesink_activate):
* gst/base/gstbasesink.h:
* gst/gstpad.c: (gst_pad_set_active), (gst_pad_link_prepare),
(gst_pad_link), (gst_pad_accept_caps), (gst_pad_alloc_buffer),
(gst_pad_query), (gst_pad_start_task):
* gst/gstpad.h:
* gst/gstqueue.c: (gst_queue_bufferalloc),
(gst_queue_handle_sink_event), (gst_queue_chain):
Bufferalloc: return GstFlowReturn to more accuratly report
why allocation failed.
2005-06-02 09:42:02 +00:00
|
|
|
static GstFlowReturn gst_queue_bufferalloc (GstPad * pad, guint64 offset,
|
|
|
|
guint size, GstCaps * caps, GstBuffer ** buf);
|
2006-01-19 13:30:31 +00:00
|
|
|
static gboolean gst_queue_push_one (GstQueue * queue);
|
2005-03-21 17:34:02 +00:00
|
|
|
static void gst_queue_loop (GstPad * pad);
|
|
|
|
|
|
|
|
static gboolean gst_queue_handle_sink_event (GstPad * pad, GstEvent * event);
|
2004-03-13 15:27:01 +00:00
|
|
|
|
|
|
|
static gboolean gst_queue_handle_src_event (GstPad * pad, GstEvent * event);
|
2005-05-09 10:53:13 +00:00
|
|
|
static gboolean gst_queue_handle_src_query (GstPad * pad, GstQuery * query);
|
2004-03-13 15:27:01 +00:00
|
|
|
|
|
|
|
static GstCaps *gst_queue_getcaps (GstPad * pad);
|
2005-03-21 17:34:02 +00:00
|
|
|
static GstPadLinkReturn gst_queue_link_sink (GstPad * pad, GstPad * peer);
|
|
|
|
static GstPadLinkReturn gst_queue_link_src (GstPad * pad, GstPad * peer);
|
2004-03-13 15:27:01 +00:00
|
|
|
static void gst_queue_locked_flush (GstQueue * queue);
|
|
|
|
|
gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer.
Original commit message from CVS:
2005-06-27 Andy Wingo <wingo@pobox.com>
* gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any
remaining buffer.
* gst/gsttrace.c (gst_alloc_trace_list_sorted): New helper,
returns a sorted copy of the trace list.
(gst_alloc_trace_print_live): New API, only prints traces with
live objects. Sort the list.
(gst_alloc_trace_print_all): Sort the list.
(gst_alloc_trace_print): Align columns.
* gst/elements/gstttypefindelement.c:
* gst/elements/gsttee.c:
* gst/base/gstbasesrc.c:
* gst/base/gstbasesink.c:
* gst/base/gstbasetransform.c:
* gst/gstqueue.c: Adapt for pad activation changes.
* gst/gstpipeline.c (gst_pipeline_init): Unref after parenting
sched.
(gst_pipeline_dispose): Drop ref on sched.
* gst/gstpad.c (gst_pad_init): Set the default activate func.
(gst_pad_activate_default): Push mode by default.
(pre_activate_switch, post_activate_switch): New stubs, things to
do before and after switching activation modes on pads.
(gst_pad_set_active): Take a boolean and not a mode, dispatch to
the pad's activate function to choose which mode to activate.
Shortcut on deactivation and call the right function directly.
(gst_pad_activate_pull): New API, (de)activates a pad in pull
mode.
(gst_pad_activate_push): New API, same for push mode.
(gst_pad_set_activate_function)
(gst_pad_set_activatepull_function)
(gst_pad_set_activatepush_function): Setters for new API.
* gst/gstminiobject.c (gst_mini_object_new, gst_mini_object_free):
Trace all miniobjects.
(gst_mini_object_make_writable): Unref the arg if we copy, like
gst_caps_make_writable.
* gst/gstmessage.c (_gst_message_initialize): No trace init.
* gst/gstghostpad.c (gst_proxy_pad_do_activate)
(gst_proxy_pad_do_activatepull, gst_proxy_pad_do_activatepush):
Adapt for new pad API.
* gst/gstevent.c (_gst_event_initialize): Don't initialize trace.
* gst/gstelement.h:
* gst/gstelement.c (gst_element_iterate_src_pads)
(gst_element_iterate_sink_pads): New API functions.
* gst/gstelement.c (iterator_fold_with_resync): New utility,
should fold into gstiterator.c in some form.
(gst_element_pads_activate): Simplified via use of fold and
delegation of decisions to gstpad->activate.
* gst/gstbus.c (gst_bus_source_finalize): Set the bus to NULL,
help in debugging.
* gst/gstbuffer.c (_gst_buffer_initialize): Ref the buffer type
class once in init, like gstmessage. Didn't run into this issue
but it seems correct. Don't initialize a trace, gstminiobject does
that.
* check/pipelines/simple_launch_lines.c (test_stop_from_app): New
test, runs fakesrc ! fakesink, stopping on ::handoff via a message
to the bus.
(assert_live_count): New util function, uses alloc traces to check
cleanup.
* check/gst/gstghostpad.c (test_ghost_pads): More refcount checks.
To be modified when unlink drops the internal pad.
2005-06-27 18:35:05 +00:00
|
|
|
static gboolean gst_queue_src_activate_push (GstPad * pad, gboolean active);
|
|
|
|
static gboolean gst_queue_sink_activate_push (GstPad * pad, gboolean active);
|
2005-09-02 15:42:00 +00:00
|
|
|
static GstStateChangeReturn gst_queue_change_state (GstElement * element,
|
|
|
|
GstStateChange transition);
|
2000-11-25 14:18:47 +00:00
|
|
|
|
2006-01-19 13:30:31 +00:00
|
|
|
static gboolean gst_queue_is_empty (GstQueue * queue);
|
|
|
|
static gboolean gst_queue_is_filled (GstQueue * queue);
|
2000-10-30 21:02:08 +00:00
|
|
|
|
2003-12-13 17:12:46 +00:00
|
|
|
#define GST_TYPE_QUEUE_LEAKY (queue_leaky_get_type ())
|
|
|
|
|
2001-06-25 01:20:11 +00:00
|
|
|
static GType
|
2003-12-13 17:12:46 +00:00
|
|
|
queue_leaky_get_type (void)
|
|
|
|
{
|
2001-06-25 01:20:11 +00:00
|
|
|
static GType queue_leaky_type = 0;
|
2006-05-09 17:58:35 +00:00
|
|
|
static const GEnumValue queue_leaky[] = {
|
2005-11-22 15:52:03 +00:00
|
|
|
{GST_QUEUE_NO_LEAK, "Not Leaky", "no"},
|
|
|
|
{GST_QUEUE_LEAK_UPSTREAM, "Leaky on Upstream", "upstream"},
|
|
|
|
{GST_QUEUE_LEAK_DOWNSTREAM, "Leaky on Downstream", "downstream"},
|
2004-03-13 15:27:01 +00:00
|
|
|
{0, NULL, NULL},
|
2001-05-25 21:00:07 +00:00
|
|
|
};
|
2004-03-15 19:27:17 +00:00
|
|
|
|
2001-05-25 21:00:07 +00:00
|
|
|
if (!queue_leaky_type) {
|
2004-03-13 15:27:01 +00:00
|
|
|
queue_leaky_type = g_enum_register_static ("GstQueueLeaky", queue_leaky);
|
2001-05-25 21:00:07 +00:00
|
|
|
}
|
|
|
|
return queue_leaky_type;
|
|
|
|
}
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2000-12-29 02:28:04 +00:00
|
|
|
static GstElementClass *parent_class = NULL;
|
2003-04-17 09:19:34 +00:00
|
|
|
static guint gst_queue_signals[LAST_SIGNAL] = { 0 };
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2001-06-25 01:20:11 +00:00
|
|
|
GType
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_queue_get_type (void)
|
2001-08-21 20:16:48 +00:00
|
|
|
{
|
2001-06-25 01:20:11 +00:00
|
|
|
static GType queue_type = 0;
|
2000-01-30 09:03:00 +00:00
|
|
|
|
|
|
|
if (!queue_type) {
|
2001-06-25 01:20:11 +00:00
|
|
|
static const GTypeInfo queue_info = {
|
2003-12-13 17:12:46 +00:00
|
|
|
sizeof (GstQueueClass),
|
|
|
|
(GBaseInitFunc) gst_queue_base_init,
|
2001-06-25 01:20:11 +00:00
|
|
|
NULL,
|
2003-12-13 17:12:46 +00:00
|
|
|
(GClassInitFunc) gst_queue_class_init,
|
2001-06-25 01:20:11 +00:00
|
|
|
NULL,
|
|
|
|
NULL,
|
2003-12-13 17:12:46 +00:00
|
|
|
sizeof (GstQueue),
|
2004-04-09 19:05:03 +00:00
|
|
|
0,
|
2003-12-13 17:12:46 +00:00
|
|
|
(GInstanceInitFunc) gst_queue_init,
|
2001-09-14 22:16:47 +00:00
|
|
|
NULL
|
2000-01-30 09:03:00 +00:00
|
|
|
};
|
2003-12-13 17:12:46 +00:00
|
|
|
|
|
|
|
queue_type = g_type_register_static (GST_TYPE_ELEMENT,
|
2004-03-15 19:27:17 +00:00
|
|
|
"GstQueue", &queue_info, 0);
|
2005-11-30 09:59:04 +00:00
|
|
|
GST_DEBUG_CATEGORY_INIT (queue_debug, "queue", 0, "queue element");
|
gst/elements/gstfilesrc.c: compute mapsize correctly
Original commit message from CVS:
* gst/elements/gstfilesrc.c: (gst_filesrc_get_mmap):
compute mapsize correctly
* gst/elements/gstfilesrc.c: (gst_filesrc_get_mmap):
use correct datatypes when calling a varargs function
* gst/elements/gsttypefindelement.c: (stop_typefinding):
push a DISCONT event as first thing
* gst/gst_private.h:
* gst/gstinfo.c: (_gst_debug_init):
remove GST_DATAFLOW debugging category
* gst/gstbin.c: (gst_bin_iterate):
use GST_SCHEDULING category
* gst/gstpad.c: (gst_pad_get_type), (_invent_event),
(gst_pad_push), (gst_pad_pull), (gst_pad_call_chain_function),
(gst_pad_call_get_function):
add GST_DATAFLOW to easily track flow of buffers or events.
* gst/gstqueue.c: (gst_queue_get_type),
(gst_queue_handle_pending_events), (gst_queue_chain),
(gst_queue_get), (gst_queue_handle_src_event):
use own static debugging category GST_DATAFLOW for dataflow,
use DEBUG category for showing which path events go, use LOG
category for buffers.
2004-05-11 16:20:41 +00:00
|
|
|
GST_DEBUG_CATEGORY_INIT (queue_dataflow, "queue_dataflow", 0,
|
|
|
|
"dataflow inside the queue element");
|
2000-01-30 09:03:00 +00:00
|
|
|
}
|
2003-12-13 17:12:46 +00:00
|
|
|
|
2000-01-30 09:03:00 +00:00
|
|
|
return queue_type;
|
|
|
|
}
|
|
|
|
|
2001-01-20 17:59:25 +00:00
|
|
|
static void
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_queue_base_init (GstQueueClass * klass)
|
2000-11-25 14:18:47 +00:00
|
|
|
{
|
2003-12-13 17:12:46 +00:00
|
|
|
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
|
2003-10-31 19:32:47 +00:00
|
|
|
|
gst/: s/gst_pad_new/&_from_template/ register pad templates in the base_init function add static pad template definit...
Original commit message from CVS:
* gst/autoplug/gstspideridentity.c:
(gst_spider_identity_request_new_pad):
* gst/elements/gstaggregator.c: (gst_aggregator_base_init),
(gst_aggregator_init):
* gst/elements/gstfakesink.c: (gst_fakesink_base_init),
(gst_fakesink_init):
* gst/elements/gstfakesrc.c: (gst_fakesrc_base_init),
(gst_fakesrc_init):
* gst/elements/gstfdsink.c: (gst_fdsink_base_init),
(gst_fdsink_init):
* gst/elements/gstfdsrc.c: (gst_fdsrc_base_init), (gst_fdsrc_init):
* gst/elements/gstfilesink.c: (gst_filesink_base_init),
(gst_filesink_init):
* gst/elements/gstfilesrc.c: (gst_filesrc_base_init),
(gst_filesrc_init):
* gst/elements/gstidentity.c: (gst_identity_base_init),
(gst_identity_init):
* gst/elements/gstmultifilesrc.c: (gst_multifilesrc_base_init),
(gst_multifilesrc_init):
* gst/elements/gstpipefilter.c: (gst_pipefilter_base_init),
(gst_pipefilter_init):
* gst/elements/gststatistics.c: (gst_statistics_base_init),
(gst_statistics_init):
* gst/elements/gsttee.c: (gst_tee_base_init), (gst_tee_init):
* gst/gstqueue.c: (gst_queue_base_init), (gst_queue_init):
s/gst_pad_new/&_from_template/
register pad templates in the base_init function
add static pad template definitions
2004-08-17 14:11:23 +00:00
|
|
|
gst_element_class_add_pad_template (gstelement_class,
|
|
|
|
gst_static_pad_template_get (&srctemplate));
|
|
|
|
gst_element_class_add_pad_template (gstelement_class,
|
|
|
|
gst_static_pad_template_get (&sinktemplate));
|
2003-10-31 19:32:47 +00:00
|
|
|
gst_element_class_set_details (gstelement_class, &gst_queue_details);
|
|
|
|
}
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2003-10-31 19:32:47 +00:00
|
|
|
static void
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_queue_class_init (GstQueueClass * klass)
|
2003-10-31 19:32:47 +00:00
|
|
|
{
|
2003-12-13 17:12:46 +00:00
|
|
|
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
|
|
|
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2003-12-13 17:12:46 +00:00
|
|
|
parent_class = g_type_class_peek_parent (klass);
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2005-03-08 17:42:29 +00:00
|
|
|
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_queue_set_property);
|
|
|
|
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_queue_get_property);
|
|
|
|
|
2003-12-13 17:12:46 +00:00
|
|
|
/* signals */
|
2005-08-15 16:57:34 +00:00
|
|
|
/**
|
|
|
|
* GstQueue::underrun:
|
|
|
|
* @queue: the queue instance
|
|
|
|
*
|
|
|
|
* Reports that the buffer became empty (underrun).
|
|
|
|
* A buffer is empty if the total amount of data inside it (num-buffers, time,
|
|
|
|
* size) is lower than the boundary values which can be set through the GObject
|
|
|
|
* properties.
|
|
|
|
*/
|
2003-12-13 17:12:46 +00:00
|
|
|
gst_queue_signals[SIGNAL_UNDERRUN] =
|
2004-03-13 15:27:01 +00:00
|
|
|
g_signal_new ("underrun", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GstQueueClass, underrun), NULL, NULL,
|
|
|
|
g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
|
2005-08-15 16:57:34 +00:00
|
|
|
/**
|
|
|
|
* GstQueue::running:
|
|
|
|
* @queue: the queue instance
|
|
|
|
*
|
|
|
|
* Reports that enough (min-threshold) data is in the queue. Use this signal
|
|
|
|
* together with the underrun signal to pause the pipeline on underrun and wait
|
|
|
|
* for the queue to fill-up before resume playback.
|
|
|
|
*/
|
2003-12-13 17:12:46 +00:00
|
|
|
gst_queue_signals[SIGNAL_RUNNING] =
|
2004-03-13 15:27:01 +00:00
|
|
|
g_signal_new ("running", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GstQueueClass, running), NULL, NULL,
|
|
|
|
g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
|
2005-08-15 16:57:34 +00:00
|
|
|
/**
|
|
|
|
* GstQueue::overrun:
|
|
|
|
* @queue: the queue instance
|
|
|
|
*
|
|
|
|
* Reports that the buffer became full (overrun).
|
|
|
|
* A buffer is full if the total amount of data inside it (num-buffers, time,
|
|
|
|
* size) is higher than the boundary values which can be set through the GObject
|
|
|
|
* properties.
|
|
|
|
*/
|
2003-12-13 17:12:46 +00:00
|
|
|
gst_queue_signals[SIGNAL_OVERRUN] =
|
2004-03-13 15:27:01 +00:00
|
|
|
g_signal_new ("overrun", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GstQueueClass, overrun), NULL, NULL,
|
|
|
|
g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
|
2002-01-13 22:22:42 +00:00
|
|
|
|
2003-12-13 17:12:46 +00:00
|
|
|
/* properties */
|
|
|
|
g_object_class_install_property (gobject_class, ARG_CUR_LEVEL_BYTES,
|
2004-03-13 15:27:01 +00:00
|
|
|
g_param_spec_uint ("current-level-bytes", "Current level (kB)",
|
2004-03-15 19:27:17 +00:00
|
|
|
"Current amount of data in the queue (bytes)",
|
|
|
|
0, G_MAXUINT, 0, G_PARAM_READABLE));
|
2003-12-13 17:12:46 +00:00
|
|
|
g_object_class_install_property (gobject_class, ARG_CUR_LEVEL_BUFFERS,
|
2004-03-13 15:27:01 +00:00
|
|
|
g_param_spec_uint ("current-level-buffers", "Current level (buffers)",
|
2004-03-15 19:27:17 +00:00
|
|
|
"Current number of buffers in the queue",
|
|
|
|
0, G_MAXUINT, 0, G_PARAM_READABLE));
|
2003-12-13 17:12:46 +00:00
|
|
|
g_object_class_install_property (gobject_class, ARG_CUR_LEVEL_TIME,
|
2004-03-13 15:27:01 +00:00
|
|
|
g_param_spec_uint64 ("current-level-time", "Current level (ns)",
|
2004-03-15 19:27:17 +00:00
|
|
|
"Current amount of data in the queue (in ns)",
|
|
|
|
0, G_MAXUINT64, 0, G_PARAM_READABLE));
|
2003-12-13 17:12:46 +00:00
|
|
|
|
|
|
|
g_object_class_install_property (gobject_class, ARG_MAX_SIZE_BYTES,
|
2004-03-13 15:27:01 +00:00
|
|
|
g_param_spec_uint ("max-size-bytes", "Max. size (kB)",
|
2004-03-15 19:27:17 +00:00
|
|
|
"Max. amount of data in the queue (bytes, 0=disable)",
|
|
|
|
0, G_MAXUINT, 0, G_PARAM_READWRITE));
|
2003-12-13 17:12:46 +00:00
|
|
|
g_object_class_install_property (gobject_class, ARG_MAX_SIZE_BUFFERS,
|
2004-03-13 15:27:01 +00:00
|
|
|
g_param_spec_uint ("max-size-buffers", "Max. size (buffers)",
|
2004-03-15 19:27:17 +00:00
|
|
|
"Max. number of buffers in the queue (0=disable)",
|
|
|
|
0, G_MAXUINT, 0, G_PARAM_READWRITE));
|
2003-12-13 17:12:46 +00:00
|
|
|
g_object_class_install_property (gobject_class, ARG_MAX_SIZE_TIME,
|
2004-03-13 15:27:01 +00:00
|
|
|
g_param_spec_uint64 ("max-size-time", "Max. size (ns)",
|
2004-03-15 19:27:17 +00:00
|
|
|
"Max. amount of data in the queue (in ns, 0=disable)",
|
|
|
|
0, G_MAXUINT64, 0, G_PARAM_READWRITE));
|
2003-12-13 17:12:46 +00:00
|
|
|
|
2004-01-15 20:37:07 +00:00
|
|
|
g_object_class_install_property (gobject_class, ARG_MIN_THRESHOLD_BYTES,
|
2004-03-13 15:27:01 +00:00
|
|
|
g_param_spec_uint ("min-threshold-bytes", "Min. threshold (kB)",
|
2004-03-15 19:27:17 +00:00
|
|
|
"Min. amount of data in the queue to allow reading (bytes, 0=disable)",
|
|
|
|
0, G_MAXUINT, 0, G_PARAM_READWRITE));
|
2004-01-15 20:37:07 +00:00
|
|
|
g_object_class_install_property (gobject_class, ARG_MIN_THRESHOLD_BUFFERS,
|
2004-03-13 15:27:01 +00:00
|
|
|
g_param_spec_uint ("min-threshold-buffers", "Min. threshold (buffers)",
|
2004-03-15 19:27:17 +00:00
|
|
|
"Min. number of buffers in the queue to allow reading (0=disable)",
|
|
|
|
0, G_MAXUINT, 0, G_PARAM_READWRITE));
|
2004-01-15 20:37:07 +00:00
|
|
|
g_object_class_install_property (gobject_class, ARG_MIN_THRESHOLD_TIME,
|
2004-03-13 15:27:01 +00:00
|
|
|
g_param_spec_uint64 ("min-threshold-time", "Min. threshold (ns)",
|
2004-03-15 19:27:17 +00:00
|
|
|
"Min. amount of data in the queue to allow reading (in ns, 0=disable)",
|
|
|
|
0, G_MAXUINT64, 0, G_PARAM_READWRITE));
|
2003-12-13 17:12:46 +00:00
|
|
|
|
|
|
|
g_object_class_install_property (gobject_class, ARG_LEAKY,
|
2004-03-13 15:27:01 +00:00
|
|
|
g_param_spec_enum ("leaky", "Leaky",
|
2004-03-15 19:27:17 +00:00
|
|
|
"Where the queue leaks, if at all",
|
|
|
|
GST_TYPE_QUEUE_LEAKY, GST_QUEUE_NO_LEAK, G_PARAM_READWRITE));
|
2003-12-13 17:12:46 +00:00
|
|
|
|
|
|
|
/* set several parent class virtual functions */
|
2004-07-09 11:23:55 +00:00
|
|
|
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_queue_finalize);
|
2003-12-13 17:12:46 +00:00
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
gstelement_class->change_state = GST_DEBUG_FUNCPTR (gst_queue_change_state);
|
2002-01-13 22:22:42 +00:00
|
|
|
}
|
|
|
|
|
2001-01-20 17:59:25 +00:00
|
|
|
static void
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_queue_init (GstQueue * queue)
|
2000-11-25 14:18:47 +00:00
|
|
|
{
|
2005-11-16 17:18:34 +00:00
|
|
|
queue->sinkpad = gst_pad_new_from_static_template (&sinktemplate, "sink");
|
2005-11-15 19:31:05 +00:00
|
|
|
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_pad_set_chain_function (queue->sinkpad,
|
|
|
|
GST_DEBUG_FUNCPTR (gst_queue_chain));
|
gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer.
Original commit message from CVS:
2005-06-27 Andy Wingo <wingo@pobox.com>
* gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any
remaining buffer.
* gst/gsttrace.c (gst_alloc_trace_list_sorted): New helper,
returns a sorted copy of the trace list.
(gst_alloc_trace_print_live): New API, only prints traces with
live objects. Sort the list.
(gst_alloc_trace_print_all): Sort the list.
(gst_alloc_trace_print): Align columns.
* gst/elements/gstttypefindelement.c:
* gst/elements/gsttee.c:
* gst/base/gstbasesrc.c:
* gst/base/gstbasesink.c:
* gst/base/gstbasetransform.c:
* gst/gstqueue.c: Adapt for pad activation changes.
* gst/gstpipeline.c (gst_pipeline_init): Unref after parenting
sched.
(gst_pipeline_dispose): Drop ref on sched.
* gst/gstpad.c (gst_pad_init): Set the default activate func.
(gst_pad_activate_default): Push mode by default.
(pre_activate_switch, post_activate_switch): New stubs, things to
do before and after switching activation modes on pads.
(gst_pad_set_active): Take a boolean and not a mode, dispatch to
the pad's activate function to choose which mode to activate.
Shortcut on deactivation and call the right function directly.
(gst_pad_activate_pull): New API, (de)activates a pad in pull
mode.
(gst_pad_activate_push): New API, same for push mode.
(gst_pad_set_activate_function)
(gst_pad_set_activatepull_function)
(gst_pad_set_activatepush_function): Setters for new API.
* gst/gstminiobject.c (gst_mini_object_new, gst_mini_object_free):
Trace all miniobjects.
(gst_mini_object_make_writable): Unref the arg if we copy, like
gst_caps_make_writable.
* gst/gstmessage.c (_gst_message_initialize): No trace init.
* gst/gstghostpad.c (gst_proxy_pad_do_activate)
(gst_proxy_pad_do_activatepull, gst_proxy_pad_do_activatepush):
Adapt for new pad API.
* gst/gstevent.c (_gst_event_initialize): Don't initialize trace.
* gst/gstelement.h:
* gst/gstelement.c (gst_element_iterate_src_pads)
(gst_element_iterate_sink_pads): New API functions.
* gst/gstelement.c (iterator_fold_with_resync): New utility,
should fold into gstiterator.c in some form.
(gst_element_pads_activate): Simplified via use of fold and
delegation of decisions to gstpad->activate.
* gst/gstbus.c (gst_bus_source_finalize): Set the bus to NULL,
help in debugging.
* gst/gstbuffer.c (_gst_buffer_initialize): Ref the buffer type
class once in init, like gstmessage. Didn't run into this issue
but it seems correct. Don't initialize a trace, gstminiobject does
that.
* check/pipelines/simple_launch_lines.c (test_stop_from_app): New
test, runs fakesrc ! fakesink, stopping on ::handoff via a message
to the bus.
(assert_live_count): New util function, uses alloc traces to check
cleanup.
* check/gst/gstghostpad.c (test_ghost_pads): More refcount checks.
To be modified when unlink drops the internal pad.
2005-06-27 18:35:05 +00:00
|
|
|
gst_pad_set_activatepush_function (queue->sinkpad,
|
|
|
|
GST_DEBUG_FUNCPTR (gst_queue_sink_activate_push));
|
2005-03-21 17:34:02 +00:00
|
|
|
gst_pad_set_event_function (queue->sinkpad,
|
|
|
|
GST_DEBUG_FUNCPTR (gst_queue_handle_sink_event));
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_pad_set_link_function (queue->sinkpad,
|
2005-01-08 18:10:50 +00:00
|
|
|
GST_DEBUG_FUNCPTR (gst_queue_link_sink));
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_pad_set_getcaps_function (queue->sinkpad,
|
|
|
|
GST_DEBUG_FUNCPTR (gst_queue_getcaps));
|
2005-03-21 17:34:02 +00:00
|
|
|
gst_pad_set_bufferalloc_function (queue->sinkpad,
|
|
|
|
GST_DEBUG_FUNCPTR (gst_queue_bufferalloc));
|
|
|
|
gst_element_add_pad (GST_ELEMENT (queue), queue->sinkpad);
|
2000-09-24 14:29:49 +00:00
|
|
|
|
2005-11-16 17:18:34 +00:00
|
|
|
queue->srcpad = gst_pad_new_from_static_template (&srctemplate, "src");
|
2005-11-15 19:31:05 +00:00
|
|
|
|
gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer.
Original commit message from CVS:
2005-06-27 Andy Wingo <wingo@pobox.com>
* gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any
remaining buffer.
* gst/gsttrace.c (gst_alloc_trace_list_sorted): New helper,
returns a sorted copy of the trace list.
(gst_alloc_trace_print_live): New API, only prints traces with
live objects. Sort the list.
(gst_alloc_trace_print_all): Sort the list.
(gst_alloc_trace_print): Align columns.
* gst/elements/gstttypefindelement.c:
* gst/elements/gsttee.c:
* gst/base/gstbasesrc.c:
* gst/base/gstbasesink.c:
* gst/base/gstbasetransform.c:
* gst/gstqueue.c: Adapt for pad activation changes.
* gst/gstpipeline.c (gst_pipeline_init): Unref after parenting
sched.
(gst_pipeline_dispose): Drop ref on sched.
* gst/gstpad.c (gst_pad_init): Set the default activate func.
(gst_pad_activate_default): Push mode by default.
(pre_activate_switch, post_activate_switch): New stubs, things to
do before and after switching activation modes on pads.
(gst_pad_set_active): Take a boolean and not a mode, dispatch to
the pad's activate function to choose which mode to activate.
Shortcut on deactivation and call the right function directly.
(gst_pad_activate_pull): New API, (de)activates a pad in pull
mode.
(gst_pad_activate_push): New API, same for push mode.
(gst_pad_set_activate_function)
(gst_pad_set_activatepull_function)
(gst_pad_set_activatepush_function): Setters for new API.
* gst/gstminiobject.c (gst_mini_object_new, gst_mini_object_free):
Trace all miniobjects.
(gst_mini_object_make_writable): Unref the arg if we copy, like
gst_caps_make_writable.
* gst/gstmessage.c (_gst_message_initialize): No trace init.
* gst/gstghostpad.c (gst_proxy_pad_do_activate)
(gst_proxy_pad_do_activatepull, gst_proxy_pad_do_activatepush):
Adapt for new pad API.
* gst/gstevent.c (_gst_event_initialize): Don't initialize trace.
* gst/gstelement.h:
* gst/gstelement.c (gst_element_iterate_src_pads)
(gst_element_iterate_sink_pads): New API functions.
* gst/gstelement.c (iterator_fold_with_resync): New utility,
should fold into gstiterator.c in some form.
(gst_element_pads_activate): Simplified via use of fold and
delegation of decisions to gstpad->activate.
* gst/gstbus.c (gst_bus_source_finalize): Set the bus to NULL,
help in debugging.
* gst/gstbuffer.c (_gst_buffer_initialize): Ref the buffer type
class once in init, like gstmessage. Didn't run into this issue
but it seems correct. Don't initialize a trace, gstminiobject does
that.
* check/pipelines/simple_launch_lines.c (test_stop_from_app): New
test, runs fakesrc ! fakesink, stopping on ::handoff via a message
to the bus.
(assert_live_count): New util function, uses alloc traces to check
cleanup.
* check/gst/gstghostpad.c (test_ghost_pads): More refcount checks.
To be modified when unlink drops the internal pad.
2005-06-27 18:35:05 +00:00
|
|
|
gst_pad_set_activatepush_function (queue->srcpad,
|
|
|
|
GST_DEBUG_FUNCPTR (gst_queue_src_activate_push));
|
2005-01-08 18:10:50 +00:00
|
|
|
gst_pad_set_link_function (queue->srcpad,
|
|
|
|
GST_DEBUG_FUNCPTR (gst_queue_link_src));
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_pad_set_getcaps_function (queue->srcpad,
|
|
|
|
GST_DEBUG_FUNCPTR (gst_queue_getcaps));
|
|
|
|
gst_pad_set_event_function (queue->srcpad,
|
|
|
|
GST_DEBUG_FUNCPTR (gst_queue_handle_src_event));
|
2004-10-11 13:14:03 +00:00
|
|
|
gst_pad_set_query_function (queue->srcpad,
|
|
|
|
GST_DEBUG_FUNCPTR (gst_queue_handle_src_query));
|
2005-03-21 17:34:02 +00:00
|
|
|
gst_element_add_pad (GST_ELEMENT (queue), queue->srcpad);
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2004-03-15 19:27:17 +00:00
|
|
|
queue->cur_level.buffers = 0; /* no content */
|
|
|
|
queue->cur_level.bytes = 0; /* no content */
|
|
|
|
queue->cur_level.time = 0; /* no content */
|
2005-03-21 17:34:02 +00:00
|
|
|
queue->max_size.buffers = 200; /* 200 buffers */
|
2004-03-15 19:27:17 +00:00
|
|
|
queue->max_size.bytes = 10 * 1024 * 1024; /* 10 MB */
|
|
|
|
queue->max_size.time = GST_SECOND; /* 1 s. */
|
|
|
|
queue->min_threshold.buffers = 0; /* no threshold */
|
|
|
|
queue->min_threshold.bytes = 0; /* no threshold */
|
|
|
|
queue->min_threshold.time = 0; /* no threshold */
|
plugins/elements/gstqueue.*: In queue, when EOS is received, if minimum threshold > max_size - current_level, there i...
Original commit message from CVS:
Patch by Tommi Myöhänen <ext-tommi dot myohanen at nokia dot com>
* plugins/elements/gstqueue.c: (gst_queue_init),
(gst_queue_locked_flush), (gst_queue_handle_sink_event),
(gst_queue_set_property):
* plugins/elements/gstqueue.h:
In queue, when EOS is received, if minimum threshold > max_size -
current_level, there is chance that queue blocks forever in conditional item
del wait. This is because the queue is not emptied completely due to minimum
threshold.
Here is another approach. Instead of setting cur_levels to max in EOS, just
zero all minimum threshold levels. This should make sure that queue gives out
all data. When going to READY (stop) state, just reset the original minimum
threshold levels.
Fixes #336336.
2006-03-29 11:02:33 +00:00
|
|
|
queue->orig_min_threshold.buffers = 0;
|
|
|
|
queue->orig_min_threshold.bytes = 0;
|
|
|
|
queue->orig_min_threshold.time = 0;
|
2003-12-13 17:12:46 +00:00
|
|
|
|
2001-12-29 03:02:14 +00:00
|
|
|
queue->leaky = GST_QUEUE_NO_LEAK;
|
2005-07-19 17:46:37 +00:00
|
|
|
queue->srcresult = GST_FLOW_WRONG_STATE;
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2001-10-27 20:28:31 +00:00
|
|
|
queue->qlock = g_mutex_new ();
|
2003-12-13 17:12:46 +00:00
|
|
|
queue->item_add = g_cond_new ();
|
|
|
|
queue->item_del = g_cond_new ();
|
2002-07-08 19:22:02 +00:00
|
|
|
queue->queue = g_queue_new ();
|
2003-12-13 17:12:46 +00:00
|
|
|
|
2005-11-30 09:59:04 +00:00
|
|
|
GST_DEBUG_OBJECT (queue,
|
2004-03-13 15:27:01 +00:00
|
|
|
"initialized queue's not_empty & not_full conditions");
|
2000-01-30 09:03:00 +00:00
|
|
|
}
|
|
|
|
|
2004-07-09 11:23:55 +00:00
|
|
|
/* called only once, as opposed to dispose */
|
2001-12-22 21:18:17 +00:00
|
|
|
static void
|
2004-07-09 11:23:55 +00:00
|
|
|
gst_queue_finalize (GObject * object)
|
2001-12-22 21:18:17 +00:00
|
|
|
{
|
|
|
|
GstQueue *queue = GST_QUEUE (object);
|
|
|
|
|
2004-07-09 11:23:55 +00:00
|
|
|
GST_DEBUG_OBJECT (queue, "finalizing queue");
|
2003-03-27 03:16:08 +00:00
|
|
|
|
2003-12-13 17:12:46 +00:00
|
|
|
while (!g_queue_is_empty (queue->queue)) {
|
check/Makefile.am: remove GstData checks
Original commit message from CVS:
* check/Makefile.am: remove GstData checks
* check/gst-libs/gdp.c: (START_TEST): fix for API changes
* gst/Makefile.am: add miniobject, remove data
* gst/gst.h: add miniobject, remove data
* gst/gstdata.c: remove
* gst/gstdata.h: remove
* gst/gstdata_private.h: remove
* gst/gsttypes.h: remove GstEvent and GstMessage
* gst/gstelement.c: (gst_element_post_message): fix for API changes
* gst/gstmarshal.list: change BOXED -> OBJECT
Implement GstMiniObject.
* gst/gstminiobject.c:
* gst/gstminiobject.h:
Modify to be subclasses of GstMiniObject.
* gst/gstbuffer.c: (_gst_buffer_initialize), (gst_buffer_get_type),
(gst_buffer_class_init), (gst_buffer_finalize), (_gst_buffer_copy),
(gst_buffer_init), (gst_buffer_new), (gst_buffer_new_and_alloc),
(gst_subbuffer_get_type), (gst_subbuffer_init),
(gst_buffer_create_sub), (gst_buffer_is_span_fast),
(gst_buffer_span):
* gst/gstbuffer.h:
* gst/gstevent.c: (_gst_event_initialize), (gst_event_get_type),
(gst_event_class_init), (gst_event_init), (gst_event_finalize),
(_gst_event_copy), (gst_event_new):
* gst/gstevent.h:
* gst/gstmessage.c: (_gst_message_initialize),
(gst_message_get_type), (gst_message_class_init),
(gst_message_init), (gst_message_finalize), (_gst_message_copy),
(gst_message_new), (gst_message_new_error),
(gst_message_new_warning), (gst_message_new_tag),
(gst_message_new_state_changed), (gst_message_new_application):
* gst/gstmessage.h:
* gst/gstprobe.c: (gst_probe_perform),
(gst_probe_dispatcher_dispatch):
* gst/gstprobe.h:
* gst/gstquery.c: (_gst_query_initialize), (gst_query_get_type),
(gst_query_class_init), (gst_query_finalize), (gst_query_init),
(_gst_query_copy), (gst_query_new):
Update elements for GstData -> GstMiniObject changes
* gst/gstquery.h:
* gst/gstqueue.c: (gst_queue_finalize), (gst_queue_locked_flush),
(gst_queue_chain), (gst_queue_loop):
* gst/elements/gstbufferstore.c:
(gst_buffer_store_add_buffer_func),
(gst_buffer_store_cleared_func), (gst_buffer_store_get_buffer):
* gst/elements/gstfakesink.c: (gst_fakesink_class_init),
(gst_fakesink_render):
* gst/elements/gstfakesrc.c: (gst_fakesrc_class_init):
* gst/elements/gstfilesrc.c: (gst_mmap_buffer_get_type),
(gst_mmap_buffer_class_init), (gst_mmap_buffer_init),
(gst_mmap_buffer_finalize), (gst_filesrc_map_region),
(gst_filesrc_create_read):
* gst/elements/gstidentity.c: (gst_identity_class_init):
* gst/elements/gsttypefindelement.c:
(gst_type_find_element_src_event), (free_entry_buffers),
(gst_type_find_element_handle_event):
* libs/gst/dataprotocol/dataprotocol.c:
(gst_dp_header_from_buffer):
* libs/gst/dataprotocol/dataprotocol.h:
* libs/gst/dataprotocol/dp-private.h:
2005-05-16 20:21:55 +00:00
|
|
|
GstMiniObject *data = g_queue_pop_head (queue->queue);
|
2004-03-13 15:27:01 +00:00
|
|
|
|
check/Makefile.am: remove GstData checks
Original commit message from CVS:
* check/Makefile.am: remove GstData checks
* check/gst-libs/gdp.c: (START_TEST): fix for API changes
* gst/Makefile.am: add miniobject, remove data
* gst/gst.h: add miniobject, remove data
* gst/gstdata.c: remove
* gst/gstdata.h: remove
* gst/gstdata_private.h: remove
* gst/gsttypes.h: remove GstEvent and GstMessage
* gst/gstelement.c: (gst_element_post_message): fix for API changes
* gst/gstmarshal.list: change BOXED -> OBJECT
Implement GstMiniObject.
* gst/gstminiobject.c:
* gst/gstminiobject.h:
Modify to be subclasses of GstMiniObject.
* gst/gstbuffer.c: (_gst_buffer_initialize), (gst_buffer_get_type),
(gst_buffer_class_init), (gst_buffer_finalize), (_gst_buffer_copy),
(gst_buffer_init), (gst_buffer_new), (gst_buffer_new_and_alloc),
(gst_subbuffer_get_type), (gst_subbuffer_init),
(gst_buffer_create_sub), (gst_buffer_is_span_fast),
(gst_buffer_span):
* gst/gstbuffer.h:
* gst/gstevent.c: (_gst_event_initialize), (gst_event_get_type),
(gst_event_class_init), (gst_event_init), (gst_event_finalize),
(_gst_event_copy), (gst_event_new):
* gst/gstevent.h:
* gst/gstmessage.c: (_gst_message_initialize),
(gst_message_get_type), (gst_message_class_init),
(gst_message_init), (gst_message_finalize), (_gst_message_copy),
(gst_message_new), (gst_message_new_error),
(gst_message_new_warning), (gst_message_new_tag),
(gst_message_new_state_changed), (gst_message_new_application):
* gst/gstmessage.h:
* gst/gstprobe.c: (gst_probe_perform),
(gst_probe_dispatcher_dispatch):
* gst/gstprobe.h:
* gst/gstquery.c: (_gst_query_initialize), (gst_query_get_type),
(gst_query_class_init), (gst_query_finalize), (gst_query_init),
(_gst_query_copy), (gst_query_new):
Update elements for GstData -> GstMiniObject changes
* gst/gstquery.h:
* gst/gstqueue.c: (gst_queue_finalize), (gst_queue_locked_flush),
(gst_queue_chain), (gst_queue_loop):
* gst/elements/gstbufferstore.c:
(gst_buffer_store_add_buffer_func),
(gst_buffer_store_cleared_func), (gst_buffer_store_get_buffer):
* gst/elements/gstfakesink.c: (gst_fakesink_class_init),
(gst_fakesink_render):
* gst/elements/gstfakesrc.c: (gst_fakesrc_class_init):
* gst/elements/gstfilesrc.c: (gst_mmap_buffer_get_type),
(gst_mmap_buffer_class_init), (gst_mmap_buffer_init),
(gst_mmap_buffer_finalize), (gst_filesrc_map_region),
(gst_filesrc_create_read):
* gst/elements/gstidentity.c: (gst_identity_class_init):
* gst/elements/gsttypefindelement.c:
(gst_type_find_element_src_event), (free_entry_buffers),
(gst_type_find_element_handle_event):
* libs/gst/dataprotocol/dataprotocol.c:
(gst_dp_header_from_buffer):
* libs/gst/dataprotocol/dataprotocol.h:
* libs/gst/dataprotocol/dp-private.h:
2005-05-16 20:21:55 +00:00
|
|
|
gst_mini_object_unref (data);
|
2003-12-13 17:12:46 +00:00
|
|
|
}
|
2002-07-08 19:22:02 +00:00
|
|
|
g_queue_free (queue->queue);
|
2005-11-30 09:59:04 +00:00
|
|
|
GST_DEBUG_OBJECT (queue, "free mutex");
|
2003-12-13 17:12:46 +00:00
|
|
|
g_mutex_free (queue->qlock);
|
2005-11-30 09:59:04 +00:00
|
|
|
GST_DEBUG_OBJECT (queue, "done free mutex");
|
2003-12-13 17:12:46 +00:00
|
|
|
g_cond_free (queue->item_add);
|
|
|
|
g_cond_free (queue->item_del);
|
2001-12-22 21:18:17 +00:00
|
|
|
|
2004-07-09 11:23:55 +00:00
|
|
|
if (G_OBJECT_CLASS (parent_class)->finalize)
|
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
2001-12-22 21:18:17 +00:00
|
|
|
}
|
|
|
|
|
2004-01-11 22:11:35 +00:00
|
|
|
static GstCaps *
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_queue_getcaps (GstPad * pad)
|
2004-01-11 22:11:35 +00:00
|
|
|
{
|
|
|
|
GstQueue *queue;
|
2005-03-21 17:34:02 +00:00
|
|
|
GstPad *otherpad;
|
|
|
|
GstCaps *result;
|
2004-01-11 22:11:35 +00:00
|
|
|
|
2005-03-21 17:34:02 +00:00
|
|
|
queue = GST_QUEUE (GST_PAD_PARENT (pad));
|
2004-01-11 22:11:35 +00:00
|
|
|
|
2005-03-21 17:34:02 +00:00
|
|
|
otherpad = (pad == queue->srcpad ? queue->sinkpad : queue->srcpad);
|
|
|
|
result = gst_pad_peer_get_caps (otherpad);
|
2005-05-06 17:10:49 +00:00
|
|
|
if (result == NULL)
|
|
|
|
result = gst_caps_new_any ();
|
2004-01-11 22:11:35 +00:00
|
|
|
|
2005-03-21 17:34:02 +00:00
|
|
|
return result;
|
2004-01-11 22:11:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GstPadLinkReturn
|
2005-03-21 17:34:02 +00:00
|
|
|
gst_queue_link_sink (GstPad * pad, GstPad * peer)
|
2005-01-08 18:10:50 +00:00
|
|
|
{
|
2005-03-21 17:34:02 +00:00
|
|
|
return GST_PAD_LINK_OK;
|
|
|
|
}
|
2005-01-08 18:10:50 +00:00
|
|
|
|
2005-03-21 17:34:02 +00:00
|
|
|
static GstPadLinkReturn
|
|
|
|
gst_queue_link_src (GstPad * pad, GstPad * peer)
|
|
|
|
{
|
|
|
|
GstPadLinkReturn result = GST_PAD_LINK_OK;
|
docs/design/part-seeking.txt: Some small additions.
Original commit message from CVS:
* docs/design/part-seeking.txt:
Some small additions.
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_get_times), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesink.h:
discont values are gint64, handle the math correctly.
* gst/base/gstbasesrc.c: (gst_base_src_loop):
Make the basesrc report error if the source pad is not linked.
* gst/gstqueue.c: (gst_queue_link_src), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_src_activate_push):
Make queue collect data even if the srcpad is not linked.
Start pushing out data as soon as it is linked.
* gst/gstutils.c: (gst_element_unlink), (gst_flow_get_name):
* gst/gstutils.h:
Added gst_flow_get_name() to ease error reporting.
2005-07-21 17:22:13 +00:00
|
|
|
GstQueue *queue;
|
|
|
|
|
|
|
|
queue = GST_QUEUE (gst_pad_get_parent (pad));
|
|
|
|
|
gst/base/gstbasesink.c: Speed up current position calculation.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_get_position),
(gst_base_sink_query):
Speed up current position calculation.
* gst/base/gstbasesrc.c: (gst_base_src_query),
(gst_base_src_default_newsegment):
Correctly set stream position in newsegment.
* gst/gstbin.c: (gst_bin_add_func), (add_to_queue),
(update_degree), (gst_bin_sort_iterator_next),
(gst_bin_sort_iterator_resync), (gst_bin_sort_iterator_free):
* gst/gstmessage.c: (gst_message_new_custom):
Clean up debugging info
* gst/gstqueue.c: (gst_queue_link_src), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query):
Pause task faster.
2005-10-20 11:48:53 +00:00
|
|
|
GST_DEBUG_OBJECT (queue, "queue linking source pad");
|
2005-01-08 18:10:50 +00:00
|
|
|
|
docs/design/part-seeking.txt: Some small additions.
Original commit message from CVS:
* docs/design/part-seeking.txt:
Some small additions.
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_get_times), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesink.h:
discont values are gint64, handle the math correctly.
* gst/base/gstbasesrc.c: (gst_base_src_loop):
Make the basesrc report error if the source pad is not linked.
* gst/gstqueue.c: (gst_queue_link_src), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_src_activate_push):
Make queue collect data even if the srcpad is not linked.
Start pushing out data as soon as it is linked.
* gst/gstutils.c: (gst_element_unlink), (gst_flow_get_name):
* gst/gstutils.h:
Added gst_flow_get_name() to ease error reporting.
2005-07-21 17:22:13 +00:00
|
|
|
if (GST_PAD_LINKFUNC (peer)) {
|
gst/gstutils.c: RPAD fixes all around.
Original commit message from CVS:
2005-06-08 Andy Wingo <wingo@pobox.com>
* gst/gstutils.c: RPAD fixes all around.
(gst_element_link_pads): Refcounting fixes.
* tools/gst-inspect.c:
* tools/gst-xmlinspect.c:
* parse/grammar.y:
* gst/base/gsttypefindhelper.c:
* gst/base/gstbasesink.c:
* gst/gstqueue.c: RPAD fixes.
* gst/gstghostpad.h:
* gst/gstghostpad.c: New ghost pad implementation as full proxy
pads. The tricky thing is they provide both source and sink
interfaces, since they proxy the internal pad for the external
pad, and vice versa. Implement with lower-level ProxyPad objects,
with the interior proxy pad as a child of the exterior ghost pad.
Should write a doc on this.
* gst/gstpad.h: s/RPAD/PAD/, s/RealPad/Pad/.
(gst_pad_set_name, gst_pad_set_parent): Macros removed, use
gst_object API.
* gst/gstpad.c: Big changes. No more stub base GstPad, now all
pads are real pads. No ghost pads in this file. Not documenting
the myriad s/RPAD/PAD/ and REALIZE fixes.
(gst_pad_class_init): Add properties for "direction" and
"template". Both are construct-only, so they can't change during
the life of the pad. Fixes properly deriving from GstPad.
(gst_pad_custom_new, gst_pad_custom_new_from_template): Gone. For
derived objects, just set properties when creating the objects via
g_object_new.
(gst_pad_get_parent): Implement as a function, return NULL if the
parent is not an element.
(gst_pad_get_real_parent, gst_pad_add_ghost_pad)
(gst_pad_remove_ghost_pad, gst_pad_realize): Removed.
* gst/gstobject.c (gst_object_class_init): Make name a construct
property. Don't set it in the object init.
* gst/gstelement.c (gst_element_add_pad): Don't allow adding pads
with UNKNOWN direction.
(gst_element_add_ghost_pad): Remove non-orthogonal API. Replace
with gst_element_add_pad (e, gst_ghost_pad_new (name, pad)).
(gst_element_remove_pad): Remove ghost-pad special cases.
(gst_element_pads_activate): Remove rpad cruft.
* gst/gstbin.c (gst_bin_change_state): Use gst_pad_get_parent to
catch the pad's-parent-not-an-element case.
* gst/gst.h: Include gstghostpad.h.
* gst/gst.c (init_post): No more real, ghost pads.
* gst/Makefile.am: Add gstghostpad.[ch].
* check/Makefile.am:
* check/gst/gstbin.c:
* check/gst/gstghostpad.c (test_ghost_pads): Check that linking
into a bin creates ghost pads, and that the refcounts are right.
Partly moved from gstbin.c.
2005-06-08 22:16:27 +00:00
|
|
|
result = GST_PAD_LINKFUNC (peer) (peer, pad);
|
docs/design/part-seeking.txt: Some small additions.
Original commit message from CVS:
* docs/design/part-seeking.txt:
Some small additions.
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_get_times), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesink.h:
discont values are gint64, handle the math correctly.
* gst/base/gstbasesrc.c: (gst_base_src_loop):
Make the basesrc report error if the source pad is not linked.
* gst/gstqueue.c: (gst_queue_link_src), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_src_activate_push):
Make queue collect data even if the srcpad is not linked.
Start pushing out data as soon as it is linked.
* gst/gstutils.c: (gst_element_unlink), (gst_flow_get_name):
* gst/gstutils.h:
Added gst_flow_get_name() to ease error reporting.
2005-07-21 17:22:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (GST_PAD_LINK_SUCCESSFUL (result)) {
|
|
|
|
GST_QUEUE_MUTEX_LOCK (queue);
|
|
|
|
if (queue->srcresult == GST_FLOW_OK) {
|
|
|
|
gst_pad_start_task (pad, (GstTaskFunction) gst_queue_loop, pad);
|
gst/base/gstbasesink.c: Speed up current position calculation.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_get_position),
(gst_base_sink_query):
Speed up current position calculation.
* gst/base/gstbasesrc.c: (gst_base_src_query),
(gst_base_src_default_newsegment):
Correctly set stream position in newsegment.
* gst/gstbin.c: (gst_bin_add_func), (add_to_queue),
(update_degree), (gst_bin_sort_iterator_next),
(gst_bin_sort_iterator_resync), (gst_bin_sort_iterator_free):
* gst/gstmessage.c: (gst_message_new_custom):
Clean up debugging info
* gst/gstqueue.c: (gst_queue_link_src), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query):
Pause task faster.
2005-10-20 11:48:53 +00:00
|
|
|
GST_DEBUG_OBJECT (queue, "starting task as pad is linked");
|
docs/design/part-seeking.txt: Some small additions.
Original commit message from CVS:
* docs/design/part-seeking.txt:
Some small additions.
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_get_times), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesink.h:
discont values are gint64, handle the math correctly.
* gst/base/gstbasesrc.c: (gst_base_src_loop):
Make the basesrc report error if the source pad is not linked.
* gst/gstqueue.c: (gst_queue_link_src), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_src_activate_push):
Make queue collect data even if the srcpad is not linked.
Start pushing out data as soon as it is linked.
* gst/gstutils.c: (gst_element_unlink), (gst_flow_get_name):
* gst/gstutils.h:
Added gst_flow_get_name() to ease error reporting.
2005-07-21 17:22:13 +00:00
|
|
|
} else {
|
gst/base/gstbasesink.c: Speed up current position calculation.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_get_position),
(gst_base_sink_query):
Speed up current position calculation.
* gst/base/gstbasesrc.c: (gst_base_src_query),
(gst_base_src_default_newsegment):
Correctly set stream position in newsegment.
* gst/gstbin.c: (gst_bin_add_func), (add_to_queue),
(update_degree), (gst_bin_sort_iterator_next),
(gst_bin_sort_iterator_resync), (gst_bin_sort_iterator_free):
* gst/gstmessage.c: (gst_message_new_custom):
Clean up debugging info
* gst/gstqueue.c: (gst_queue_link_src), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query):
Pause task faster.
2005-10-20 11:48:53 +00:00
|
|
|
GST_DEBUG_OBJECT (queue, "not starting task reason %s",
|
docs/design/part-seeking.txt: Some small additions.
Original commit message from CVS:
* docs/design/part-seeking.txt:
Some small additions.
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_get_times), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesink.h:
discont values are gint64, handle the math correctly.
* gst/base/gstbasesrc.c: (gst_base_src_loop):
Make the basesrc report error if the source pad is not linked.
* gst/gstqueue.c: (gst_queue_link_src), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_src_activate_push):
Make queue collect data even if the srcpad is not linked.
Start pushing out data as soon as it is linked.
* gst/gstutils.c: (gst_element_unlink), (gst_flow_get_name):
* gst/gstutils.h:
Added gst_flow_get_name() to ease error reporting.
2005-07-21 17:22:13 +00:00
|
|
|
gst_flow_get_name (queue->srcresult));
|
|
|
|
}
|
|
|
|
GST_QUEUE_MUTEX_UNLOCK (queue);
|
|
|
|
}
|
|
|
|
gst_object_unref (queue);
|
2005-01-08 18:10:50 +00:00
|
|
|
|
2005-03-21 17:34:02 +00:00
|
|
|
return result;
|
2005-01-08 18:10:50 +00:00
|
|
|
}
|
|
|
|
|
gst/: Bufferalloc: return GstFlowReturn to more accuratly report why allocation failed.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_basesink_pad_buffer_alloc),
(gst_base_sink_buffer_alloc), (gst_basesink_preroll_queue_push),
(gst_basesink_activate):
* gst/base/gstbasesink.h:
* gst/gstpad.c: (gst_pad_set_active), (gst_pad_link_prepare),
(gst_pad_link), (gst_pad_accept_caps), (gst_pad_alloc_buffer),
(gst_pad_query), (gst_pad_start_task):
* gst/gstpad.h:
* gst/gstqueue.c: (gst_queue_bufferalloc),
(gst_queue_handle_sink_event), (gst_queue_chain):
Bufferalloc: return GstFlowReturn to more accuratly report
why allocation failed.
2005-06-02 09:42:02 +00:00
|
|
|
static GstFlowReturn
|
|
|
|
gst_queue_bufferalloc (GstPad * pad, guint64 offset, guint size, GstCaps * caps,
|
|
|
|
GstBuffer ** buf)
|
2004-01-11 22:11:35 +00:00
|
|
|
{
|
|
|
|
GstQueue *queue;
|
gst/: Bufferalloc: return GstFlowReturn to more accuratly report why allocation failed.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_basesink_pad_buffer_alloc),
(gst_base_sink_buffer_alloc), (gst_basesink_preroll_queue_push),
(gst_basesink_activate):
* gst/base/gstbasesink.h:
* gst/gstpad.c: (gst_pad_set_active), (gst_pad_link_prepare),
(gst_pad_link), (gst_pad_accept_caps), (gst_pad_alloc_buffer),
(gst_pad_query), (gst_pad_start_task):
* gst/gstpad.h:
* gst/gstqueue.c: (gst_queue_bufferalloc),
(gst_queue_handle_sink_event), (gst_queue_chain):
Bufferalloc: return GstFlowReturn to more accuratly report
why allocation failed.
2005-06-02 09:42:02 +00:00
|
|
|
GstFlowReturn result;
|
2004-01-11 22:11:35 +00:00
|
|
|
|
2005-03-21 17:34:02 +00:00
|
|
|
queue = GST_QUEUE (GST_PAD_PARENT (pad));
|
2004-01-11 22:11:35 +00:00
|
|
|
|
2005-12-05 13:01:35 +00:00
|
|
|
result =
|
|
|
|
gst_pad_alloc_buffer_and_set_caps (queue->srcpad, offset, size, caps,
|
|
|
|
buf);
|
2004-01-11 22:11:35 +00:00
|
|
|
|
2005-03-21 17:34:02 +00:00
|
|
|
return result;
|
2004-01-11 22:11:35 +00:00
|
|
|
}
|
|
|
|
|
2005-03-21 17:34:02 +00:00
|
|
|
|
2001-01-20 17:59:25 +00:00
|
|
|
static void
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_queue_locked_flush (GstQueue * queue)
|
2000-11-25 14:18:47 +00:00
|
|
|
{
|
2003-12-13 17:12:46 +00:00
|
|
|
while (!g_queue_is_empty (queue->queue)) {
|
check/Makefile.am: remove GstData checks
Original commit message from CVS:
* check/Makefile.am: remove GstData checks
* check/gst-libs/gdp.c: (START_TEST): fix for API changes
* gst/Makefile.am: add miniobject, remove data
* gst/gst.h: add miniobject, remove data
* gst/gstdata.c: remove
* gst/gstdata.h: remove
* gst/gstdata_private.h: remove
* gst/gsttypes.h: remove GstEvent and GstMessage
* gst/gstelement.c: (gst_element_post_message): fix for API changes
* gst/gstmarshal.list: change BOXED -> OBJECT
Implement GstMiniObject.
* gst/gstminiobject.c:
* gst/gstminiobject.h:
Modify to be subclasses of GstMiniObject.
* gst/gstbuffer.c: (_gst_buffer_initialize), (gst_buffer_get_type),
(gst_buffer_class_init), (gst_buffer_finalize), (_gst_buffer_copy),
(gst_buffer_init), (gst_buffer_new), (gst_buffer_new_and_alloc),
(gst_subbuffer_get_type), (gst_subbuffer_init),
(gst_buffer_create_sub), (gst_buffer_is_span_fast),
(gst_buffer_span):
* gst/gstbuffer.h:
* gst/gstevent.c: (_gst_event_initialize), (gst_event_get_type),
(gst_event_class_init), (gst_event_init), (gst_event_finalize),
(_gst_event_copy), (gst_event_new):
* gst/gstevent.h:
* gst/gstmessage.c: (_gst_message_initialize),
(gst_message_get_type), (gst_message_class_init),
(gst_message_init), (gst_message_finalize), (_gst_message_copy),
(gst_message_new), (gst_message_new_error),
(gst_message_new_warning), (gst_message_new_tag),
(gst_message_new_state_changed), (gst_message_new_application):
* gst/gstmessage.h:
* gst/gstprobe.c: (gst_probe_perform),
(gst_probe_dispatcher_dispatch):
* gst/gstprobe.h:
* gst/gstquery.c: (_gst_query_initialize), (gst_query_get_type),
(gst_query_class_init), (gst_query_finalize), (gst_query_init),
(_gst_query_copy), (gst_query_new):
Update elements for GstData -> GstMiniObject changes
* gst/gstquery.h:
* gst/gstqueue.c: (gst_queue_finalize), (gst_queue_locked_flush),
(gst_queue_chain), (gst_queue_loop):
* gst/elements/gstbufferstore.c:
(gst_buffer_store_add_buffer_func),
(gst_buffer_store_cleared_func), (gst_buffer_store_get_buffer):
* gst/elements/gstfakesink.c: (gst_fakesink_class_init),
(gst_fakesink_render):
* gst/elements/gstfakesrc.c: (gst_fakesrc_class_init):
* gst/elements/gstfilesrc.c: (gst_mmap_buffer_get_type),
(gst_mmap_buffer_class_init), (gst_mmap_buffer_init),
(gst_mmap_buffer_finalize), (gst_filesrc_map_region),
(gst_filesrc_create_read):
* gst/elements/gstidentity.c: (gst_identity_class_init):
* gst/elements/gsttypefindelement.c:
(gst_type_find_element_src_event), (free_entry_buffers),
(gst_type_find_element_handle_event):
* libs/gst/dataprotocol/dataprotocol.c:
(gst_dp_header_from_buffer):
* libs/gst/dataprotocol/dataprotocol.h:
* libs/gst/dataprotocol/dp-private.h:
2005-05-16 20:21:55 +00:00
|
|
|
GstMiniObject *data = g_queue_pop_head (queue->queue);
|
2004-03-13 15:27:01 +00:00
|
|
|
|
2005-10-24 09:13:27 +00:00
|
|
|
/* Then lose another reference because we are supposed to destroy that
|
2004-02-09 09:11:50 +00:00
|
|
|
data when flushing */
|
check/Makefile.am: remove GstData checks
Original commit message from CVS:
* check/Makefile.am: remove GstData checks
* check/gst-libs/gdp.c: (START_TEST): fix for API changes
* gst/Makefile.am: add miniobject, remove data
* gst/gst.h: add miniobject, remove data
* gst/gstdata.c: remove
* gst/gstdata.h: remove
* gst/gstdata_private.h: remove
* gst/gsttypes.h: remove GstEvent and GstMessage
* gst/gstelement.c: (gst_element_post_message): fix for API changes
* gst/gstmarshal.list: change BOXED -> OBJECT
Implement GstMiniObject.
* gst/gstminiobject.c:
* gst/gstminiobject.h:
Modify to be subclasses of GstMiniObject.
* gst/gstbuffer.c: (_gst_buffer_initialize), (gst_buffer_get_type),
(gst_buffer_class_init), (gst_buffer_finalize), (_gst_buffer_copy),
(gst_buffer_init), (gst_buffer_new), (gst_buffer_new_and_alloc),
(gst_subbuffer_get_type), (gst_subbuffer_init),
(gst_buffer_create_sub), (gst_buffer_is_span_fast),
(gst_buffer_span):
* gst/gstbuffer.h:
* gst/gstevent.c: (_gst_event_initialize), (gst_event_get_type),
(gst_event_class_init), (gst_event_init), (gst_event_finalize),
(_gst_event_copy), (gst_event_new):
* gst/gstevent.h:
* gst/gstmessage.c: (_gst_message_initialize),
(gst_message_get_type), (gst_message_class_init),
(gst_message_init), (gst_message_finalize), (_gst_message_copy),
(gst_message_new), (gst_message_new_error),
(gst_message_new_warning), (gst_message_new_tag),
(gst_message_new_state_changed), (gst_message_new_application):
* gst/gstmessage.h:
* gst/gstprobe.c: (gst_probe_perform),
(gst_probe_dispatcher_dispatch):
* gst/gstprobe.h:
* gst/gstquery.c: (_gst_query_initialize), (gst_query_get_type),
(gst_query_class_init), (gst_query_finalize), (gst_query_init),
(_gst_query_copy), (gst_query_new):
Update elements for GstData -> GstMiniObject changes
* gst/gstquery.h:
* gst/gstqueue.c: (gst_queue_finalize), (gst_queue_locked_flush),
(gst_queue_chain), (gst_queue_loop):
* gst/elements/gstbufferstore.c:
(gst_buffer_store_add_buffer_func),
(gst_buffer_store_cleared_func), (gst_buffer_store_get_buffer):
* gst/elements/gstfakesink.c: (gst_fakesink_class_init),
(gst_fakesink_render):
* gst/elements/gstfakesrc.c: (gst_fakesrc_class_init):
* gst/elements/gstfilesrc.c: (gst_mmap_buffer_get_type),
(gst_mmap_buffer_class_init), (gst_mmap_buffer_init),
(gst_mmap_buffer_finalize), (gst_filesrc_map_region),
(gst_filesrc_create_read):
* gst/elements/gstidentity.c: (gst_identity_class_init):
* gst/elements/gsttypefindelement.c:
(gst_type_find_element_src_event), (free_entry_buffers),
(gst_type_find_element_handle_event):
* libs/gst/dataprotocol/dataprotocol.c:
(gst_dp_header_from_buffer):
* libs/gst/dataprotocol/dataprotocol.h:
* libs/gst/dataprotocol/dp-private.h:
2005-05-16 20:21:55 +00:00
|
|
|
gst_mini_object_unref (data);
|
2002-07-08 19:22:02 +00:00
|
|
|
}
|
2003-12-13 17:12:46 +00:00
|
|
|
queue->cur_level.buffers = 0;
|
|
|
|
queue->cur_level.bytes = 0;
|
|
|
|
queue->cur_level.time = 0;
|
plugins/elements/gstqueue.*: In queue, when EOS is received, if minimum threshold > max_size - current_level, there i...
Original commit message from CVS:
Patch by Tommi Myöhänen <ext-tommi dot myohanen at nokia dot com>
* plugins/elements/gstqueue.c: (gst_queue_init),
(gst_queue_locked_flush), (gst_queue_handle_sink_event),
(gst_queue_set_property):
* plugins/elements/gstqueue.h:
In queue, when EOS is received, if minimum threshold > max_size -
current_level, there is chance that queue blocks forever in conditional item
del wait. This is because the queue is not emptied completely due to minimum
threshold.
Here is another approach. Instead of setting cur_levels to max in EOS, just
zero all minimum threshold levels. This should make sure that queue gives out
all data. When going to READY (stop) state, just reset the original minimum
threshold levels.
Fixes #336336.
2006-03-29 11:02:33 +00:00
|
|
|
queue->min_threshold.buffers = queue->orig_min_threshold.buffers;
|
|
|
|
queue->min_threshold.bytes = queue->orig_min_threshold.bytes;
|
|
|
|
queue->min_threshold.time = queue->orig_min_threshold.time;
|
2003-12-13 17:12:46 +00:00
|
|
|
|
|
|
|
/* we deleted something... */
|
|
|
|
g_cond_signal (queue->item_del);
|
2000-10-30 21:02:08 +00:00
|
|
|
}
|
|
|
|
|
2005-03-21 17:34:02 +00:00
|
|
|
static gboolean
|
|
|
|
gst_queue_handle_sink_event (GstPad * pad, GstEvent * event)
|
2003-12-14 13:14:35 +00:00
|
|
|
{
|
2005-03-21 17:34:02 +00:00
|
|
|
GstQueue *queue;
|
2005-10-28 10:45:33 +00:00
|
|
|
gboolean have_eos = FALSE;
|
2005-03-21 17:34:02 +00:00
|
|
|
|
|
|
|
queue = GST_QUEUE (GST_OBJECT_PARENT (pad));
|
|
|
|
|
|
|
|
switch (GST_EVENT_TYPE (event)) {
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
case GST_EVENT_FLUSH_START:
|
2006-01-19 13:30:31 +00:00
|
|
|
STATUS (queue, pad, "received flush start event");
|
2005-10-24 15:41:48 +00:00
|
|
|
/* forward event */
|
2005-07-17 22:22:52 +00:00
|
|
|
gst_pad_push_event (queue->srcpad, event);
|
gst/base/gstbasesrc.*: Add a gboolean to decide when to push out a discont.
Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_do_seek), (gst_base_src_loop), (gst_base_src_start):
* gst/base/gstbasesrc.h:
Add a gboolean to decide when to push out a discont.
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_sink_activate_push), (gst_queue_src_activate_push),
(gst_queue_set_property), (gst_queue_get_property):
Some cleanups.
* tests/threadstate/threadstate1.c: (main):
Make a thread test compile and run... very silly..
2005-07-20 10:58:10 +00:00
|
|
|
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
/* now unblock the chain function */
|
|
|
|
GST_QUEUE_MUTEX_LOCK (queue);
|
|
|
|
queue->srcresult = GST_FLOW_WRONG_STATE;
|
2005-08-23 18:17:01 +00:00
|
|
|
/* unblock the loop and chain functions */
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
g_cond_signal (queue->item_add);
|
2005-08-23 18:17:01 +00:00
|
|
|
g_cond_signal (queue->item_del);
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
GST_QUEUE_MUTEX_UNLOCK (queue);
|
2005-03-21 17:34:02 +00:00
|
|
|
|
2006-02-28 10:52:02 +00:00
|
|
|
/* make sure it pauses, this should happen since we sent
|
|
|
|
* flush_start downstream. */
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
gst_pad_pause_task (queue->srcpad);
|
|
|
|
GST_CAT_LOG_OBJECT (queue_dataflow, queue, "loop stopped");
|
|
|
|
goto done;
|
|
|
|
case GST_EVENT_FLUSH_STOP:
|
2006-01-19 13:30:31 +00:00
|
|
|
STATUS (queue, pad, "received flush stop event");
|
2005-10-24 15:41:48 +00:00
|
|
|
/* forward event */
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
gst_pad_push_event (queue->srcpad, event);
|
|
|
|
|
|
|
|
GST_QUEUE_MUTEX_LOCK (queue);
|
|
|
|
gst_queue_locked_flush (queue);
|
|
|
|
queue->srcresult = GST_FLOW_OK;
|
2005-08-22 18:48:48 +00:00
|
|
|
if (gst_pad_is_linked (queue->srcpad)) {
|
|
|
|
gst_pad_start_task (queue->srcpad, (GstTaskFunction) gst_queue_loop,
|
|
|
|
queue->srcpad);
|
|
|
|
} else {
|
|
|
|
GST_DEBUG_OBJECT (queue, "not re-starting task as pad is not linked");
|
|
|
|
}
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
GST_QUEUE_MUTEX_UNLOCK (queue);
|
|
|
|
|
2006-01-19 13:30:31 +00:00
|
|
|
STATUS (queue, pad, "after flush");
|
2005-03-21 17:34:02 +00:00
|
|
|
goto done;
|
|
|
|
case GST_EVENT_EOS:
|
2006-01-19 13:30:31 +00:00
|
|
|
STATUS (queue, pad, "received EOS");
|
2005-10-28 10:45:33 +00:00
|
|
|
have_eos = TRUE;
|
2005-03-21 17:34:02 +00:00
|
|
|
break;
|
|
|
|
default:
|
2005-08-18 15:31:28 +00:00
|
|
|
if (GST_EVENT_IS_SERIALIZED (event)) {
|
|
|
|
/* we put the event in the queue, we don't have to act ourselves */
|
|
|
|
GST_CAT_LOG_OBJECT (queue_dataflow, queue,
|
|
|
|
"adding event %p of type %d", event, GST_EVENT_TYPE (event));
|
|
|
|
} else {
|
|
|
|
gst_pad_push_event (queue->srcpad, event);
|
|
|
|
goto done;
|
|
|
|
}
|
2004-06-11 15:18:58 +00:00
|
|
|
break;
|
2003-12-14 13:14:35 +00:00
|
|
|
}
|
2005-03-21 17:34:02 +00:00
|
|
|
|
gst/base/gstbasesrc.*: Add a gboolean to decide when to push out a discont.
Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_do_seek), (gst_base_src_loop), (gst_base_src_start):
* gst/base/gstbasesrc.h:
Add a gboolean to decide when to push out a discont.
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_sink_activate_push), (gst_queue_src_activate_push),
(gst_queue_set_property), (gst_queue_get_property):
Some cleanups.
* tests/threadstate/threadstate1.c: (main):
Make a thread test compile and run... very silly..
2005-07-20 10:58:10 +00:00
|
|
|
GST_QUEUE_MUTEX_LOCK (queue);
|
2005-10-28 10:45:33 +00:00
|
|
|
if (have_eos) {
|
plugins/elements/gstqueue.*: In queue, when EOS is received, if minimum threshold > max_size - current_level, there i...
Original commit message from CVS:
Patch by Tommi Myöhänen <ext-tommi dot myohanen at nokia dot com>
* plugins/elements/gstqueue.c: (gst_queue_init),
(gst_queue_locked_flush), (gst_queue_handle_sink_event),
(gst_queue_set_property):
* plugins/elements/gstqueue.h:
In queue, when EOS is received, if minimum threshold > max_size -
current_level, there is chance that queue blocks forever in conditional item
del wait. This is because the queue is not emptied completely due to minimum
threshold.
Here is another approach. Instead of setting cur_levels to max in EOS, just
zero all minimum threshold levels. This should make sure that queue gives out
all data. When going to READY (stop) state, just reset the original minimum
threshold levels.
Fixes #336336.
2006-03-29 11:02:33 +00:00
|
|
|
/* Zero the thresholds, this makes sure the queue is completely
|
|
|
|
* filled and we can read all data from the queue. */
|
|
|
|
queue->min_threshold.buffers = 0;
|
|
|
|
queue->min_threshold.bytes = 0;
|
|
|
|
queue->min_threshold.time = 0;
|
2005-10-28 10:45:33 +00:00
|
|
|
}
|
2005-03-21 17:34:02 +00:00
|
|
|
g_queue_push_tail (queue->queue, event);
|
|
|
|
g_cond_signal (queue->item_add);
|
gst/base/gstbasesrc.*: Add a gboolean to decide when to push out a discont.
Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_do_seek), (gst_base_src_loop), (gst_base_src_start):
* gst/base/gstbasesrc.h:
Add a gboolean to decide when to push out a discont.
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_sink_activate_push), (gst_queue_src_activate_push),
(gst_queue_set_property), (gst_queue_get_property):
Some cleanups.
* tests/threadstate/threadstate1.c: (main):
Make a thread test compile and run... very silly..
2005-07-20 10:58:10 +00:00
|
|
|
GST_QUEUE_MUTEX_UNLOCK (queue);
|
2005-03-21 17:34:02 +00:00
|
|
|
|
|
|
|
done:
|
|
|
|
|
|
|
|
return TRUE;
|
2003-12-14 13:14:35 +00:00
|
|
|
}
|
|
|
|
|
2005-03-21 17:34:02 +00:00
|
|
|
static gboolean
|
|
|
|
gst_queue_is_empty (GstQueue * queue)
|
2000-11-25 14:18:47 +00:00
|
|
|
{
|
2005-03-21 17:34:02 +00:00
|
|
|
return (queue->queue->length == 0 ||
|
|
|
|
(queue->min_threshold.buffers > 0 &&
|
|
|
|
queue->cur_level.buffers < queue->min_threshold.buffers) ||
|
|
|
|
(queue->min_threshold.bytes > 0 &&
|
|
|
|
queue->cur_level.bytes < queue->min_threshold.bytes) ||
|
|
|
|
(queue->min_threshold.time > 0 &&
|
|
|
|
queue->cur_level.time < queue->min_threshold.time));
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_queue_is_filled (GstQueue * queue)
|
|
|
|
{
|
|
|
|
return (((queue->max_size.buffers > 0 &&
|
|
|
|
queue->cur_level.buffers >= queue->max_size.buffers) ||
|
|
|
|
(queue->max_size.bytes > 0 &&
|
|
|
|
queue->cur_level.bytes >= queue->max_size.bytes) ||
|
|
|
|
(queue->max_size.time > 0 &&
|
|
|
|
queue->cur_level.time >= queue->max_size.time)));
|
|
|
|
}
|
|
|
|
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2005-03-21 17:34:02 +00:00
|
|
|
static GstFlowReturn
|
|
|
|
gst_queue_chain (GstPad * pad, GstBuffer * buffer)
|
|
|
|
{
|
|
|
|
GstQueue *queue;
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2001-01-29 00:06:02 +00:00
|
|
|
queue = GST_QUEUE (GST_OBJECT_PARENT (pad));
|
2004-03-13 15:27:01 +00:00
|
|
|
|
2001-10-27 20:28:31 +00:00
|
|
|
/* we have to lock the queue since we span threads */
|
gst/base/gstbasesrc.*: Add a gboolean to decide when to push out a discont.
Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_do_seek), (gst_base_src_loop), (gst_base_src_start):
* gst/base/gstbasesrc.h:
Add a gboolean to decide when to push out a discont.
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_sink_activate_push), (gst_queue_src_activate_push),
(gst_queue_set_property), (gst_queue_get_property):
Some cleanups.
* tests/threadstate/threadstate1.c: (main):
Make a thread test compile and run... very silly..
2005-07-20 10:58:10 +00:00
|
|
|
GST_QUEUE_MUTEX_LOCK_CHECK (queue, out_flushing);
|
2005-07-19 17:46:37 +00:00
|
|
|
|
2005-03-21 17:34:02 +00:00
|
|
|
GST_CAT_LOG_OBJECT (queue_dataflow, queue,
|
|
|
|
"adding buffer %p of size %d", buffer, GST_BUFFER_SIZE (buffer));
|
2003-12-13 17:12:46 +00:00
|
|
|
|
|
|
|
/* We make space available if we're "full" according to whatever
|
|
|
|
* the user defined as "full". Note that this only applies to buffers.
|
|
|
|
* We always handle events and they don't count in our statistics. */
|
2005-03-21 17:34:02 +00:00
|
|
|
while (gst_queue_is_filled (queue)) {
|
gst/base/gstbasesrc.*: Add a gboolean to decide when to push out a discont.
Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_do_seek), (gst_base_src_loop), (gst_base_src_start):
* gst/base/gstbasesrc.h:
Add a gboolean to decide when to push out a discont.
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_sink_activate_push), (gst_queue_src_activate_push),
(gst_queue_set_property), (gst_queue_get_property):
Some cleanups.
* tests/threadstate/threadstate1.c: (main):
Make a thread test compile and run... very silly..
2005-07-20 10:58:10 +00:00
|
|
|
GST_QUEUE_MUTEX_UNLOCK (queue);
|
2003-12-13 17:12:46 +00:00
|
|
|
g_signal_emit (G_OBJECT (queue), gst_queue_signals[SIGNAL_OVERRUN], 0);
|
gst/base/gstbasesrc.*: Add a gboolean to decide when to push out a discont.
Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_do_seek), (gst_base_src_loop), (gst_base_src_start):
* gst/base/gstbasesrc.h:
Add a gboolean to decide when to push out a discont.
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_sink_activate_push), (gst_queue_src_activate_push),
(gst_queue_set_property), (gst_queue_get_property):
Some cleanups.
* tests/threadstate/threadstate1.c: (main):
Make a thread test compile and run... very silly..
2005-07-20 10:58:10 +00:00
|
|
|
GST_QUEUE_MUTEX_LOCK_CHECK (queue, out_flushing);
|
2005-07-19 17:46:37 +00:00
|
|
|
|
2003-12-13 17:12:46 +00:00
|
|
|
/* how are we going to make space for this buffer? */
|
|
|
|
switch (queue->leaky) {
|
2004-03-15 19:27:17 +00:00
|
|
|
/* leak current buffer */
|
2003-12-13 17:12:46 +00:00
|
|
|
case GST_QUEUE_LEAK_UPSTREAM:
|
gst/elements/gstfilesrc.c: compute mapsize correctly
Original commit message from CVS:
* gst/elements/gstfilesrc.c: (gst_filesrc_get_mmap):
compute mapsize correctly
* gst/elements/gstfilesrc.c: (gst_filesrc_get_mmap):
use correct datatypes when calling a varargs function
* gst/elements/gsttypefindelement.c: (stop_typefinding):
push a DISCONT event as first thing
* gst/gst_private.h:
* gst/gstinfo.c: (_gst_debug_init):
remove GST_DATAFLOW debugging category
* gst/gstbin.c: (gst_bin_iterate):
use GST_SCHEDULING category
* gst/gstpad.c: (gst_pad_get_type), (_invent_event),
(gst_pad_push), (gst_pad_pull), (gst_pad_call_chain_function),
(gst_pad_call_get_function):
add GST_DATAFLOW to easily track flow of buffers or events.
* gst/gstqueue.c: (gst_queue_get_type),
(gst_queue_handle_pending_events), (gst_queue_chain),
(gst_queue_get), (gst_queue_handle_src_event):
use own static debugging category GST_DATAFLOW for dataflow,
use DEBUG category for showing which path events go, use LOG
category for buffers.
2004-05-11 16:20:41 +00:00
|
|
|
GST_CAT_DEBUG_OBJECT (queue_dataflow, queue,
|
2004-03-15 19:27:17 +00:00
|
|
|
"queue is full, leaking buffer on upstream end");
|
|
|
|
/* now we can clean up and exit right away */
|
|
|
|
goto out_unref;
|
2004-03-13 15:27:01 +00:00
|
|
|
|
2004-03-15 19:27:17 +00:00
|
|
|
/* leak first buffer in the queue */
|
2004-03-13 15:27:01 +00:00
|
|
|
case GST_QUEUE_LEAK_DOWNSTREAM:{
|
2004-03-15 19:27:17 +00:00
|
|
|
/* this is a bit hacky. We'll manually iterate the list
|
|
|
|
* and find the first buffer from the head on. We'll
|
|
|
|
* unref that and "fix up" the GQueue object... */
|
|
|
|
GList *item;
|
check/Makefile.am: remove GstData checks
Original commit message from CVS:
* check/Makefile.am: remove GstData checks
* check/gst-libs/gdp.c: (START_TEST): fix for API changes
* gst/Makefile.am: add miniobject, remove data
* gst/gst.h: add miniobject, remove data
* gst/gstdata.c: remove
* gst/gstdata.h: remove
* gst/gstdata_private.h: remove
* gst/gsttypes.h: remove GstEvent and GstMessage
* gst/gstelement.c: (gst_element_post_message): fix for API changes
* gst/gstmarshal.list: change BOXED -> OBJECT
Implement GstMiniObject.
* gst/gstminiobject.c:
* gst/gstminiobject.h:
Modify to be subclasses of GstMiniObject.
* gst/gstbuffer.c: (_gst_buffer_initialize), (gst_buffer_get_type),
(gst_buffer_class_init), (gst_buffer_finalize), (_gst_buffer_copy),
(gst_buffer_init), (gst_buffer_new), (gst_buffer_new_and_alloc),
(gst_subbuffer_get_type), (gst_subbuffer_init),
(gst_buffer_create_sub), (gst_buffer_is_span_fast),
(gst_buffer_span):
* gst/gstbuffer.h:
* gst/gstevent.c: (_gst_event_initialize), (gst_event_get_type),
(gst_event_class_init), (gst_event_init), (gst_event_finalize),
(_gst_event_copy), (gst_event_new):
* gst/gstevent.h:
* gst/gstmessage.c: (_gst_message_initialize),
(gst_message_get_type), (gst_message_class_init),
(gst_message_init), (gst_message_finalize), (_gst_message_copy),
(gst_message_new), (gst_message_new_error),
(gst_message_new_warning), (gst_message_new_tag),
(gst_message_new_state_changed), (gst_message_new_application):
* gst/gstmessage.h:
* gst/gstprobe.c: (gst_probe_perform),
(gst_probe_dispatcher_dispatch):
* gst/gstprobe.h:
* gst/gstquery.c: (_gst_query_initialize), (gst_query_get_type),
(gst_query_class_init), (gst_query_finalize), (gst_query_init),
(_gst_query_copy), (gst_query_new):
Update elements for GstData -> GstMiniObject changes
* gst/gstquery.h:
* gst/gstqueue.c: (gst_queue_finalize), (gst_queue_locked_flush),
(gst_queue_chain), (gst_queue_loop):
* gst/elements/gstbufferstore.c:
(gst_buffer_store_add_buffer_func),
(gst_buffer_store_cleared_func), (gst_buffer_store_get_buffer):
* gst/elements/gstfakesink.c: (gst_fakesink_class_init),
(gst_fakesink_render):
* gst/elements/gstfakesrc.c: (gst_fakesrc_class_init):
* gst/elements/gstfilesrc.c: (gst_mmap_buffer_get_type),
(gst_mmap_buffer_class_init), (gst_mmap_buffer_init),
(gst_mmap_buffer_finalize), (gst_filesrc_map_region),
(gst_filesrc_create_read):
* gst/elements/gstidentity.c: (gst_identity_class_init):
* gst/elements/gsttypefindelement.c:
(gst_type_find_element_src_event), (free_entry_buffers),
(gst_type_find_element_handle_event):
* libs/gst/dataprotocol/dataprotocol.c:
(gst_dp_header_from_buffer):
* libs/gst/dataprotocol/dataprotocol.h:
* libs/gst/dataprotocol/dp-private.h:
2005-05-16 20:21:55 +00:00
|
|
|
GstMiniObject *leak = NULL;
|
2004-03-15 19:27:17 +00:00
|
|
|
|
gst/elements/gstfilesrc.c: compute mapsize correctly
Original commit message from CVS:
* gst/elements/gstfilesrc.c: (gst_filesrc_get_mmap):
compute mapsize correctly
* gst/elements/gstfilesrc.c: (gst_filesrc_get_mmap):
use correct datatypes when calling a varargs function
* gst/elements/gsttypefindelement.c: (stop_typefinding):
push a DISCONT event as first thing
* gst/gst_private.h:
* gst/gstinfo.c: (_gst_debug_init):
remove GST_DATAFLOW debugging category
* gst/gstbin.c: (gst_bin_iterate):
use GST_SCHEDULING category
* gst/gstpad.c: (gst_pad_get_type), (_invent_event),
(gst_pad_push), (gst_pad_pull), (gst_pad_call_chain_function),
(gst_pad_call_get_function):
add GST_DATAFLOW to easily track flow of buffers or events.
* gst/gstqueue.c: (gst_queue_get_type),
(gst_queue_handle_pending_events), (gst_queue_chain),
(gst_queue_get), (gst_queue_handle_src_event):
use own static debugging category GST_DATAFLOW for dataflow,
use DEBUG category for showing which path events go, use LOG
category for buffers.
2004-05-11 16:20:41 +00:00
|
|
|
GST_CAT_DEBUG_OBJECT (queue_dataflow, queue,
|
2004-03-15 19:27:17 +00:00
|
|
|
"queue is full, leaking buffer on downstream end");
|
|
|
|
|
2005-10-31 09:52:13 +00:00
|
|
|
for (item = g_queue_peek_head_link (queue->queue); item;
|
|
|
|
item = item->next) {
|
2004-03-15 19:27:17 +00:00
|
|
|
if (GST_IS_BUFFER (item->data)) {
|
|
|
|
leak = item->data;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* if we didn't find anything, it means we have no buffers
|
|
|
|
* in here. That cannot happen, since we had >= 1 bufs */
|
|
|
|
g_assert (leak);
|
|
|
|
|
2005-10-31 09:52:13 +00:00
|
|
|
/* Now remove the link from the queue */
|
|
|
|
g_queue_delete_link (queue->queue, item);
|
2004-03-15 19:27:17 +00:00
|
|
|
|
2005-03-21 17:34:02 +00:00
|
|
|
/* and unref the buffer at the end. Twice, because we keep a ref
|
2004-03-15 19:27:17 +00:00
|
|
|
* to make things read-only. Also keep our list uptodate. */
|
2005-10-31 09:52:13 +00:00
|
|
|
queue->cur_level.bytes -= GST_BUFFER_SIZE (leak);
|
2004-03-15 19:27:17 +00:00
|
|
|
queue->cur_level.buffers--;
|
2005-10-31 09:52:13 +00:00
|
|
|
if (GST_BUFFER_DURATION (leak) != GST_CLOCK_TIME_NONE)
|
|
|
|
queue->cur_level.time -= GST_BUFFER_DURATION (leak);
|
2004-03-15 19:27:17 +00:00
|
|
|
|
2005-10-31 09:52:13 +00:00
|
|
|
gst_buffer_unref (leak);
|
2004-03-15 19:27:17 +00:00
|
|
|
break;
|
2001-05-25 21:00:07 +00:00
|
|
|
}
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2003-12-13 17:12:46 +00:00
|
|
|
default:
|
2004-03-15 19:27:17 +00:00
|
|
|
g_warning ("Unknown leaky type, using default");
|
|
|
|
/* fall-through */
|
2003-12-13 17:12:46 +00:00
|
|
|
|
2004-03-15 19:27:17 +00:00
|
|
|
/* don't leak. Instead, wait for space to be available */
|
2003-12-13 17:12:46 +00:00
|
|
|
case GST_QUEUE_NO_LEAK:
|
2006-01-19 13:30:31 +00:00
|
|
|
STATUS (queue, pad, "pre-full wait");
|
2004-03-15 19:27:17 +00:00
|
|
|
|
2005-03-21 17:34:02 +00:00
|
|
|
while (gst_queue_is_filled (queue)) {
|
2006-01-19 13:30:31 +00:00
|
|
|
STATUS (queue, pad,
|
|
|
|
"waiting for item_del signal from thread using qlock");
|
2005-03-21 17:34:02 +00:00
|
|
|
g_cond_wait (queue->item_del, queue->qlock);
|
|
|
|
|
2005-07-19 17:46:37 +00:00
|
|
|
if (queue->srcresult != GST_FLOW_OK)
|
2005-05-30 15:34:13 +00:00
|
|
|
goto out_flushing;
|
gst/: Implement gst_pad_pause/start/stop_task(), take STREAM lock in task function.
Original commit message from CVS:
* gst/base/gstadapter.c: (gst_adapter_peek), (gst_adapter_flush):
* gst/base/gstbasesink.c: (gst_basesink_preroll_queue_push),
(gst_basesink_finish_preroll), (gst_basesink_chain),
(gst_basesink_loop), (gst_basesink_activate),
(gst_basesink_change_state):
* gst/base/gstbasesrc.c: (gst_basesrc_do_seek),
(gst_basesrc_get_range), (gst_basesrc_loop),
(gst_basesrc_activate):
* gst/elements/gsttee.c: (gst_tee_sink_activate):
* gst/gstpad.c: (gst_pad_dispose), (gst_real_pad_class_init),
(gst_real_pad_init), (gst_real_pad_set_property),
(gst_real_pad_get_property), (gst_pad_set_active),
(gst_pad_is_active), (gst_pad_get_query_types), (gst_pad_unlink),
(gst_pad_link_prepare), (gst_pad_link), (gst_pad_get_real_parent),
(gst_real_pad_get_caps_unlocked), (gst_pad_peer_get_caps),
(gst_pad_accept_caps), (gst_pad_get_peer), (gst_pad_realize),
(gst_pad_event_default_dispatch), (gst_pad_event_default),
(gst_pad_dispatcher), (gst_pad_query), (gst_real_pad_dispose),
(gst_pad_save_thyself), (handle_pad_block), (gst_pad_chain),
(gst_pad_push), (gst_pad_get_range), (gst_pad_pull_range),
(gst_pad_send_event), (gst_pad_start_task), (gst_pad_pause_task),
(gst_pad_stop_task):
* gst/gstpad.h:
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_src_activate):
* gst/gsttask.c: (gst_task_init), (gst_task_set_lock),
(gst_task_get_state):
* gst/gsttask.h:
* gst/schedulers/threadscheduler.c:
(gst_thread_scheduler_task_start), (gst_thread_scheduler_func):
Implement gst_pad_pause/start/stop_task(), take STREAM lock
in task function.
Remove ACTIVE pad flag, use FLUSHING everywhere
Added _pad_chain(), _pad_get_range() to call chain/getrange
functions.
Add locks around IS_FLUSHING when reading.
Take STREAM lock in chain(), get_range() functions so plugins
don't need to take it anymore.
2005-05-25 11:50:11 +00:00
|
|
|
|
2004-03-15 19:27:17 +00:00
|
|
|
/* if there's a pending state change for this queue
|
|
|
|
* or its manager, switch back to iterator so bottom
|
|
|
|
* half of state change executes */
|
2006-01-19 13:30:31 +00:00
|
|
|
STATUS (queue, pad,
|
|
|
|
"received item_del signal from thread using qlock");
|
2004-03-15 19:27:17 +00:00
|
|
|
}
|
|
|
|
|
2006-01-19 13:30:31 +00:00
|
|
|
STATUS (queue, pad, "post-full wait");
|
gst/base/gstbasesrc.*: Add a gboolean to decide when to push out a discont.
Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_do_seek), (gst_base_src_loop), (gst_base_src_start):
* gst/base/gstbasesrc.h:
Add a gboolean to decide when to push out a discont.
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_sink_activate_push), (gst_queue_src_activate_push),
(gst_queue_set_property), (gst_queue_get_property):
Some cleanups.
* tests/threadstate/threadstate1.c: (main):
Make a thread test compile and run... very silly..
2005-07-20 10:58:10 +00:00
|
|
|
GST_QUEUE_MUTEX_UNLOCK (queue);
|
2004-03-15 19:27:17 +00:00
|
|
|
g_signal_emit (G_OBJECT (queue), gst_queue_signals[SIGNAL_RUNNING], 0);
|
gst/base/gstbasesrc.*: Add a gboolean to decide when to push out a discont.
Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_do_seek), (gst_base_src_loop), (gst_base_src_start):
* gst/base/gstbasesrc.h:
Add a gboolean to decide when to push out a discont.
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_sink_activate_push), (gst_queue_src_activate_push),
(gst_queue_set_property), (gst_queue_get_property):
Some cleanups.
* tests/threadstate/threadstate1.c: (main):
Make a thread test compile and run... very silly..
2005-07-20 10:58:10 +00:00
|
|
|
GST_QUEUE_MUTEX_LOCK_CHECK (queue, out_flushing);
|
2005-07-19 17:46:37 +00:00
|
|
|
|
2004-03-15 19:27:17 +00:00
|
|
|
break;
|
2001-05-25 21:00:07 +00:00
|
|
|
}
|
2000-02-13 13:43:32 +00:00
|
|
|
}
|
|
|
|
|
2005-03-21 17:34:02 +00:00
|
|
|
g_queue_push_tail (queue->queue, buffer);
|
2002-07-08 19:22:02 +00:00
|
|
|
|
2005-03-21 17:34:02 +00:00
|
|
|
/* add buffer to the statistics */
|
|
|
|
queue->cur_level.buffers++;
|
|
|
|
queue->cur_level.bytes += GST_BUFFER_SIZE (buffer);
|
|
|
|
if (GST_BUFFER_DURATION (buffer) != GST_CLOCK_TIME_NONE)
|
|
|
|
queue->cur_level.time += GST_BUFFER_DURATION (buffer);
|
2002-07-08 19:22:02 +00:00
|
|
|
|
2006-01-19 13:30:31 +00:00
|
|
|
STATUS (queue, pad, "+ level");
|
2001-10-27 20:28:31 +00:00
|
|
|
|
gst/elements/gstfilesrc.c: compute mapsize correctly
Original commit message from CVS:
* gst/elements/gstfilesrc.c: (gst_filesrc_get_mmap):
compute mapsize correctly
* gst/elements/gstfilesrc.c: (gst_filesrc_get_mmap):
use correct datatypes when calling a varargs function
* gst/elements/gsttypefindelement.c: (stop_typefinding):
push a DISCONT event as first thing
* gst/gst_private.h:
* gst/gstinfo.c: (_gst_debug_init):
remove GST_DATAFLOW debugging category
* gst/gstbin.c: (gst_bin_iterate):
use GST_SCHEDULING category
* gst/gstpad.c: (gst_pad_get_type), (_invent_event),
(gst_pad_push), (gst_pad_pull), (gst_pad_call_chain_function),
(gst_pad_call_get_function):
add GST_DATAFLOW to easily track flow of buffers or events.
* gst/gstqueue.c: (gst_queue_get_type),
(gst_queue_handle_pending_events), (gst_queue_chain),
(gst_queue_get), (gst_queue_handle_src_event):
use own static debugging category GST_DATAFLOW for dataflow,
use DEBUG category for showing which path events go, use LOG
category for buffers.
2004-05-11 16:20:41 +00:00
|
|
|
GST_CAT_LOG_OBJECT (queue_dataflow, queue, "signalling item_add");
|
2003-12-13 17:12:46 +00:00
|
|
|
g_cond_signal (queue->item_add);
|
gst/base/gstbasesrc.*: Add a gboolean to decide when to push out a discont.
Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_do_seek), (gst_base_src_loop), (gst_base_src_start):
* gst/base/gstbasesrc.h:
Add a gboolean to decide when to push out a discont.
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_sink_activate_push), (gst_queue_src_activate_push),
(gst_queue_set_property), (gst_queue_get_property):
Some cleanups.
* tests/threadstate/threadstate1.c: (main):
Make a thread test compile and run... very silly..
2005-07-20 10:58:10 +00:00
|
|
|
GST_QUEUE_MUTEX_UNLOCK (queue);
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2005-03-21 17:34:02 +00:00
|
|
|
return GST_FLOW_OK;
|
2003-03-21 20:53:26 +00:00
|
|
|
|
2005-07-19 17:46:37 +00:00
|
|
|
/* special conditions */
|
2003-03-21 20:53:26 +00:00
|
|
|
out_unref:
|
2005-07-14 18:10:04 +00:00
|
|
|
{
|
gst/base/gstbasesrc.*: Add a gboolean to decide when to push out a discont.
Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_do_seek), (gst_base_src_loop), (gst_base_src_start):
* gst/base/gstbasesrc.h:
Add a gboolean to decide when to push out a discont.
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_sink_activate_push), (gst_queue_src_activate_push),
(gst_queue_set_property), (gst_queue_get_property):
Some cleanups.
* tests/threadstate/threadstate1.c: (main):
Make a thread test compile and run... very silly..
2005-07-20 10:58:10 +00:00
|
|
|
GST_QUEUE_MUTEX_UNLOCK (queue);
|
2005-03-21 17:34:02 +00:00
|
|
|
|
2005-07-14 18:10:04 +00:00
|
|
|
gst_buffer_unref (buffer);
|
2005-03-21 17:34:02 +00:00
|
|
|
|
2005-07-14 18:10:04 +00:00
|
|
|
return GST_FLOW_OK;
|
|
|
|
}
|
2005-03-21 17:34:02 +00:00
|
|
|
out_flushing:
|
2005-07-14 18:10:04 +00:00
|
|
|
{
|
2005-07-19 17:46:37 +00:00
|
|
|
GstFlowReturn ret = queue->srcresult;
|
|
|
|
|
|
|
|
GST_CAT_LOG_OBJECT (queue_dataflow, queue,
|
2005-10-24 15:41:48 +00:00
|
|
|
"exit because task paused, reason: %s", gst_flow_get_name (ret));
|
gst/base/gstbasesrc.*: Add a gboolean to decide when to push out a discont.
Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_do_seek), (gst_base_src_loop), (gst_base_src_start):
* gst/base/gstbasesrc.h:
Add a gboolean to decide when to push out a discont.
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_sink_activate_push), (gst_queue_src_activate_push),
(gst_queue_set_property), (gst_queue_get_property):
Some cleanups.
* tests/threadstate/threadstate1.c: (main):
Make a thread test compile and run... very silly..
2005-07-20 10:58:10 +00:00
|
|
|
GST_QUEUE_MUTEX_UNLOCK (queue);
|
2005-03-21 17:34:02 +00:00
|
|
|
|
2005-07-14 18:10:04 +00:00
|
|
|
gst_buffer_unref (buffer);
|
2005-03-21 17:34:02 +00:00
|
|
|
|
2005-07-19 17:46:37 +00:00
|
|
|
return ret;
|
2005-07-14 18:10:04 +00:00
|
|
|
}
|
2000-01-30 09:03:00 +00:00
|
|
|
}
|
|
|
|
|
2006-01-19 13:30:31 +00:00
|
|
|
static gboolean
|
|
|
|
gst_queue_push_one (GstQueue * queue)
|
2000-11-25 14:18:47 +00:00
|
|
|
{
|
2005-03-21 17:34:02 +00:00
|
|
|
gboolean restart = TRUE;
|
2006-01-19 13:30:31 +00:00
|
|
|
GstMiniObject *data;
|
2000-12-21 01:27:27 +00:00
|
|
|
|
2003-12-13 17:12:46 +00:00
|
|
|
/* There's something in the list now, whatever it is */
|
|
|
|
data = g_queue_pop_head (queue->queue);
|
gst/elements/gstfilesrc.c: compute mapsize correctly
Original commit message from CVS:
* gst/elements/gstfilesrc.c: (gst_filesrc_get_mmap):
compute mapsize correctly
* gst/elements/gstfilesrc.c: (gst_filesrc_get_mmap):
use correct datatypes when calling a varargs function
* gst/elements/gsttypefindelement.c: (stop_typefinding):
push a DISCONT event as first thing
* gst/gst_private.h:
* gst/gstinfo.c: (_gst_debug_init):
remove GST_DATAFLOW debugging category
* gst/gstbin.c: (gst_bin_iterate):
use GST_SCHEDULING category
* gst/gstpad.c: (gst_pad_get_type), (_invent_event),
(gst_pad_push), (gst_pad_pull), (gst_pad_call_chain_function),
(gst_pad_call_get_function):
add GST_DATAFLOW to easily track flow of buffers or events.
* gst/gstqueue.c: (gst_queue_get_type),
(gst_queue_handle_pending_events), (gst_queue_chain),
(gst_queue_get), (gst_queue_handle_src_event):
use own static debugging category GST_DATAFLOW for dataflow,
use DEBUG category for showing which path events go, use LOG
category for buffers.
2004-05-11 16:20:41 +00:00
|
|
|
GST_CAT_LOG_OBJECT (queue_dataflow, queue,
|
2004-03-13 15:27:01 +00:00
|
|
|
"retrieved data %p from queue", data);
|
|
|
|
|
2003-12-13 17:12:46 +00:00
|
|
|
if (GST_IS_BUFFER (data)) {
|
2005-03-21 17:34:02 +00:00
|
|
|
GstFlowReturn result;
|
|
|
|
|
2003-12-13 17:12:46 +00:00
|
|
|
/* Update statistics */
|
|
|
|
queue->cur_level.buffers--;
|
|
|
|
queue->cur_level.bytes -= GST_BUFFER_SIZE (data);
|
|
|
|
if (GST_BUFFER_DURATION (data) != GST_CLOCK_TIME_NONE)
|
|
|
|
queue->cur_level.time -= GST_BUFFER_DURATION (data);
|
2001-12-29 03:02:14 +00:00
|
|
|
|
gst/base/gstbasesrc.*: Add a gboolean to decide when to push out a discont.
Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_do_seek), (gst_base_src_loop), (gst_base_src_start):
* gst/base/gstbasesrc.h:
Add a gboolean to decide when to push out a discont.
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_sink_activate_push), (gst_queue_src_activate_push),
(gst_queue_set_property), (gst_queue_get_property):
Some cleanups.
* tests/threadstate/threadstate1.c: (main):
Make a thread test compile and run... very silly..
2005-07-20 10:58:10 +00:00
|
|
|
GST_QUEUE_MUTEX_UNLOCK (queue);
|
2006-01-19 13:30:31 +00:00
|
|
|
result = gst_pad_push (queue->srcpad, GST_BUFFER (data));
|
2005-10-24 15:41:48 +00:00
|
|
|
/* need to check for srcresult here as well */
|
|
|
|
GST_QUEUE_MUTEX_LOCK_CHECK (queue, out_flushing);
|
|
|
|
/* else result of push indicates what happens */
|
2005-03-21 17:34:02 +00:00
|
|
|
if (result != GST_FLOW_OK) {
|
docs/design/part-seeking.txt: Some small additions.
Original commit message from CVS:
* docs/design/part-seeking.txt:
Some small additions.
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_get_times), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesink.h:
discont values are gint64, handle the math correctly.
* gst/base/gstbasesrc.c: (gst_base_src_loop):
Make the basesrc report error if the source pad is not linked.
* gst/gstqueue.c: (gst_queue_link_src), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_src_activate_push):
Make queue collect data even if the srcpad is not linked.
Start pushing out data as soon as it is linked.
* gst/gstutils.c: (gst_element_unlink), (gst_flow_get_name):
* gst/gstutils.h:
Added gst_flow_get_name() to ease error reporting.
2005-07-21 17:22:13 +00:00
|
|
|
const gchar *flowname;
|
|
|
|
|
|
|
|
flowname = gst_flow_get_name (result);
|
|
|
|
|
2005-07-19 17:46:37 +00:00
|
|
|
queue->srcresult = result;
|
|
|
|
if (GST_FLOW_IS_FATAL (result)) {
|
2005-10-23 09:08:44 +00:00
|
|
|
GST_ELEMENT_ERROR (queue, STREAM, FAILED,
|
|
|
|
(_("Internal data flow error.")),
|
docs/design/part-seeking.txt: Some small additions.
Original commit message from CVS:
* docs/design/part-seeking.txt:
Some small additions.
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_get_times), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesink.h:
discont values are gint64, handle the math correctly.
* gst/base/gstbasesrc.c: (gst_base_src_loop):
Make the basesrc report error if the source pad is not linked.
* gst/gstqueue.c: (gst_queue_link_src), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_src_activate_push):
Make queue collect data even if the srcpad is not linked.
Start pushing out data as soon as it is linked.
* gst/gstutils.c: (gst_element_unlink), (gst_flow_get_name):
* gst/gstutils.h:
Added gst_flow_get_name() to ease error reporting.
2005-07-21 17:22:13 +00:00
|
|
|
("streaming stopped, reason %s", flowname));
|
Some docs updates
Original commit message from CVS:
* CHANGES-0.9:
* docs/design/part-TODO.txt:
* docs/design/part-events.txt:
Some docs updates
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_event), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesrc.c: (gst_base_src_send_discont),
(gst_base_src_do_seek), (gst_base_src_event_handler),
(gst_base_src_loop):
* gst/base/gstbasetransform.c: (gst_base_transform_transform_caps),
(gst_base_transform_configure_caps), (gst_base_transform_setcaps),
(gst_base_transform_get_size), (gst_base_transform_buffer_alloc),
(gst_base_transform_event), (gst_base_transform_handle_buffer),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough):
* gst/elements/gstfakesink.c: (gst_fake_sink_event):
* gst/elements/gstfilesink.c: (gst_file_sink_event):
Event updates.
* gst/gstbuffer.h:
Use faster casts.
* gst/gstelement.c: (gst_element_seek):
* gst/gstelement.h:
Update gst_element_seek.
* gst/gstevent.c: (gst_event_finalize), (_gst_event_copy),
(gst_event_new), (gst_event_new_custom), (gst_event_get_structure),
(gst_event_new_flush_start), (gst_event_new_flush_stop),
(gst_event_new_eos), (gst_event_new_newsegment),
(gst_event_parse_newsegment), (gst_event_new_tag),
(gst_event_parse_tag), (gst_event_new_filler), (gst_event_new_qos),
(gst_event_parse_qos), (gst_event_new_seek),
(gst_event_parse_seek), (gst_event_new_navigation):
* gst/gstevent.h:
Make GstEvent use GstStructure. Add parsing code, make sure the
API is sufficiently generic.
Mark possible directions of events and serialization.
* gst/gstmessage.c: (gst_message_init), (gst_message_finalize),
(_gst_message_copy), (gst_message_new_segment_start),
(gst_message_new_segment_done), (gst_message_new_custom),
(gst_message_parse_segment_start),
(gst_message_parse_segment_done):
Small cleanups.
* gst/gstpad.c: (gst_pad_get_caps_unlocked), (gst_pad_accept_caps),
(gst_pad_set_caps), (gst_pad_send_event):
Update for new events.
Catch events sent in wrong directions.
* gst/gstqueue.c: (gst_queue_link_src),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_handle_src_query):
Event updates.
* gst/gsttag.c:
* gst/gsttag.h:
Remove event code from this file.
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Event updates.
2005-07-27 18:33:03 +00:00
|
|
|
gst_pad_push_event (queue->srcpad, gst_event_new_eos ());
|
2005-07-19 17:46:37 +00:00
|
|
|
}
|
gst/base/gstbasesink.c: Speed up current position calculation.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_get_position),
(gst_base_sink_query):
Speed up current position calculation.
* gst/base/gstbasesrc.c: (gst_base_src_query),
(gst_base_src_default_newsegment):
Correctly set stream position in newsegment.
* gst/gstbin.c: (gst_bin_add_func), (add_to_queue),
(update_degree), (gst_bin_sort_iterator_next),
(gst_bin_sort_iterator_resync), (gst_bin_sort_iterator_free):
* gst/gstmessage.c: (gst_message_new_custom):
Clean up debugging info
* gst/gstqueue.c: (gst_queue_link_src), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query):
Pause task faster.
2005-10-20 11:48:53 +00:00
|
|
|
GST_DEBUG_OBJECT (queue, "pausing queue, reason %s", flowname);
|
2005-06-23 17:09:21 +00:00
|
|
|
gst_pad_pause_task (queue->srcpad);
|
2005-03-21 17:34:02 +00:00
|
|
|
}
|
2005-11-03 12:16:49 +00:00
|
|
|
} else if (GST_IS_EVENT (data)) {
|
2005-03-21 17:34:02 +00:00
|
|
|
if (GST_EVENT_TYPE (data) == GST_EVENT_EOS) {
|
2005-10-28 10:45:33 +00:00
|
|
|
queue->cur_level.buffers = 0;
|
|
|
|
queue->cur_level.bytes = 0;
|
|
|
|
queue->cur_level.time = 0;
|
2005-07-19 17:46:37 +00:00
|
|
|
/* all incomming data is now unexpected */
|
|
|
|
queue->srcresult = GST_FLOW_UNEXPECTED;
|
|
|
|
/* and we don't need to process anymore */
|
gst/base/gstbasesink.c: Speed up current position calculation.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_get_position),
(gst_base_sink_query):
Speed up current position calculation.
* gst/base/gstbasesrc.c: (gst_base_src_query),
(gst_base_src_default_newsegment):
Correctly set stream position in newsegment.
* gst/gstbin.c: (gst_bin_add_func), (add_to_queue),
(update_degree), (gst_bin_sort_iterator_next),
(gst_bin_sort_iterator_resync), (gst_bin_sort_iterator_free):
* gst/gstmessage.c: (gst_message_new_custom):
Clean up debugging info
* gst/gstqueue.c: (gst_queue_link_src), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query):
Pause task faster.
2005-10-20 11:48:53 +00:00
|
|
|
GST_DEBUG_OBJECT (queue, "pausing queue, we're EOS now");
|
2005-06-23 17:09:21 +00:00
|
|
|
gst_pad_pause_task (queue->srcpad);
|
2005-03-21 17:34:02 +00:00
|
|
|
restart = FALSE;
|
|
|
|
}
|
gst/base/gstbasesrc.*: Add a gboolean to decide when to push out a discont.
Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_do_seek), (gst_base_src_loop), (gst_base_src_start):
* gst/base/gstbasesrc.h:
Add a gboolean to decide when to push out a discont.
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_sink_activate_push), (gst_queue_src_activate_push),
(gst_queue_set_property), (gst_queue_get_property):
Some cleanups.
* tests/threadstate/threadstate1.c: (main):
Make a thread test compile and run... very silly..
2005-07-20 10:58:10 +00:00
|
|
|
GST_QUEUE_MUTEX_UNLOCK (queue);
|
2005-03-21 17:34:02 +00:00
|
|
|
gst_pad_push_event (queue->srcpad, GST_EVENT (data));
|
gst/base/gstbasesrc.*: Add a gboolean to decide when to push out a discont.
Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_do_seek), (gst_base_src_loop), (gst_base_src_start):
* gst/base/gstbasesrc.h:
Add a gboolean to decide when to push out a discont.
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_sink_activate_push), (gst_queue_src_activate_push),
(gst_queue_set_property), (gst_queue_get_property):
Some cleanups.
* tests/threadstate/threadstate1.c: (main):
Make a thread test compile and run... very silly..
2005-07-20 10:58:10 +00:00
|
|
|
GST_QUEUE_MUTEX_LOCK_CHECK (queue, out_flushing);
|
2005-03-21 17:34:02 +00:00
|
|
|
if (restart == TRUE)
|
2006-01-19 13:30:31 +00:00
|
|
|
return TRUE;
|
2005-11-03 12:16:49 +00:00
|
|
|
} else {
|
|
|
|
g_warning ("Unexpected object in queue %s (refcounting problem?)",
|
|
|
|
GST_OBJECT_NAME (queue));
|
2005-03-21 17:34:02 +00:00
|
|
|
}
|
2001-10-27 20:28:31 +00:00
|
|
|
|
2006-01-19 13:30:31 +00:00
|
|
|
STATUS (queue, queue->srcpad, "after _get()");
|
2001-12-29 03:02:14 +00:00
|
|
|
|
gst/elements/gstfilesrc.c: compute mapsize correctly
Original commit message from CVS:
* gst/elements/gstfilesrc.c: (gst_filesrc_get_mmap):
compute mapsize correctly
* gst/elements/gstfilesrc.c: (gst_filesrc_get_mmap):
use correct datatypes when calling a varargs function
* gst/elements/gsttypefindelement.c: (stop_typefinding):
push a DISCONT event as first thing
* gst/gst_private.h:
* gst/gstinfo.c: (_gst_debug_init):
remove GST_DATAFLOW debugging category
* gst/gstbin.c: (gst_bin_iterate):
use GST_SCHEDULING category
* gst/gstpad.c: (gst_pad_get_type), (_invent_event),
(gst_pad_push), (gst_pad_pull), (gst_pad_call_chain_function),
(gst_pad_call_get_function):
add GST_DATAFLOW to easily track flow of buffers or events.
* gst/gstqueue.c: (gst_queue_get_type),
(gst_queue_handle_pending_events), (gst_queue_chain),
(gst_queue_get), (gst_queue_handle_src_event):
use own static debugging category GST_DATAFLOW for dataflow,
use DEBUG category for showing which path events go, use LOG
category for buffers.
2004-05-11 16:20:41 +00:00
|
|
|
GST_CAT_LOG_OBJECT (queue_dataflow, queue, "signalling item_del");
|
2003-12-13 17:12:46 +00:00
|
|
|
g_cond_signal (queue->item_del);
|
2006-01-19 13:30:31 +00:00
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
out_flushing:
|
|
|
|
gst_pad_pause_task (queue->srcpad);
|
|
|
|
GST_CAT_LOG_OBJECT (queue_dataflow, queue,
|
|
|
|
"exit because task paused, reason: %s",
|
|
|
|
gst_flow_get_name (queue->srcresult));
|
|
|
|
|
|
|
|
return FALSE; /* FALSE == no restart */
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_queue_loop (GstPad * pad)
|
|
|
|
{
|
|
|
|
GstQueue *queue;
|
|
|
|
|
|
|
|
queue = GST_QUEUE (GST_PAD_PARENT (pad));
|
|
|
|
|
|
|
|
/* have to lock for thread-safety */
|
|
|
|
GST_QUEUE_MUTEX_LOCK_CHECK (queue, out_flushing);
|
|
|
|
|
|
|
|
restart:
|
|
|
|
while (gst_queue_is_empty (queue)) {
|
|
|
|
GST_QUEUE_MUTEX_UNLOCK (queue);
|
|
|
|
g_signal_emit (G_OBJECT (queue), gst_queue_signals[SIGNAL_UNDERRUN], 0);
|
|
|
|
GST_QUEUE_MUTEX_LOCK_CHECK (queue, out_flushing);
|
|
|
|
|
|
|
|
STATUS (queue, pad, "pre-empty wait");
|
|
|
|
while (gst_queue_is_empty (queue)) {
|
|
|
|
STATUS (queue, pad, "waiting for item_add");
|
|
|
|
|
|
|
|
GST_LOG_OBJECT (queue, "doing g_cond_wait using qlock from thread %p",
|
|
|
|
g_thread_self ());
|
|
|
|
g_cond_wait (queue->item_add, queue->qlock);
|
|
|
|
|
|
|
|
/* we released the lock in the g_cond above so we might be
|
|
|
|
* flushing now */
|
|
|
|
if (queue->srcresult != GST_FLOW_OK)
|
|
|
|
goto out_flushing;
|
|
|
|
|
|
|
|
GST_LOG_OBJECT (queue, "done g_cond_wait using qlock from thread %p",
|
|
|
|
g_thread_self ());
|
|
|
|
STATUS (queue, pad, "got item_add signal");
|
|
|
|
}
|
|
|
|
|
|
|
|
STATUS (queue, pad, "post-empty wait");
|
|
|
|
GST_QUEUE_MUTEX_UNLOCK (queue);
|
|
|
|
g_signal_emit (G_OBJECT (queue), gst_queue_signals[SIGNAL_RUNNING], 0);
|
|
|
|
GST_QUEUE_MUTEX_LOCK_CHECK (queue, out_flushing);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (gst_queue_push_one (queue))
|
|
|
|
goto restart;
|
|
|
|
|
gst/base/gstbasesrc.*: Add a gboolean to decide when to push out a discont.
Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_do_seek), (gst_base_src_loop), (gst_base_src_start):
* gst/base/gstbasesrc.h:
Add a gboolean to decide when to push out a discont.
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_sink_activate_push), (gst_queue_src_activate_push),
(gst_queue_set_property), (gst_queue_get_property):
Some cleanups.
* tests/threadstate/threadstate1.c: (main):
Make a thread test compile and run... very silly..
2005-07-20 10:58:10 +00:00
|
|
|
GST_QUEUE_MUTEX_UNLOCK (queue);
|
2005-07-19 17:46:37 +00:00
|
|
|
|
2005-03-21 17:34:02 +00:00
|
|
|
return;
|
2001-10-27 20:28:31 +00:00
|
|
|
|
2005-03-21 17:34:02 +00:00
|
|
|
out_flushing:
|
2005-07-19 17:46:37 +00:00
|
|
|
{
|
gst/base/gstbasesink.c: Speed up current position calculation.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_get_position),
(gst_base_sink_query):
Speed up current position calculation.
* gst/base/gstbasesrc.c: (gst_base_src_query),
(gst_base_src_default_newsegment):
Correctly set stream position in newsegment.
* gst/gstbin.c: (gst_bin_add_func), (add_to_queue),
(update_degree), (gst_bin_sort_iterator_next),
(gst_bin_sort_iterator_resync), (gst_bin_sort_iterator_free):
* gst/gstmessage.c: (gst_message_new_custom):
Clean up debugging info
* gst/gstqueue.c: (gst_queue_link_src), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query):
Pause task faster.
2005-10-20 11:48:53 +00:00
|
|
|
gst_pad_pause_task (queue->srcpad);
|
2005-07-19 17:46:37 +00:00
|
|
|
GST_CAT_LOG_OBJECT (queue_dataflow, queue,
|
2005-11-28 19:58:56 +00:00
|
|
|
"exit because task paused, reason: %s",
|
|
|
|
gst_flow_get_name (queue->srcresult));
|
|
|
|
|
gst/base/gstbasesrc.*: Add a gboolean to decide when to push out a discont.
Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_do_seek), (gst_base_src_loop), (gst_base_src_start):
* gst/base/gstbasesrc.h:
Add a gboolean to decide when to push out a discont.
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_sink_activate_push), (gst_queue_src_activate_push),
(gst_queue_set_property), (gst_queue_get_property):
Some cleanups.
* tests/threadstate/threadstate1.c: (main):
Make a thread test compile and run... very silly..
2005-07-20 10:58:10 +00:00
|
|
|
GST_QUEUE_MUTEX_UNLOCK (queue);
|
2005-07-19 17:46:37 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
2000-01-30 09:03:00 +00:00
|
|
|
}
|
|
|
|
|
2002-05-26 21:54:27 +00:00
|
|
|
|
|
|
|
static gboolean
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_queue_handle_src_event (GstPad * pad, GstEvent * event)
|
2002-05-26 21:54:27 +00:00
|
|
|
{
|
2005-03-21 17:34:02 +00:00
|
|
|
gboolean res = TRUE;
|
2005-06-30 12:26:26 +00:00
|
|
|
GstQueue *queue = GST_QUEUE (GST_PAD_PARENT (pad));
|
|
|
|
|
2005-07-19 17:46:37 +00:00
|
|
|
#ifndef GST_DISABLE_GST_DEBUG
|
2004-06-11 15:18:58 +00:00
|
|
|
GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "got event %p (%d)",
|
|
|
|
event, GST_EVENT_TYPE (event));
|
2005-06-30 12:26:26 +00:00
|
|
|
#endif
|
2002-06-08 16:30:43 +00:00
|
|
|
|
2005-07-19 17:46:37 +00:00
|
|
|
res = gst_pad_push_event (queue->sinkpad, event);
|
2002-06-02 15:34:34 +00:00
|
|
|
|
2003-01-15 21:01:58 +00:00
|
|
|
return res;
|
2002-05-26 21:54:27 +00:00
|
|
|
}
|
|
|
|
|
2004-10-11 13:14:03 +00:00
|
|
|
static gboolean
|
2005-05-09 10:53:13 +00:00
|
|
|
gst_queue_handle_src_query (GstPad * pad, GstQuery * query)
|
2004-10-11 13:14:03 +00:00
|
|
|
{
|
2005-03-21 17:34:02 +00:00
|
|
|
GstQueue *queue = GST_QUEUE (GST_PAD_PARENT (pad));
|
2005-07-19 17:46:37 +00:00
|
|
|
GstPad *peer;
|
|
|
|
gboolean res;
|
2004-10-11 13:14:03 +00:00
|
|
|
|
2005-07-19 17:46:37 +00:00
|
|
|
if (!(peer = gst_pad_get_peer (queue->sinkpad)))
|
2004-12-09 16:13:18 +00:00
|
|
|
return FALSE;
|
2005-07-19 17:46:37 +00:00
|
|
|
|
|
|
|
res = gst_pad_query (peer, query);
|
|
|
|
gst_object_unref (peer);
|
|
|
|
if (!res)
|
2004-10-11 13:14:03 +00:00
|
|
|
return FALSE;
|
|
|
|
|
2005-05-09 10:53:13 +00:00
|
|
|
switch (GST_QUERY_TYPE (query)) {
|
|
|
|
case GST_QUERY_POSITION:
|
|
|
|
{
|
gst/: API change fix.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_commit_state),
(gst_base_sink_handle_object), (gst_base_sink_query), (do_playing):
* gst/base/gstbasesrc.c: (gst_base_src_query):
* gst/elements/gstfilesink.c: (gst_file_sink_query):
* gst/elements/gsttypefindelement.c:
(gst_type_find_handle_src_query), (find_element_get_length),
(gst_type_find_element_activate):
API change fix.
* gst/gstquery.c: (gst_query_new_position),
(gst_query_set_position), (gst_query_parse_position),
(gst_query_new_duration), (gst_query_set_duration),
(gst_query_parse_duration), (gst_query_set_segment),
(gst_query_parse_segment):
* gst/gstquery.h:
Bundling query position/duration is not a good idea since duration
does not change much and we don't want to recalculate it for every
position query, so they are separated again..
Base value in segment query is not needed.
* gst/gstqueue.c: (gst_queue_handle_src_query):
* gst/gstutils.c: (gst_element_query_position),
(gst_element_query_duration), (gst_pad_query_position),
(gst_pad_query_duration):
* gst/gstutils.h:
Updates for query API change.
Added some docs here and there.
2005-10-19 15:50:10 +00:00
|
|
|
gint64 peer_pos;
|
2005-05-09 10:53:13 +00:00
|
|
|
GstFormat format;
|
|
|
|
|
|
|
|
/* get peer position */
|
gst/: API change fix.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_commit_state),
(gst_base_sink_handle_object), (gst_base_sink_query), (do_playing):
* gst/base/gstbasesrc.c: (gst_base_src_query):
* gst/elements/gstfilesink.c: (gst_file_sink_query):
* gst/elements/gsttypefindelement.c:
(gst_type_find_handle_src_query), (find_element_get_length),
(gst_type_find_element_activate):
API change fix.
* gst/gstquery.c: (gst_query_new_position),
(gst_query_set_position), (gst_query_parse_position),
(gst_query_new_duration), (gst_query_set_duration),
(gst_query_parse_duration), (gst_query_set_segment),
(gst_query_parse_segment):
* gst/gstquery.h:
Bundling query position/duration is not a good idea since duration
does not change much and we don't want to recalculate it for every
position query, so they are separated again..
Base value in segment query is not needed.
* gst/gstqueue.c: (gst_queue_handle_src_query):
* gst/gstutils.c: (gst_element_query_position),
(gst_element_query_duration), (gst_pad_query_position),
(gst_pad_query_duration):
* gst/gstutils.h:
Updates for query API change.
Added some docs here and there.
2005-10-19 15:50:10 +00:00
|
|
|
gst_query_parse_position (query, &format, &peer_pos);
|
2005-05-09 10:53:13 +00:00
|
|
|
|
|
|
|
/* FIXME: this code assumes that there's no discont in the queue */
|
|
|
|
switch (format) {
|
|
|
|
case GST_FORMAT_BYTES:
|
|
|
|
peer_pos -= queue->cur_level.bytes;
|
|
|
|
break;
|
|
|
|
case GST_FORMAT_TIME:
|
|
|
|
peer_pos -= queue->cur_level.time;
|
|
|
|
break;
|
|
|
|
default:
|
2005-12-27 12:11:19 +00:00
|
|
|
GST_WARNING_OBJECT (queue, "dropping query in %s format, don't "
|
|
|
|
"know how to adjust value", gst_format_get_name (format));
|
gst/: API change fix.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_commit_state),
(gst_base_sink_handle_object), (gst_base_sink_query), (do_playing):
* gst/base/gstbasesrc.c: (gst_base_src_query):
* gst/elements/gstfilesink.c: (gst_file_sink_query):
* gst/elements/gsttypefindelement.c:
(gst_type_find_handle_src_query), (find_element_get_length),
(gst_type_find_element_activate):
API change fix.
* gst/gstquery.c: (gst_query_new_position),
(gst_query_set_position), (gst_query_parse_position),
(gst_query_new_duration), (gst_query_set_duration),
(gst_query_parse_duration), (gst_query_set_segment),
(gst_query_parse_segment):
* gst/gstquery.h:
Bundling query position/duration is not a good idea since duration
does not change much and we don't want to recalculate it for every
position query, so they are separated again..
Base value in segment query is not needed.
* gst/gstqueue.c: (gst_queue_handle_src_query):
* gst/gstutils.c: (gst_element_query_position),
(gst_element_query_duration), (gst_pad_query_position),
(gst_pad_query_duration):
* gst/gstutils.h:
Updates for query API change.
Added some docs here and there.
2005-10-19 15:50:10 +00:00
|
|
|
return FALSE;
|
2005-05-09 10:53:13 +00:00
|
|
|
}
|
gst/: API change fix.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_commit_state),
(gst_base_sink_handle_object), (gst_base_sink_query), (do_playing):
* gst/base/gstbasesrc.c: (gst_base_src_query):
* gst/elements/gstfilesink.c: (gst_file_sink_query):
* gst/elements/gsttypefindelement.c:
(gst_type_find_handle_src_query), (find_element_get_length),
(gst_type_find_element_activate):
API change fix.
* gst/gstquery.c: (gst_query_new_position),
(gst_query_set_position), (gst_query_parse_position),
(gst_query_new_duration), (gst_query_set_duration),
(gst_query_parse_duration), (gst_query_set_segment),
(gst_query_parse_segment):
* gst/gstquery.h:
Bundling query position/duration is not a good idea since duration
does not change much and we don't want to recalculate it for every
position query, so they are separated again..
Base value in segment query is not needed.
* gst/gstqueue.c: (gst_queue_handle_src_query):
* gst/gstutils.c: (gst_element_query_position),
(gst_element_query_duration), (gst_pad_query_position),
(gst_pad_query_duration):
* gst/gstutils.h:
Updates for query API change.
Added some docs here and there.
2005-10-19 15:50:10 +00:00
|
|
|
/* set updated position */
|
|
|
|
gst_query_set_position (query, format, peer_pos);
|
2005-05-09 10:53:13 +00:00
|
|
|
break;
|
2004-10-11 13:14:03 +00:00
|
|
|
}
|
2005-05-09 10:53:13 +00:00
|
|
|
default:
|
gst/: API change fix.
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_commit_state),
(gst_base_sink_handle_object), (gst_base_sink_query), (do_playing):
* gst/base/gstbasesrc.c: (gst_base_src_query):
* gst/elements/gstfilesink.c: (gst_file_sink_query):
* gst/elements/gsttypefindelement.c:
(gst_type_find_handle_src_query), (find_element_get_length),
(gst_type_find_element_activate):
API change fix.
* gst/gstquery.c: (gst_query_new_position),
(gst_query_set_position), (gst_query_parse_position),
(gst_query_new_duration), (gst_query_set_duration),
(gst_query_parse_duration), (gst_query_set_segment),
(gst_query_parse_segment):
* gst/gstquery.h:
Bundling query position/duration is not a good idea since duration
does not change much and we don't want to recalculate it for every
position query, so they are separated again..
Base value in segment query is not needed.
* gst/gstqueue.c: (gst_queue_handle_src_query):
* gst/gstutils.c: (gst_element_query_position),
(gst_element_query_duration), (gst_pad_query_position),
(gst_pad_query_duration):
* gst/gstutils.h:
Updates for query API change.
Added some docs here and there.
2005-10-19 15:50:10 +00:00
|
|
|
/* peer handled other queries */
|
2005-05-09 10:53:13 +00:00
|
|
|
break;
|
2004-10-11 13:14:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2002-05-26 21:54:27 +00:00
|
|
|
static gboolean
|
gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer.
Original commit message from CVS:
2005-06-27 Andy Wingo <wingo@pobox.com>
* gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any
remaining buffer.
* gst/gsttrace.c (gst_alloc_trace_list_sorted): New helper,
returns a sorted copy of the trace list.
(gst_alloc_trace_print_live): New API, only prints traces with
live objects. Sort the list.
(gst_alloc_trace_print_all): Sort the list.
(gst_alloc_trace_print): Align columns.
* gst/elements/gstttypefindelement.c:
* gst/elements/gsttee.c:
* gst/base/gstbasesrc.c:
* gst/base/gstbasesink.c:
* gst/base/gstbasetransform.c:
* gst/gstqueue.c: Adapt for pad activation changes.
* gst/gstpipeline.c (gst_pipeline_init): Unref after parenting
sched.
(gst_pipeline_dispose): Drop ref on sched.
* gst/gstpad.c (gst_pad_init): Set the default activate func.
(gst_pad_activate_default): Push mode by default.
(pre_activate_switch, post_activate_switch): New stubs, things to
do before and after switching activation modes on pads.
(gst_pad_set_active): Take a boolean and not a mode, dispatch to
the pad's activate function to choose which mode to activate.
Shortcut on deactivation and call the right function directly.
(gst_pad_activate_pull): New API, (de)activates a pad in pull
mode.
(gst_pad_activate_push): New API, same for push mode.
(gst_pad_set_activate_function)
(gst_pad_set_activatepull_function)
(gst_pad_set_activatepush_function): Setters for new API.
* gst/gstminiobject.c (gst_mini_object_new, gst_mini_object_free):
Trace all miniobjects.
(gst_mini_object_make_writable): Unref the arg if we copy, like
gst_caps_make_writable.
* gst/gstmessage.c (_gst_message_initialize): No trace init.
* gst/gstghostpad.c (gst_proxy_pad_do_activate)
(gst_proxy_pad_do_activatepull, gst_proxy_pad_do_activatepush):
Adapt for new pad API.
* gst/gstevent.c (_gst_event_initialize): Don't initialize trace.
* gst/gstelement.h:
* gst/gstelement.c (gst_element_iterate_src_pads)
(gst_element_iterate_sink_pads): New API functions.
* gst/gstelement.c (iterator_fold_with_resync): New utility,
should fold into gstiterator.c in some form.
(gst_element_pads_activate): Simplified via use of fold and
delegation of decisions to gstpad->activate.
* gst/gstbus.c (gst_bus_source_finalize): Set the bus to NULL,
help in debugging.
* gst/gstbuffer.c (_gst_buffer_initialize): Ref the buffer type
class once in init, like gstmessage. Didn't run into this issue
but it seems correct. Don't initialize a trace, gstminiobject does
that.
* check/pipelines/simple_launch_lines.c (test_stop_from_app): New
test, runs fakesrc ! fakesink, stopping on ::handoff via a message
to the bus.
(assert_live_count): New util function, uses alloc traces to check
cleanup.
* check/gst/gstghostpad.c (test_ghost_pads): More refcount checks.
To be modified when unlink drops the internal pad.
2005-06-27 18:35:05 +00:00
|
|
|
gst_queue_sink_activate_push (GstPad * pad, gboolean active)
|
2002-05-26 21:54:27 +00:00
|
|
|
{
|
check/generic/states.c: Make sure all tasks are stopped.
Original commit message from CVS:
* check/generic/states.c: (GST_START_TEST):
Make sure all tasks are stopped.
* check/gst/gstbin.c: (GST_START_TEST):
Unref after usage for proper valgrinding.
* gst/gstpad.c: (gst_pad_finalize), (gst_pad_stop_task):
Really wait for the task to stop before destroying the
mutex.
* gst/gstqueue.c: (gst_queue_sink_activate_push),
(gst_queue_src_activate_push):
Small cleanups. Don't stop the task when we did not start
it.
* gst/gsttask.c: (gst_task_get_type), (gst_task_init),
(gst_task_func), (gst_task_cleanup_all), (gst_task_set_lock),
(gst_task_get_state), (gst_task_start), (gst_task_pause),
(gst_task_join):
* gst/gsttask.h:
Protect the stream lock with the object lock.
Disallow setting the stream lock when running.
Add cleanup_all to wait for the threadpool to finish.
Remove code to autoallocate a mutex if none was provided.
Add _join() to wait for a task to stop.
Protect the thread pool with a global lock.
2005-08-24 20:49:53 +00:00
|
|
|
gboolean result = TRUE;
|
2002-05-26 21:54:27 +00:00
|
|
|
GstQueue *queue;
|
|
|
|
|
2005-07-19 17:46:37 +00:00
|
|
|
queue = GST_QUEUE (gst_pad_get_parent (pad));
|
2002-05-26 21:54:27 +00:00
|
|
|
|
gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer.
Original commit message from CVS:
2005-06-27 Andy Wingo <wingo@pobox.com>
* gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any
remaining buffer.
* gst/gsttrace.c (gst_alloc_trace_list_sorted): New helper,
returns a sorted copy of the trace list.
(gst_alloc_trace_print_live): New API, only prints traces with
live objects. Sort the list.
(gst_alloc_trace_print_all): Sort the list.
(gst_alloc_trace_print): Align columns.
* gst/elements/gstttypefindelement.c:
* gst/elements/gsttee.c:
* gst/base/gstbasesrc.c:
* gst/base/gstbasesink.c:
* gst/base/gstbasetransform.c:
* gst/gstqueue.c: Adapt for pad activation changes.
* gst/gstpipeline.c (gst_pipeline_init): Unref after parenting
sched.
(gst_pipeline_dispose): Drop ref on sched.
* gst/gstpad.c (gst_pad_init): Set the default activate func.
(gst_pad_activate_default): Push mode by default.
(pre_activate_switch, post_activate_switch): New stubs, things to
do before and after switching activation modes on pads.
(gst_pad_set_active): Take a boolean and not a mode, dispatch to
the pad's activate function to choose which mode to activate.
Shortcut on deactivation and call the right function directly.
(gst_pad_activate_pull): New API, (de)activates a pad in pull
mode.
(gst_pad_activate_push): New API, same for push mode.
(gst_pad_set_activate_function)
(gst_pad_set_activatepull_function)
(gst_pad_set_activatepush_function): Setters for new API.
* gst/gstminiobject.c (gst_mini_object_new, gst_mini_object_free):
Trace all miniobjects.
(gst_mini_object_make_writable): Unref the arg if we copy, like
gst_caps_make_writable.
* gst/gstmessage.c (_gst_message_initialize): No trace init.
* gst/gstghostpad.c (gst_proxy_pad_do_activate)
(gst_proxy_pad_do_activatepull, gst_proxy_pad_do_activatepush):
Adapt for new pad API.
* gst/gstevent.c (_gst_event_initialize): Don't initialize trace.
* gst/gstelement.h:
* gst/gstelement.c (gst_element_iterate_src_pads)
(gst_element_iterate_sink_pads): New API functions.
* gst/gstelement.c (iterator_fold_with_resync): New utility,
should fold into gstiterator.c in some form.
(gst_element_pads_activate): Simplified via use of fold and
delegation of decisions to gstpad->activate.
* gst/gstbus.c (gst_bus_source_finalize): Set the bus to NULL,
help in debugging.
* gst/gstbuffer.c (_gst_buffer_initialize): Ref the buffer type
class once in init, like gstmessage. Didn't run into this issue
but it seems correct. Don't initialize a trace, gstminiobject does
that.
* check/pipelines/simple_launch_lines.c (test_stop_from_app): New
test, runs fakesrc ! fakesink, stopping on ::handoff via a message
to the bus.
(assert_live_count): New util function, uses alloc traces to check
cleanup.
* check/gst/gstghostpad.c (test_ghost_pads): More refcount checks.
To be modified when unlink drops the internal pad.
2005-06-27 18:35:05 +00:00
|
|
|
if (active) {
|
check/generic/states.c: Make sure all tasks are stopped.
Original commit message from CVS:
* check/generic/states.c: (GST_START_TEST):
Make sure all tasks are stopped.
* check/gst/gstbin.c: (GST_START_TEST):
Unref after usage for proper valgrinding.
* gst/gstpad.c: (gst_pad_finalize), (gst_pad_stop_task):
Really wait for the task to stop before destroying the
mutex.
* gst/gstqueue.c: (gst_queue_sink_activate_push),
(gst_queue_src_activate_push):
Small cleanups. Don't stop the task when we did not start
it.
* gst/gsttask.c: (gst_task_get_type), (gst_task_init),
(gst_task_func), (gst_task_cleanup_all), (gst_task_set_lock),
(gst_task_get_state), (gst_task_start), (gst_task_pause),
(gst_task_join):
* gst/gsttask.h:
Protect the stream lock with the object lock.
Disallow setting the stream lock when running.
Add cleanup_all to wait for the threadpool to finish.
Remove code to autoallocate a mutex if none was provided.
Add _join() to wait for a task to stop.
Protect the thread pool with a global lock.
2005-08-24 20:49:53 +00:00
|
|
|
GST_QUEUE_MUTEX_LOCK (queue);
|
2005-07-19 17:46:37 +00:00
|
|
|
queue->srcresult = GST_FLOW_OK;
|
check/generic/states.c: Make sure all tasks are stopped.
Original commit message from CVS:
* check/generic/states.c: (GST_START_TEST):
Make sure all tasks are stopped.
* check/gst/gstbin.c: (GST_START_TEST):
Unref after usage for proper valgrinding.
* gst/gstpad.c: (gst_pad_finalize), (gst_pad_stop_task):
Really wait for the task to stop before destroying the
mutex.
* gst/gstqueue.c: (gst_queue_sink_activate_push),
(gst_queue_src_activate_push):
Small cleanups. Don't stop the task when we did not start
it.
* gst/gsttask.c: (gst_task_get_type), (gst_task_init),
(gst_task_func), (gst_task_cleanup_all), (gst_task_set_lock),
(gst_task_get_state), (gst_task_start), (gst_task_pause),
(gst_task_join):
* gst/gsttask.h:
Protect the stream lock with the object lock.
Disallow setting the stream lock when running.
Add cleanup_all to wait for the threadpool to finish.
Remove code to autoallocate a mutex if none was provided.
Add _join() to wait for a task to stop.
Protect the thread pool with a global lock.
2005-08-24 20:49:53 +00:00
|
|
|
GST_QUEUE_MUTEX_UNLOCK (queue);
|
gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer.
Original commit message from CVS:
2005-06-27 Andy Wingo <wingo@pobox.com>
* gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any
remaining buffer.
* gst/gsttrace.c (gst_alloc_trace_list_sorted): New helper,
returns a sorted copy of the trace list.
(gst_alloc_trace_print_live): New API, only prints traces with
live objects. Sort the list.
(gst_alloc_trace_print_all): Sort the list.
(gst_alloc_trace_print): Align columns.
* gst/elements/gstttypefindelement.c:
* gst/elements/gsttee.c:
* gst/base/gstbasesrc.c:
* gst/base/gstbasesink.c:
* gst/base/gstbasetransform.c:
* gst/gstqueue.c: Adapt for pad activation changes.
* gst/gstpipeline.c (gst_pipeline_init): Unref after parenting
sched.
(gst_pipeline_dispose): Drop ref on sched.
* gst/gstpad.c (gst_pad_init): Set the default activate func.
(gst_pad_activate_default): Push mode by default.
(pre_activate_switch, post_activate_switch): New stubs, things to
do before and after switching activation modes on pads.
(gst_pad_set_active): Take a boolean and not a mode, dispatch to
the pad's activate function to choose which mode to activate.
Shortcut on deactivation and call the right function directly.
(gst_pad_activate_pull): New API, (de)activates a pad in pull
mode.
(gst_pad_activate_push): New API, same for push mode.
(gst_pad_set_activate_function)
(gst_pad_set_activatepull_function)
(gst_pad_set_activatepush_function): Setters for new API.
* gst/gstminiobject.c (gst_mini_object_new, gst_mini_object_free):
Trace all miniobjects.
(gst_mini_object_make_writable): Unref the arg if we copy, like
gst_caps_make_writable.
* gst/gstmessage.c (_gst_message_initialize): No trace init.
* gst/gstghostpad.c (gst_proxy_pad_do_activate)
(gst_proxy_pad_do_activatepull, gst_proxy_pad_do_activatepush):
Adapt for new pad API.
* gst/gstevent.c (_gst_event_initialize): Don't initialize trace.
* gst/gstelement.h:
* gst/gstelement.c (gst_element_iterate_src_pads)
(gst_element_iterate_sink_pads): New API functions.
* gst/gstelement.c (iterator_fold_with_resync): New utility,
should fold into gstiterator.c in some form.
(gst_element_pads_activate): Simplified via use of fold and
delegation of decisions to gstpad->activate.
* gst/gstbus.c (gst_bus_source_finalize): Set the bus to NULL,
help in debugging.
* gst/gstbuffer.c (_gst_buffer_initialize): Ref the buffer type
class once in init, like gstmessage. Didn't run into this issue
but it seems correct. Don't initialize a trace, gstminiobject does
that.
* check/pipelines/simple_launch_lines.c (test_stop_from_app): New
test, runs fakesrc ! fakesink, stopping on ::handoff via a message
to the bus.
(assert_live_count): New util function, uses alloc traces to check
cleanup.
* check/gst/gstghostpad.c (test_ghost_pads): More refcount checks.
To be modified when unlink drops the internal pad.
2005-06-27 18:35:05 +00:00
|
|
|
} else {
|
check/generic/states.c: Make sure all tasks are stopped.
Original commit message from CVS:
* check/generic/states.c: (GST_START_TEST):
Make sure all tasks are stopped.
* check/gst/gstbin.c: (GST_START_TEST):
Unref after usage for proper valgrinding.
* gst/gstpad.c: (gst_pad_finalize), (gst_pad_stop_task):
Really wait for the task to stop before destroying the
mutex.
* gst/gstqueue.c: (gst_queue_sink_activate_push),
(gst_queue_src_activate_push):
Small cleanups. Don't stop the task when we did not start
it.
* gst/gsttask.c: (gst_task_get_type), (gst_task_init),
(gst_task_func), (gst_task_cleanup_all), (gst_task_set_lock),
(gst_task_get_state), (gst_task_start), (gst_task_pause),
(gst_task_join):
* gst/gsttask.h:
Protect the stream lock with the object lock.
Disallow setting the stream lock when running.
Add cleanup_all to wait for the threadpool to finish.
Remove code to autoallocate a mutex if none was provided.
Add _join() to wait for a task to stop.
Protect the thread pool with a global lock.
2005-08-24 20:49:53 +00:00
|
|
|
/* step 1, unblock chain function */
|
gst/base/gstbasesrc.*: Add a gboolean to decide when to push out a discont.
Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_do_seek), (gst_base_src_loop), (gst_base_src_start):
* gst/base/gstbasesrc.h:
Add a gboolean to decide when to push out a discont.
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_sink_activate_push), (gst_queue_src_activate_push),
(gst_queue_set_property), (gst_queue_get_property):
Some cleanups.
* tests/threadstate/threadstate1.c: (main):
Make a thread test compile and run... very silly..
2005-07-20 10:58:10 +00:00
|
|
|
GST_QUEUE_MUTEX_LOCK (queue);
|
2005-07-19 17:46:37 +00:00
|
|
|
queue->srcresult = GST_FLOW_WRONG_STATE;
|
gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer.
Original commit message from CVS:
2005-06-27 Andy Wingo <wingo@pobox.com>
* gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any
remaining buffer.
* gst/gsttrace.c (gst_alloc_trace_list_sorted): New helper,
returns a sorted copy of the trace list.
(gst_alloc_trace_print_live): New API, only prints traces with
live objects. Sort the list.
(gst_alloc_trace_print_all): Sort the list.
(gst_alloc_trace_print): Align columns.
* gst/elements/gstttypefindelement.c:
* gst/elements/gsttee.c:
* gst/base/gstbasesrc.c:
* gst/base/gstbasesink.c:
* gst/base/gstbasetransform.c:
* gst/gstqueue.c: Adapt for pad activation changes.
* gst/gstpipeline.c (gst_pipeline_init): Unref after parenting
sched.
(gst_pipeline_dispose): Drop ref on sched.
* gst/gstpad.c (gst_pad_init): Set the default activate func.
(gst_pad_activate_default): Push mode by default.
(pre_activate_switch, post_activate_switch): New stubs, things to
do before and after switching activation modes on pads.
(gst_pad_set_active): Take a boolean and not a mode, dispatch to
the pad's activate function to choose which mode to activate.
Shortcut on deactivation and call the right function directly.
(gst_pad_activate_pull): New API, (de)activates a pad in pull
mode.
(gst_pad_activate_push): New API, same for push mode.
(gst_pad_set_activate_function)
(gst_pad_set_activatepull_function)
(gst_pad_set_activatepush_function): Setters for new API.
* gst/gstminiobject.c (gst_mini_object_new, gst_mini_object_free):
Trace all miniobjects.
(gst_mini_object_make_writable): Unref the arg if we copy, like
gst_caps_make_writable.
* gst/gstmessage.c (_gst_message_initialize): No trace init.
* gst/gstghostpad.c (gst_proxy_pad_do_activate)
(gst_proxy_pad_do_activatepull, gst_proxy_pad_do_activatepush):
Adapt for new pad API.
* gst/gstevent.c (_gst_event_initialize): Don't initialize trace.
* gst/gstelement.h:
* gst/gstelement.c (gst_element_iterate_src_pads)
(gst_element_iterate_sink_pads): New API functions.
* gst/gstelement.c (iterator_fold_with_resync): New utility,
should fold into gstiterator.c in some form.
(gst_element_pads_activate): Simplified via use of fold and
delegation of decisions to gstpad->activate.
* gst/gstbus.c (gst_bus_source_finalize): Set the bus to NULL,
help in debugging.
* gst/gstbuffer.c (_gst_buffer_initialize): Ref the buffer type
class once in init, like gstmessage. Didn't run into this issue
but it seems correct. Don't initialize a trace, gstminiobject does
that.
* check/pipelines/simple_launch_lines.c (test_stop_from_app): New
test, runs fakesrc ! fakesink, stopping on ::handoff via a message
to the bus.
(assert_live_count): New util function, uses alloc traces to check
cleanup.
* check/gst/gstghostpad.c (test_ghost_pads): More refcount checks.
To be modified when unlink drops the internal pad.
2005-06-27 18:35:05 +00:00
|
|
|
gst_queue_locked_flush (queue);
|
gst/base/gstbasesrc.*: Add a gboolean to decide when to push out a discont.
Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_do_seek), (gst_base_src_loop), (gst_base_src_start):
* gst/base/gstbasesrc.h:
Add a gboolean to decide when to push out a discont.
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_sink_activate_push), (gst_queue_src_activate_push),
(gst_queue_set_property), (gst_queue_get_property):
Some cleanups.
* tests/threadstate/threadstate1.c: (main):
Make a thread test compile and run... very silly..
2005-07-20 10:58:10 +00:00
|
|
|
GST_QUEUE_MUTEX_UNLOCK (queue);
|
2005-03-21 17:34:02 +00:00
|
|
|
}
|
check/generic/states.c: Make sure all tasks are stopped.
Original commit message from CVS:
* check/generic/states.c: (GST_START_TEST):
Make sure all tasks are stopped.
* check/gst/gstbin.c: (GST_START_TEST):
Unref after usage for proper valgrinding.
* gst/gstpad.c: (gst_pad_finalize), (gst_pad_stop_task):
Really wait for the task to stop before destroying the
mutex.
* gst/gstqueue.c: (gst_queue_sink_activate_push),
(gst_queue_src_activate_push):
Small cleanups. Don't stop the task when we did not start
it.
* gst/gsttask.c: (gst_task_get_type), (gst_task_init),
(gst_task_func), (gst_task_cleanup_all), (gst_task_set_lock),
(gst_task_get_state), (gst_task_start), (gst_task_pause),
(gst_task_join):
* gst/gsttask.h:
Protect the stream lock with the object lock.
Disallow setting the stream lock when running.
Add cleanup_all to wait for the threadpool to finish.
Remove code to autoallocate a mutex if none was provided.
Add _join() to wait for a task to stop.
Protect the thread pool with a global lock.
2005-08-24 20:49:53 +00:00
|
|
|
|
2005-07-19 17:46:37 +00:00
|
|
|
gst_object_unref (queue);
|
gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer.
Original commit message from CVS:
2005-06-27 Andy Wingo <wingo@pobox.com>
* gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any
remaining buffer.
* gst/gsttrace.c (gst_alloc_trace_list_sorted): New helper,
returns a sorted copy of the trace list.
(gst_alloc_trace_print_live): New API, only prints traces with
live objects. Sort the list.
(gst_alloc_trace_print_all): Sort the list.
(gst_alloc_trace_print): Align columns.
* gst/elements/gstttypefindelement.c:
* gst/elements/gsttee.c:
* gst/base/gstbasesrc.c:
* gst/base/gstbasesink.c:
* gst/base/gstbasetransform.c:
* gst/gstqueue.c: Adapt for pad activation changes.
* gst/gstpipeline.c (gst_pipeline_init): Unref after parenting
sched.
(gst_pipeline_dispose): Drop ref on sched.
* gst/gstpad.c (gst_pad_init): Set the default activate func.
(gst_pad_activate_default): Push mode by default.
(pre_activate_switch, post_activate_switch): New stubs, things to
do before and after switching activation modes on pads.
(gst_pad_set_active): Take a boolean and not a mode, dispatch to
the pad's activate function to choose which mode to activate.
Shortcut on deactivation and call the right function directly.
(gst_pad_activate_pull): New API, (de)activates a pad in pull
mode.
(gst_pad_activate_push): New API, same for push mode.
(gst_pad_set_activate_function)
(gst_pad_set_activatepull_function)
(gst_pad_set_activatepush_function): Setters for new API.
* gst/gstminiobject.c (gst_mini_object_new, gst_mini_object_free):
Trace all miniobjects.
(gst_mini_object_make_writable): Unref the arg if we copy, like
gst_caps_make_writable.
* gst/gstmessage.c (_gst_message_initialize): No trace init.
* gst/gstghostpad.c (gst_proxy_pad_do_activate)
(gst_proxy_pad_do_activatepull, gst_proxy_pad_do_activatepush):
Adapt for new pad API.
* gst/gstevent.c (_gst_event_initialize): Don't initialize trace.
* gst/gstelement.h:
* gst/gstelement.c (gst_element_iterate_src_pads)
(gst_element_iterate_sink_pads): New API functions.
* gst/gstelement.c (iterator_fold_with_resync): New utility,
should fold into gstiterator.c in some form.
(gst_element_pads_activate): Simplified via use of fold and
delegation of decisions to gstpad->activate.
* gst/gstbus.c (gst_bus_source_finalize): Set the bus to NULL,
help in debugging.
* gst/gstbuffer.c (_gst_buffer_initialize): Ref the buffer type
class once in init, like gstmessage. Didn't run into this issue
but it seems correct. Don't initialize a trace, gstminiobject does
that.
* check/pipelines/simple_launch_lines.c (test_stop_from_app): New
test, runs fakesrc ! fakesink, stopping on ::handoff via a message
to the bus.
(assert_live_count): New util function, uses alloc traces to check
cleanup.
* check/gst/gstghostpad.c (test_ghost_pads): More refcount checks.
To be modified when unlink drops the internal pad.
2005-06-27 18:35:05 +00:00
|
|
|
|
2005-03-21 17:34:02 +00:00
|
|
|
return result;
|
2002-05-26 21:54:27 +00:00
|
|
|
}
|
|
|
|
|
gst/: Fix state changes for non sinks. We now change sinks, then elements with unconnected srcpads, then the rest.
Original commit message from CVS:
* gst/gstbin.c: (bin_element_is_sink), (has_ancestor),
(bin_element_is_semi_sink), (append_child), (gst_bin_change_state):
* gst/gstpad.c: (gst_pad_set_active), (gst_pad_link_prepare),
(gst_pad_link), (gst_pad_accept_caps), (gst_pad_query),
(gst_pad_send_event), (gst_pad_start_task):
* gst/gstqueue.c: (gst_queue_init), (gst_queue_locked_flush),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_sink_activate), (gst_queue_src_activate),
(gst_queue_change_state):
* gst/gstqueue.h:
Fix state changes for non sinks. We now change sinks, then elements
with unconnected srcpads, then the rest.
More efficient queue unlocking in flush and state changes.
Set the pad activate mode even if it does not have an activate
function.
2005-05-25 19:33:39 +00:00
|
|
|
static gboolean
|
gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer.
Original commit message from CVS:
2005-06-27 Andy Wingo <wingo@pobox.com>
* gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any
remaining buffer.
* gst/gsttrace.c (gst_alloc_trace_list_sorted): New helper,
returns a sorted copy of the trace list.
(gst_alloc_trace_print_live): New API, only prints traces with
live objects. Sort the list.
(gst_alloc_trace_print_all): Sort the list.
(gst_alloc_trace_print): Align columns.
* gst/elements/gstttypefindelement.c:
* gst/elements/gsttee.c:
* gst/base/gstbasesrc.c:
* gst/base/gstbasesink.c:
* gst/base/gstbasetransform.c:
* gst/gstqueue.c: Adapt for pad activation changes.
* gst/gstpipeline.c (gst_pipeline_init): Unref after parenting
sched.
(gst_pipeline_dispose): Drop ref on sched.
* gst/gstpad.c (gst_pad_init): Set the default activate func.
(gst_pad_activate_default): Push mode by default.
(pre_activate_switch, post_activate_switch): New stubs, things to
do before and after switching activation modes on pads.
(gst_pad_set_active): Take a boolean and not a mode, dispatch to
the pad's activate function to choose which mode to activate.
Shortcut on deactivation and call the right function directly.
(gst_pad_activate_pull): New API, (de)activates a pad in pull
mode.
(gst_pad_activate_push): New API, same for push mode.
(gst_pad_set_activate_function)
(gst_pad_set_activatepull_function)
(gst_pad_set_activatepush_function): Setters for new API.
* gst/gstminiobject.c (gst_mini_object_new, gst_mini_object_free):
Trace all miniobjects.
(gst_mini_object_make_writable): Unref the arg if we copy, like
gst_caps_make_writable.
* gst/gstmessage.c (_gst_message_initialize): No trace init.
* gst/gstghostpad.c (gst_proxy_pad_do_activate)
(gst_proxy_pad_do_activatepull, gst_proxy_pad_do_activatepush):
Adapt for new pad API.
* gst/gstevent.c (_gst_event_initialize): Don't initialize trace.
* gst/gstelement.h:
* gst/gstelement.c (gst_element_iterate_src_pads)
(gst_element_iterate_sink_pads): New API functions.
* gst/gstelement.c (iterator_fold_with_resync): New utility,
should fold into gstiterator.c in some form.
(gst_element_pads_activate): Simplified via use of fold and
delegation of decisions to gstpad->activate.
* gst/gstbus.c (gst_bus_source_finalize): Set the bus to NULL,
help in debugging.
* gst/gstbuffer.c (_gst_buffer_initialize): Ref the buffer type
class once in init, like gstmessage. Didn't run into this issue
but it seems correct. Don't initialize a trace, gstminiobject does
that.
* check/pipelines/simple_launch_lines.c (test_stop_from_app): New
test, runs fakesrc ! fakesink, stopping on ::handoff via a message
to the bus.
(assert_live_count): New util function, uses alloc traces to check
cleanup.
* check/gst/gstghostpad.c (test_ghost_pads): More refcount checks.
To be modified when unlink drops the internal pad.
2005-06-27 18:35:05 +00:00
|
|
|
gst_queue_src_activate_push (GstPad * pad, gboolean active)
|
gst/: Fix state changes for non sinks. We now change sinks, then elements with unconnected srcpads, then the rest.
Original commit message from CVS:
* gst/gstbin.c: (bin_element_is_sink), (has_ancestor),
(bin_element_is_semi_sink), (append_child), (gst_bin_change_state):
* gst/gstpad.c: (gst_pad_set_active), (gst_pad_link_prepare),
(gst_pad_link), (gst_pad_accept_caps), (gst_pad_query),
(gst_pad_send_event), (gst_pad_start_task):
* gst/gstqueue.c: (gst_queue_init), (gst_queue_locked_flush),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_sink_activate), (gst_queue_src_activate),
(gst_queue_change_state):
* gst/gstqueue.h:
Fix state changes for non sinks. We now change sinks, then elements
with unconnected srcpads, then the rest.
More efficient queue unlocking in flush and state changes.
Set the pad activate mode even if it does not have an activate
function.
2005-05-25 19:33:39 +00:00
|
|
|
{
|
|
|
|
gboolean result = FALSE;
|
|
|
|
GstQueue *queue;
|
|
|
|
|
2005-07-19 17:46:37 +00:00
|
|
|
queue = GST_QUEUE (gst_pad_get_parent (pad));
|
gst/: Fix state changes for non sinks. We now change sinks, then elements with unconnected srcpads, then the rest.
Original commit message from CVS:
* gst/gstbin.c: (bin_element_is_sink), (has_ancestor),
(bin_element_is_semi_sink), (append_child), (gst_bin_change_state):
* gst/gstpad.c: (gst_pad_set_active), (gst_pad_link_prepare),
(gst_pad_link), (gst_pad_accept_caps), (gst_pad_query),
(gst_pad_send_event), (gst_pad_start_task):
* gst/gstqueue.c: (gst_queue_init), (gst_queue_locked_flush),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_sink_activate), (gst_queue_src_activate),
(gst_queue_change_state):
* gst/gstqueue.h:
Fix state changes for non sinks. We now change sinks, then elements
with unconnected srcpads, then the rest.
More efficient queue unlocking in flush and state changes.
Set the pad activate mode even if it does not have an activate
function.
2005-05-25 19:33:39 +00:00
|
|
|
|
gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer.
Original commit message from CVS:
2005-06-27 Andy Wingo <wingo@pobox.com>
* gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any
remaining buffer.
* gst/gsttrace.c (gst_alloc_trace_list_sorted): New helper,
returns a sorted copy of the trace list.
(gst_alloc_trace_print_live): New API, only prints traces with
live objects. Sort the list.
(gst_alloc_trace_print_all): Sort the list.
(gst_alloc_trace_print): Align columns.
* gst/elements/gstttypefindelement.c:
* gst/elements/gsttee.c:
* gst/base/gstbasesrc.c:
* gst/base/gstbasesink.c:
* gst/base/gstbasetransform.c:
* gst/gstqueue.c: Adapt for pad activation changes.
* gst/gstpipeline.c (gst_pipeline_init): Unref after parenting
sched.
(gst_pipeline_dispose): Drop ref on sched.
* gst/gstpad.c (gst_pad_init): Set the default activate func.
(gst_pad_activate_default): Push mode by default.
(pre_activate_switch, post_activate_switch): New stubs, things to
do before and after switching activation modes on pads.
(gst_pad_set_active): Take a boolean and not a mode, dispatch to
the pad's activate function to choose which mode to activate.
Shortcut on deactivation and call the right function directly.
(gst_pad_activate_pull): New API, (de)activates a pad in pull
mode.
(gst_pad_activate_push): New API, same for push mode.
(gst_pad_set_activate_function)
(gst_pad_set_activatepull_function)
(gst_pad_set_activatepush_function): Setters for new API.
* gst/gstminiobject.c (gst_mini_object_new, gst_mini_object_free):
Trace all miniobjects.
(gst_mini_object_make_writable): Unref the arg if we copy, like
gst_caps_make_writable.
* gst/gstmessage.c (_gst_message_initialize): No trace init.
* gst/gstghostpad.c (gst_proxy_pad_do_activate)
(gst_proxy_pad_do_activatepull, gst_proxy_pad_do_activatepush):
Adapt for new pad API.
* gst/gstevent.c (_gst_event_initialize): Don't initialize trace.
* gst/gstelement.h:
* gst/gstelement.c (gst_element_iterate_src_pads)
(gst_element_iterate_sink_pads): New API functions.
* gst/gstelement.c (iterator_fold_with_resync): New utility,
should fold into gstiterator.c in some form.
(gst_element_pads_activate): Simplified via use of fold and
delegation of decisions to gstpad->activate.
* gst/gstbus.c (gst_bus_source_finalize): Set the bus to NULL,
help in debugging.
* gst/gstbuffer.c (_gst_buffer_initialize): Ref the buffer type
class once in init, like gstmessage. Didn't run into this issue
but it seems correct. Don't initialize a trace, gstminiobject does
that.
* check/pipelines/simple_launch_lines.c (test_stop_from_app): New
test, runs fakesrc ! fakesink, stopping on ::handoff via a message
to the bus.
(assert_live_count): New util function, uses alloc traces to check
cleanup.
* check/gst/gstghostpad.c (test_ghost_pads): More refcount checks.
To be modified when unlink drops the internal pad.
2005-06-27 18:35:05 +00:00
|
|
|
if (active) {
|
gst/base/gstbasesrc.*: Add a gboolean to decide when to push out a discont.
Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_do_seek), (gst_base_src_loop), (gst_base_src_start):
* gst/base/gstbasesrc.h:
Add a gboolean to decide when to push out a discont.
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_sink_activate_push), (gst_queue_src_activate_push),
(gst_queue_set_property), (gst_queue_get_property):
Some cleanups.
* tests/threadstate/threadstate1.c: (main):
Make a thread test compile and run... very silly..
2005-07-20 10:58:10 +00:00
|
|
|
GST_QUEUE_MUTEX_LOCK (queue);
|
2005-07-19 17:46:37 +00:00
|
|
|
queue->srcresult = GST_FLOW_OK;
|
docs/design/part-seeking.txt: Some small additions.
Original commit message from CVS:
* docs/design/part-seeking.txt:
Some small additions.
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_get_times), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesink.h:
discont values are gint64, handle the math correctly.
* gst/base/gstbasesrc.c: (gst_base_src_loop):
Make the basesrc report error if the source pad is not linked.
* gst/gstqueue.c: (gst_queue_link_src), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_src_activate_push):
Make queue collect data even if the srcpad is not linked.
Start pushing out data as soon as it is linked.
* gst/gstutils.c: (gst_element_unlink), (gst_flow_get_name):
* gst/gstutils.h:
Added gst_flow_get_name() to ease error reporting.
2005-07-21 17:22:13 +00:00
|
|
|
/* we do not start the task yet if the pad is not connected */
|
|
|
|
if (gst_pad_is_linked (pad))
|
|
|
|
result = gst_pad_start_task (pad, (GstTaskFunction) gst_queue_loop, pad);
|
|
|
|
else {
|
2005-08-22 18:48:48 +00:00
|
|
|
GST_DEBUG_OBJECT (queue, "not starting task as pad is not linked");
|
docs/design/part-seeking.txt: Some small additions.
Original commit message from CVS:
* docs/design/part-seeking.txt:
Some small additions.
* gst/base/gstbasesink.c: (gst_base_sink_handle_object),
(gst_base_sink_get_times), (gst_base_sink_do_sync),
(gst_base_sink_activate_push), (gst_base_sink_activate_pull):
* gst/base/gstbasesink.h:
discont values are gint64, handle the math correctly.
* gst/base/gstbasesrc.c: (gst_base_src_loop):
Make the basesrc report error if the source pad is not linked.
* gst/gstqueue.c: (gst_queue_link_src), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_src_activate_push):
Make queue collect data even if the srcpad is not linked.
Start pushing out data as soon as it is linked.
* gst/gstutils.c: (gst_element_unlink), (gst_flow_get_name):
* gst/gstutils.h:
Added gst_flow_get_name() to ease error reporting.
2005-07-21 17:22:13 +00:00
|
|
|
result = TRUE;
|
|
|
|
}
|
gst/base/gstbasesrc.*: Add a gboolean to decide when to push out a discont.
Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_do_seek), (gst_base_src_loop), (gst_base_src_start):
* gst/base/gstbasesrc.h:
Add a gboolean to decide when to push out a discont.
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_sink_activate_push), (gst_queue_src_activate_push),
(gst_queue_set_property), (gst_queue_get_property):
Some cleanups.
* tests/threadstate/threadstate1.c: (main):
Make a thread test compile and run... very silly..
2005-07-20 10:58:10 +00:00
|
|
|
GST_QUEUE_MUTEX_UNLOCK (queue);
|
gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer.
Original commit message from CVS:
2005-06-27 Andy Wingo <wingo@pobox.com>
* gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any
remaining buffer.
* gst/gsttrace.c (gst_alloc_trace_list_sorted): New helper,
returns a sorted copy of the trace list.
(gst_alloc_trace_print_live): New API, only prints traces with
live objects. Sort the list.
(gst_alloc_trace_print_all): Sort the list.
(gst_alloc_trace_print): Align columns.
* gst/elements/gstttypefindelement.c:
* gst/elements/gsttee.c:
* gst/base/gstbasesrc.c:
* gst/base/gstbasesink.c:
* gst/base/gstbasetransform.c:
* gst/gstqueue.c: Adapt for pad activation changes.
* gst/gstpipeline.c (gst_pipeline_init): Unref after parenting
sched.
(gst_pipeline_dispose): Drop ref on sched.
* gst/gstpad.c (gst_pad_init): Set the default activate func.
(gst_pad_activate_default): Push mode by default.
(pre_activate_switch, post_activate_switch): New stubs, things to
do before and after switching activation modes on pads.
(gst_pad_set_active): Take a boolean and not a mode, dispatch to
the pad's activate function to choose which mode to activate.
Shortcut on deactivation and call the right function directly.
(gst_pad_activate_pull): New API, (de)activates a pad in pull
mode.
(gst_pad_activate_push): New API, same for push mode.
(gst_pad_set_activate_function)
(gst_pad_set_activatepull_function)
(gst_pad_set_activatepush_function): Setters for new API.
* gst/gstminiobject.c (gst_mini_object_new, gst_mini_object_free):
Trace all miniobjects.
(gst_mini_object_make_writable): Unref the arg if we copy, like
gst_caps_make_writable.
* gst/gstmessage.c (_gst_message_initialize): No trace init.
* gst/gstghostpad.c (gst_proxy_pad_do_activate)
(gst_proxy_pad_do_activatepull, gst_proxy_pad_do_activatepush):
Adapt for new pad API.
* gst/gstevent.c (_gst_event_initialize): Don't initialize trace.
* gst/gstelement.h:
* gst/gstelement.c (gst_element_iterate_src_pads)
(gst_element_iterate_sink_pads): New API functions.
* gst/gstelement.c (iterator_fold_with_resync): New utility,
should fold into gstiterator.c in some form.
(gst_element_pads_activate): Simplified via use of fold and
delegation of decisions to gstpad->activate.
* gst/gstbus.c (gst_bus_source_finalize): Set the bus to NULL,
help in debugging.
* gst/gstbuffer.c (_gst_buffer_initialize): Ref the buffer type
class once in init, like gstmessage. Didn't run into this issue
but it seems correct. Don't initialize a trace, gstminiobject does
that.
* check/pipelines/simple_launch_lines.c (test_stop_from_app): New
test, runs fakesrc ! fakesink, stopping on ::handoff via a message
to the bus.
(assert_live_count): New util function, uses alloc traces to check
cleanup.
* check/gst/gstghostpad.c (test_ghost_pads): More refcount checks.
To be modified when unlink drops the internal pad.
2005-06-27 18:35:05 +00:00
|
|
|
} else {
|
check/generic/states.c: Make sure all tasks are stopped.
Original commit message from CVS:
* check/generic/states.c: (GST_START_TEST):
Make sure all tasks are stopped.
* check/gst/gstbin.c: (GST_START_TEST):
Unref after usage for proper valgrinding.
* gst/gstpad.c: (gst_pad_finalize), (gst_pad_stop_task):
Really wait for the task to stop before destroying the
mutex.
* gst/gstqueue.c: (gst_queue_sink_activate_push),
(gst_queue_src_activate_push):
Small cleanups. Don't stop the task when we did not start
it.
* gst/gsttask.c: (gst_task_get_type), (gst_task_init),
(gst_task_func), (gst_task_cleanup_all), (gst_task_set_lock),
(gst_task_get_state), (gst_task_start), (gst_task_pause),
(gst_task_join):
* gst/gsttask.h:
Protect the stream lock with the object lock.
Disallow setting the stream lock when running.
Add cleanup_all to wait for the threadpool to finish.
Remove code to autoallocate a mutex if none was provided.
Add _join() to wait for a task to stop.
Protect the thread pool with a global lock.
2005-08-24 20:49:53 +00:00
|
|
|
/* step 1, unblock loop function */
|
gst/base/gstbasesrc.*: Add a gboolean to decide when to push out a discont.
Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_do_seek), (gst_base_src_loop), (gst_base_src_start):
* gst/base/gstbasesrc.h:
Add a gboolean to decide when to push out a discont.
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_sink_activate_push), (gst_queue_src_activate_push),
(gst_queue_set_property), (gst_queue_get_property):
Some cleanups.
* tests/threadstate/threadstate1.c: (main):
Make a thread test compile and run... very silly..
2005-07-20 10:58:10 +00:00
|
|
|
GST_QUEUE_MUTEX_LOCK (queue);
|
2005-07-19 17:46:37 +00:00
|
|
|
queue->srcresult = GST_FLOW_WRONG_STATE;
|
check/generic/states.c: Make sure all tasks are stopped.
Original commit message from CVS:
* check/generic/states.c: (GST_START_TEST):
Make sure all tasks are stopped.
* check/gst/gstbin.c: (GST_START_TEST):
Unref after usage for proper valgrinding.
* gst/gstpad.c: (gst_pad_finalize), (gst_pad_stop_task):
Really wait for the task to stop before destroying the
mutex.
* gst/gstqueue.c: (gst_queue_sink_activate_push),
(gst_queue_src_activate_push):
Small cleanups. Don't stop the task when we did not start
it.
* gst/gsttask.c: (gst_task_get_type), (gst_task_init),
(gst_task_func), (gst_task_cleanup_all), (gst_task_set_lock),
(gst_task_get_state), (gst_task_start), (gst_task_pause),
(gst_task_join):
* gst/gsttask.h:
Protect the stream lock with the object lock.
Disallow setting the stream lock when running.
Add cleanup_all to wait for the threadpool to finish.
Remove code to autoallocate a mutex if none was provided.
Add _join() to wait for a task to stop.
Protect the thread pool with a global lock.
2005-08-24 20:49:53 +00:00
|
|
|
/* the item add signal will unblock */
|
gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer.
Original commit message from CVS:
2005-06-27 Andy Wingo <wingo@pobox.com>
* gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any
remaining buffer.
* gst/gsttrace.c (gst_alloc_trace_list_sorted): New helper,
returns a sorted copy of the trace list.
(gst_alloc_trace_print_live): New API, only prints traces with
live objects. Sort the list.
(gst_alloc_trace_print_all): Sort the list.
(gst_alloc_trace_print): Align columns.
* gst/elements/gstttypefindelement.c:
* gst/elements/gsttee.c:
* gst/base/gstbasesrc.c:
* gst/base/gstbasesink.c:
* gst/base/gstbasetransform.c:
* gst/gstqueue.c: Adapt for pad activation changes.
* gst/gstpipeline.c (gst_pipeline_init): Unref after parenting
sched.
(gst_pipeline_dispose): Drop ref on sched.
* gst/gstpad.c (gst_pad_init): Set the default activate func.
(gst_pad_activate_default): Push mode by default.
(pre_activate_switch, post_activate_switch): New stubs, things to
do before and after switching activation modes on pads.
(gst_pad_set_active): Take a boolean and not a mode, dispatch to
the pad's activate function to choose which mode to activate.
Shortcut on deactivation and call the right function directly.
(gst_pad_activate_pull): New API, (de)activates a pad in pull
mode.
(gst_pad_activate_push): New API, same for push mode.
(gst_pad_set_activate_function)
(gst_pad_set_activatepull_function)
(gst_pad_set_activatepush_function): Setters for new API.
* gst/gstminiobject.c (gst_mini_object_new, gst_mini_object_free):
Trace all miniobjects.
(gst_mini_object_make_writable): Unref the arg if we copy, like
gst_caps_make_writable.
* gst/gstmessage.c (_gst_message_initialize): No trace init.
* gst/gstghostpad.c (gst_proxy_pad_do_activate)
(gst_proxy_pad_do_activatepull, gst_proxy_pad_do_activatepush):
Adapt for new pad API.
* gst/gstevent.c (_gst_event_initialize): Don't initialize trace.
* gst/gstelement.h:
* gst/gstelement.c (gst_element_iterate_src_pads)
(gst_element_iterate_sink_pads): New API functions.
* gst/gstelement.c (iterator_fold_with_resync): New utility,
should fold into gstiterator.c in some form.
(gst_element_pads_activate): Simplified via use of fold and
delegation of decisions to gstpad->activate.
* gst/gstbus.c (gst_bus_source_finalize): Set the bus to NULL,
help in debugging.
* gst/gstbuffer.c (_gst_buffer_initialize): Ref the buffer type
class once in init, like gstmessage. Didn't run into this issue
but it seems correct. Don't initialize a trace, gstminiobject does
that.
* check/pipelines/simple_launch_lines.c (test_stop_from_app): New
test, runs fakesrc ! fakesink, stopping on ::handoff via a message
to the bus.
(assert_live_count): New util function, uses alloc traces to check
cleanup.
* check/gst/gstghostpad.c (test_ghost_pads): More refcount checks.
To be modified when unlink drops the internal pad.
2005-06-27 18:35:05 +00:00
|
|
|
g_cond_signal (queue->item_add);
|
gst/base/gstbasesrc.*: Add a gboolean to decide when to push out a discont.
Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_do_seek), (gst_base_src_loop), (gst_base_src_start):
* gst/base/gstbasesrc.h:
Add a gboolean to decide when to push out a discont.
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_sink_activate_push), (gst_queue_src_activate_push),
(gst_queue_set_property), (gst_queue_get_property):
Some cleanups.
* tests/threadstate/threadstate1.c: (main):
Make a thread test compile and run... very silly..
2005-07-20 10:58:10 +00:00
|
|
|
GST_QUEUE_MUTEX_UNLOCK (queue);
|
gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer.
Original commit message from CVS:
2005-06-27 Andy Wingo <wingo@pobox.com>
* gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any
remaining buffer.
* gst/gsttrace.c (gst_alloc_trace_list_sorted): New helper,
returns a sorted copy of the trace list.
(gst_alloc_trace_print_live): New API, only prints traces with
live objects. Sort the list.
(gst_alloc_trace_print_all): Sort the list.
(gst_alloc_trace_print): Align columns.
* gst/elements/gstttypefindelement.c:
* gst/elements/gsttee.c:
* gst/base/gstbasesrc.c:
* gst/base/gstbasesink.c:
* gst/base/gstbasetransform.c:
* gst/gstqueue.c: Adapt for pad activation changes.
* gst/gstpipeline.c (gst_pipeline_init): Unref after parenting
sched.
(gst_pipeline_dispose): Drop ref on sched.
* gst/gstpad.c (gst_pad_init): Set the default activate func.
(gst_pad_activate_default): Push mode by default.
(pre_activate_switch, post_activate_switch): New stubs, things to
do before and after switching activation modes on pads.
(gst_pad_set_active): Take a boolean and not a mode, dispatch to
the pad's activate function to choose which mode to activate.
Shortcut on deactivation and call the right function directly.
(gst_pad_activate_pull): New API, (de)activates a pad in pull
mode.
(gst_pad_activate_push): New API, same for push mode.
(gst_pad_set_activate_function)
(gst_pad_set_activatepull_function)
(gst_pad_set_activatepush_function): Setters for new API.
* gst/gstminiobject.c (gst_mini_object_new, gst_mini_object_free):
Trace all miniobjects.
(gst_mini_object_make_writable): Unref the arg if we copy, like
gst_caps_make_writable.
* gst/gstmessage.c (_gst_message_initialize): No trace init.
* gst/gstghostpad.c (gst_proxy_pad_do_activate)
(gst_proxy_pad_do_activatepull, gst_proxy_pad_do_activatepush):
Adapt for new pad API.
* gst/gstevent.c (_gst_event_initialize): Don't initialize trace.
* gst/gstelement.h:
* gst/gstelement.c (gst_element_iterate_src_pads)
(gst_element_iterate_sink_pads): New API functions.
* gst/gstelement.c (iterator_fold_with_resync): New utility,
should fold into gstiterator.c in some form.
(gst_element_pads_activate): Simplified via use of fold and
delegation of decisions to gstpad->activate.
* gst/gstbus.c (gst_bus_source_finalize): Set the bus to NULL,
help in debugging.
* gst/gstbuffer.c (_gst_buffer_initialize): Ref the buffer type
class once in init, like gstmessage. Didn't run into this issue
but it seems correct. Don't initialize a trace, gstminiobject does
that.
* check/pipelines/simple_launch_lines.c (test_stop_from_app): New
test, runs fakesrc ! fakesink, stopping on ::handoff via a message
to the bus.
(assert_live_count): New util function, uses alloc traces to check
cleanup.
* check/gst/gstghostpad.c (test_ghost_pads): More refcount checks.
To be modified when unlink drops the internal pad.
2005-06-27 18:35:05 +00:00
|
|
|
|
|
|
|
/* step 2, make sure streaming finishes */
|
|
|
|
result = gst_pad_stop_task (pad);
|
gst/: Fix state changes for non sinks. We now change sinks, then elements with unconnected srcpads, then the rest.
Original commit message from CVS:
* gst/gstbin.c: (bin_element_is_sink), (has_ancestor),
(bin_element_is_semi_sink), (append_child), (gst_bin_change_state):
* gst/gstpad.c: (gst_pad_set_active), (gst_pad_link_prepare),
(gst_pad_link), (gst_pad_accept_caps), (gst_pad_query),
(gst_pad_send_event), (gst_pad_start_task):
* gst/gstqueue.c: (gst_queue_init), (gst_queue_locked_flush),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_sink_activate), (gst_queue_src_activate),
(gst_queue_change_state):
* gst/gstqueue.h:
Fix state changes for non sinks. We now change sinks, then elements
with unconnected srcpads, then the rest.
More efficient queue unlocking in flush and state changes.
Set the pad activate mode even if it does not have an activate
function.
2005-05-25 19:33:39 +00:00
|
|
|
}
|
gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any remaining buffer.
Original commit message from CVS:
2005-06-27 Andy Wingo <wingo@pobox.com>
* gst/base/gsttypefindhelper.c (gst_type_find_helper): Unref any
remaining buffer.
* gst/gsttrace.c (gst_alloc_trace_list_sorted): New helper,
returns a sorted copy of the trace list.
(gst_alloc_trace_print_live): New API, only prints traces with
live objects. Sort the list.
(gst_alloc_trace_print_all): Sort the list.
(gst_alloc_trace_print): Align columns.
* gst/elements/gstttypefindelement.c:
* gst/elements/gsttee.c:
* gst/base/gstbasesrc.c:
* gst/base/gstbasesink.c:
* gst/base/gstbasetransform.c:
* gst/gstqueue.c: Adapt for pad activation changes.
* gst/gstpipeline.c (gst_pipeline_init): Unref after parenting
sched.
(gst_pipeline_dispose): Drop ref on sched.
* gst/gstpad.c (gst_pad_init): Set the default activate func.
(gst_pad_activate_default): Push mode by default.
(pre_activate_switch, post_activate_switch): New stubs, things to
do before and after switching activation modes on pads.
(gst_pad_set_active): Take a boolean and not a mode, dispatch to
the pad's activate function to choose which mode to activate.
Shortcut on deactivation and call the right function directly.
(gst_pad_activate_pull): New API, (de)activates a pad in pull
mode.
(gst_pad_activate_push): New API, same for push mode.
(gst_pad_set_activate_function)
(gst_pad_set_activatepull_function)
(gst_pad_set_activatepush_function): Setters for new API.
* gst/gstminiobject.c (gst_mini_object_new, gst_mini_object_free):
Trace all miniobjects.
(gst_mini_object_make_writable): Unref the arg if we copy, like
gst_caps_make_writable.
* gst/gstmessage.c (_gst_message_initialize): No trace init.
* gst/gstghostpad.c (gst_proxy_pad_do_activate)
(gst_proxy_pad_do_activatepull, gst_proxy_pad_do_activatepush):
Adapt for new pad API.
* gst/gstevent.c (_gst_event_initialize): Don't initialize trace.
* gst/gstelement.h:
* gst/gstelement.c (gst_element_iterate_src_pads)
(gst_element_iterate_sink_pads): New API functions.
* gst/gstelement.c (iterator_fold_with_resync): New utility,
should fold into gstiterator.c in some form.
(gst_element_pads_activate): Simplified via use of fold and
delegation of decisions to gstpad->activate.
* gst/gstbus.c (gst_bus_source_finalize): Set the bus to NULL,
help in debugging.
* gst/gstbuffer.c (_gst_buffer_initialize): Ref the buffer type
class once in init, like gstmessage. Didn't run into this issue
but it seems correct. Don't initialize a trace, gstminiobject does
that.
* check/pipelines/simple_launch_lines.c (test_stop_from_app): New
test, runs fakesrc ! fakesink, stopping on ::handoff via a message
to the bus.
(assert_live_count): New util function, uses alloc traces to check
cleanup.
* check/gst/gstghostpad.c (test_ghost_pads): More refcount checks.
To be modified when unlink drops the internal pad.
2005-06-27 18:35:05 +00:00
|
|
|
|
2005-07-19 17:46:37 +00:00
|
|
|
gst_object_unref (queue);
|
|
|
|
|
gst/: Fix state changes for non sinks. We now change sinks, then elements with unconnected srcpads, then the rest.
Original commit message from CVS:
* gst/gstbin.c: (bin_element_is_sink), (has_ancestor),
(bin_element_is_semi_sink), (append_child), (gst_bin_change_state):
* gst/gstpad.c: (gst_pad_set_active), (gst_pad_link_prepare),
(gst_pad_link), (gst_pad_accept_caps), (gst_pad_query),
(gst_pad_send_event), (gst_pad_start_task):
* gst/gstqueue.c: (gst_queue_init), (gst_queue_locked_flush),
(gst_queue_handle_sink_event), (gst_queue_chain), (gst_queue_loop),
(gst_queue_sink_activate), (gst_queue_src_activate),
(gst_queue_change_state):
* gst/gstqueue.h:
Fix state changes for non sinks. We now change sinks, then elements
with unconnected srcpads, then the rest.
More efficient queue unlocking in flush and state changes.
Set the pad activate mode even if it does not have an activate
function.
2005-05-25 19:33:39 +00:00
|
|
|
return result;
|
|
|
|
}
|
2005-03-21 17:34:02 +00:00
|
|
|
|
2005-09-02 15:42:00 +00:00
|
|
|
static GstStateChangeReturn
|
|
|
|
gst_queue_change_state (GstElement * element, GstStateChange transition)
|
2000-11-25 14:18:47 +00:00
|
|
|
{
|
2000-10-30 21:02:08 +00:00
|
|
|
GstQueue *queue;
|
2005-09-02 15:42:00 +00:00
|
|
|
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
|
2000-10-30 21:02:08 +00:00
|
|
|
|
2000-11-25 14:18:47 +00:00
|
|
|
queue = GST_QUEUE (element);
|
2001-05-25 21:00:07 +00:00
|
|
|
|
2005-09-02 15:42:00 +00:00
|
|
|
switch (transition) {
|
|
|
|
case GST_STATE_CHANGE_NULL_TO_READY:
|
2005-05-17 17:37:43 +00:00
|
|
|
break;
|
2005-09-02 15:42:00 +00:00
|
|
|
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
2003-01-15 21:01:58 +00:00
|
|
|
break;
|
2005-09-02 15:42:00 +00:00
|
|
|
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
2005-03-21 17:34:02 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2001-12-04 22:12:50 +00:00
|
|
|
|
2005-09-02 15:42:00 +00:00
|
|
|
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
2003-01-15 21:01:58 +00:00
|
|
|
|
2005-09-02 15:42:00 +00:00
|
|
|
switch (transition) {
|
|
|
|
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
2003-01-15 21:01:58 +00:00
|
|
|
break;
|
2005-09-02 15:42:00 +00:00
|
|
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
2005-03-21 17:34:02 +00:00
|
|
|
break;
|
2005-09-02 15:42:00 +00:00
|
|
|
case GST_STATE_CHANGE_READY_TO_NULL:
|
2003-01-15 21:01:58 +00:00
|
|
|
break;
|
2003-12-13 17:12:46 +00:00
|
|
|
default:
|
2003-01-15 21:01:58 +00:00
|
|
|
break;
|
2001-12-04 22:12:50 +00:00
|
|
|
}
|
2000-10-30 21:02:08 +00:00
|
|
|
|
2001-05-25 21:00:07 +00:00
|
|
|
return ret;
|
2000-10-30 21:02:08 +00:00
|
|
|
}
|
|
|
|
|
2001-01-20 17:59:25 +00:00
|
|
|
static void
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_queue_set_property (GObject * object,
|
|
|
|
guint prop_id, const GValue * value, GParamSpec * pspec)
|
2000-11-25 14:18:47 +00:00
|
|
|
{
|
2003-12-13 17:12:46 +00:00
|
|
|
GstQueue *queue = GST_QUEUE (object);
|
2001-01-20 17:59:25 +00:00
|
|
|
|
2003-12-13 17:12:46 +00:00
|
|
|
/* someone could change levels here, and since this
|
|
|
|
* affects the get/put funcs, we need to lock for safety. */
|
gst/base/gstbasesrc.*: Add a gboolean to decide when to push out a discont.
Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_do_seek), (gst_base_src_loop), (gst_base_src_start):
* gst/base/gstbasesrc.h:
Add a gboolean to decide when to push out a discont.
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_sink_activate_push), (gst_queue_src_activate_push),
(gst_queue_set_property), (gst_queue_get_property):
Some cleanups.
* tests/threadstate/threadstate1.c: (main):
Make a thread test compile and run... very silly..
2005-07-20 10:58:10 +00:00
|
|
|
GST_QUEUE_MUTEX_LOCK (queue);
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2001-06-25 01:20:11 +00:00
|
|
|
switch (prop_id) {
|
2003-12-13 17:12:46 +00:00
|
|
|
case ARG_MAX_SIZE_BYTES:
|
|
|
|
queue->max_size.bytes = g_value_get_uint (value);
|
|
|
|
break;
|
|
|
|
case ARG_MAX_SIZE_BUFFERS:
|
|
|
|
queue->max_size.buffers = g_value_get_uint (value);
|
|
|
|
break;
|
|
|
|
case ARG_MAX_SIZE_TIME:
|
|
|
|
queue->max_size.time = g_value_get_uint64 (value);
|
2000-02-13 15:20:49 +00:00
|
|
|
break;
|
2004-01-15 20:37:07 +00:00
|
|
|
case ARG_MIN_THRESHOLD_BYTES:
|
|
|
|
queue->min_threshold.bytes = g_value_get_uint (value);
|
plugins/elements/gstqueue.*: In queue, when EOS is received, if minimum threshold > max_size - current_level, there i...
Original commit message from CVS:
Patch by Tommi Myöhänen <ext-tommi dot myohanen at nokia dot com>
* plugins/elements/gstqueue.c: (gst_queue_init),
(gst_queue_locked_flush), (gst_queue_handle_sink_event),
(gst_queue_set_property):
* plugins/elements/gstqueue.h:
In queue, when EOS is received, if minimum threshold > max_size -
current_level, there is chance that queue blocks forever in conditional item
del wait. This is because the queue is not emptied completely due to minimum
threshold.
Here is another approach. Instead of setting cur_levels to max in EOS, just
zero all minimum threshold levels. This should make sure that queue gives out
all data. When going to READY (stop) state, just reset the original minimum
threshold levels.
Fixes #336336.
2006-03-29 11:02:33 +00:00
|
|
|
queue->orig_min_threshold.bytes = queue->min_threshold.bytes;
|
2001-12-22 21:18:17 +00:00
|
|
|
break;
|
2004-01-15 20:37:07 +00:00
|
|
|
case ARG_MIN_THRESHOLD_BUFFERS:
|
|
|
|
queue->min_threshold.buffers = g_value_get_uint (value);
|
plugins/elements/gstqueue.*: In queue, when EOS is received, if minimum threshold > max_size - current_level, there i...
Original commit message from CVS:
Patch by Tommi Myöhänen <ext-tommi dot myohanen at nokia dot com>
* plugins/elements/gstqueue.c: (gst_queue_init),
(gst_queue_locked_flush), (gst_queue_handle_sink_event),
(gst_queue_set_property):
* plugins/elements/gstqueue.h:
In queue, when EOS is received, if minimum threshold > max_size -
current_level, there is chance that queue blocks forever in conditional item
del wait. This is because the queue is not emptied completely due to minimum
threshold.
Here is another approach. Instead of setting cur_levels to max in EOS, just
zero all minimum threshold levels. This should make sure that queue gives out
all data. When going to READY (stop) state, just reset the original minimum
threshold levels.
Fixes #336336.
2006-03-29 11:02:33 +00:00
|
|
|
queue->orig_min_threshold.buffers = queue->min_threshold.buffers;
|
2003-12-13 17:12:46 +00:00
|
|
|
break;
|
2004-01-15 20:37:07 +00:00
|
|
|
case ARG_MIN_THRESHOLD_TIME:
|
|
|
|
queue->min_threshold.time = g_value_get_uint64 (value);
|
plugins/elements/gstqueue.*: In queue, when EOS is received, if minimum threshold > max_size - current_level, there i...
Original commit message from CVS:
Patch by Tommi Myöhänen <ext-tommi dot myohanen at nokia dot com>
* plugins/elements/gstqueue.c: (gst_queue_init),
(gst_queue_locked_flush), (gst_queue_handle_sink_event),
(gst_queue_set_property):
* plugins/elements/gstqueue.h:
In queue, when EOS is received, if minimum threshold > max_size -
current_level, there is chance that queue blocks forever in conditional item
del wait. This is because the queue is not emptied completely due to minimum
threshold.
Here is another approach. Instead of setting cur_levels to max in EOS, just
zero all minimum threshold levels. This should make sure that queue gives out
all data. When going to READY (stop) state, just reset the original minimum
threshold levels.
Fixes #336336.
2006-03-29 11:02:33 +00:00
|
|
|
queue->orig_min_threshold.time = queue->min_threshold.time;
|
2003-12-13 17:12:46 +00:00
|
|
|
break;
|
|
|
|
case ARG_LEAKY:
|
|
|
|
queue->leaky = g_value_get_enum (value);
|
2003-05-30 23:20:02 +00:00
|
|
|
break;
|
2000-01-30 09:03:00 +00:00
|
|
|
default:
|
2001-06-25 01:20:11 +00:00
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
2000-01-30 09:03:00 +00:00
|
|
|
break;
|
|
|
|
}
|
2003-12-13 17:12:46 +00:00
|
|
|
|
gst/base/gstbasesrc.*: Add a gboolean to decide when to push out a discont.
Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_do_seek), (gst_base_src_loop), (gst_base_src_start):
* gst/base/gstbasesrc.h:
Add a gboolean to decide when to push out a discont.
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_sink_activate_push), (gst_queue_src_activate_push),
(gst_queue_set_property), (gst_queue_get_property):
Some cleanups.
* tests/threadstate/threadstate1.c: (main):
Make a thread test compile and run... very silly..
2005-07-20 10:58:10 +00:00
|
|
|
GST_QUEUE_MUTEX_UNLOCK (queue);
|
2000-01-30 09:03:00 +00:00
|
|
|
}
|
|
|
|
|
2001-01-20 17:59:25 +00:00
|
|
|
static void
|
2004-03-13 15:27:01 +00:00
|
|
|
gst_queue_get_property (GObject * object,
|
|
|
|
guint prop_id, GValue * value, GParamSpec * pspec)
|
2000-11-25 14:18:47 +00:00
|
|
|
{
|
2003-12-13 17:12:46 +00:00
|
|
|
GstQueue *queue = GST_QUEUE (object);
|
2000-01-30 09:03:00 +00:00
|
|
|
|
gst/base/gstbasesrc.*: Add a gboolean to decide when to push out a discont.
Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_do_seek), (gst_base_src_loop), (gst_base_src_start):
* gst/base/gstbasesrc.h:
Add a gboolean to decide when to push out a discont.
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_sink_activate_push), (gst_queue_src_activate_push),
(gst_queue_set_property), (gst_queue_get_property):
Some cleanups.
* tests/threadstate/threadstate1.c: (main):
Make a thread test compile and run... very silly..
2005-07-20 10:58:10 +00:00
|
|
|
GST_QUEUE_MUTEX_LOCK (queue);
|
2005-07-19 17:46:37 +00:00
|
|
|
|
2001-06-25 01:20:11 +00:00
|
|
|
switch (prop_id) {
|
2003-12-13 17:12:46 +00:00
|
|
|
case ARG_CUR_LEVEL_BYTES:
|
|
|
|
g_value_set_uint (value, queue->cur_level.bytes);
|
|
|
|
break;
|
|
|
|
case ARG_CUR_LEVEL_BUFFERS:
|
|
|
|
g_value_set_uint (value, queue->cur_level.buffers);
|
|
|
|
break;
|
|
|
|
case ARG_CUR_LEVEL_TIME:
|
|
|
|
g_value_set_uint64 (value, queue->cur_level.time);
|
|
|
|
break;
|
|
|
|
case ARG_MAX_SIZE_BYTES:
|
|
|
|
g_value_set_uint (value, queue->max_size.bytes);
|
2001-05-25 21:00:07 +00:00
|
|
|
break;
|
2003-12-13 17:12:46 +00:00
|
|
|
case ARG_MAX_SIZE_BUFFERS:
|
|
|
|
g_value_set_uint (value, queue->max_size.buffers);
|
2000-01-30 09:03:00 +00:00
|
|
|
break;
|
2003-12-13 17:12:46 +00:00
|
|
|
case ARG_MAX_SIZE_TIME:
|
|
|
|
g_value_set_uint64 (value, queue->max_size.time);
|
2001-12-22 21:18:17 +00:00
|
|
|
break;
|
2004-01-15 20:37:07 +00:00
|
|
|
case ARG_MIN_THRESHOLD_BYTES:
|
|
|
|
g_value_set_uint (value, queue->min_threshold.bytes);
|
2003-12-13 17:12:46 +00:00
|
|
|
break;
|
2004-01-15 20:37:07 +00:00
|
|
|
case ARG_MIN_THRESHOLD_BUFFERS:
|
|
|
|
g_value_set_uint (value, queue->min_threshold.buffers);
|
2003-12-13 17:12:46 +00:00
|
|
|
break;
|
2004-01-15 20:37:07 +00:00
|
|
|
case ARG_MIN_THRESHOLD_TIME:
|
|
|
|
g_value_set_uint64 (value, queue->min_threshold.time);
|
2003-12-13 17:12:46 +00:00
|
|
|
break;
|
|
|
|
case ARG_LEAKY:
|
|
|
|
g_value_set_enum (value, queue->leaky);
|
2003-05-30 23:20:02 +00:00
|
|
|
break;
|
2000-01-30 09:03:00 +00:00
|
|
|
default:
|
2001-06-25 01:20:11 +00:00
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
2000-01-30 09:03:00 +00:00
|
|
|
break;
|
|
|
|
}
|
2005-07-19 17:46:37 +00:00
|
|
|
|
gst/base/gstbasesrc.*: Add a gboolean to decide when to push out a discont.
Original commit message from CVS:
* gst/base/gstbasesrc.c: (gst_base_src_init),
(gst_base_src_do_seek), (gst_base_src_loop), (gst_base_src_start):
* gst/base/gstbasesrc.h:
Add a gboolean to decide when to push out a discont.
* gst/gstqueue.c: (gst_queue_handle_sink_event), (gst_queue_chain),
(gst_queue_loop), (gst_queue_handle_src_query),
(gst_queue_sink_activate_push), (gst_queue_src_activate_push),
(gst_queue_set_property), (gst_queue_get_property):
Some cleanups.
* tests/threadstate/threadstate1.c: (main):
Make a thread test compile and run... very silly..
2005-07-20 10:58:10 +00:00
|
|
|
GST_QUEUE_MUTEX_UNLOCK (queue);
|
2000-01-30 09:03:00 +00:00
|
|
|
}
|