gstreamer/plugins/elements/gstmultiqueue.c

1499 lines
45 KiB
C
Raw Normal View History

libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
/* GStreamer
* Copyright (C) 2006 Edward Hervey <edward@fluendo.com>
* Copyright (C) 2007 Jan Schmidt <jan@fluendo.com>
* Copyright (C) 2007 Wim Taymans <wim@fluendo.com>
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
*
* gstmultiqueue.c:
*
* 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.
*/
/**
* SECTION:element-multiqueue
* @see_also: #GstQueue
*
* <refsect2>
* <para>
* Multiqueue is similar to a normal #GstQueue with the following additional
* features:
* <orderedlist>
* <listitem>
* <itemizedlist><title>Multiple streamhandling</title>
* <listitem><para>
* The element handles queueing data on more than one stream at once. To
* achieve such a feature it has request sink pads (sink%d) and
* 'sometimes' src pads (src%d).
* </para><para>
* When requesting a given sinkpad with gst_element_get_request_pad(),
* the associated srcpad for that stream will be created.
* Example: requesting sink1 will generate src1.
* </para></listitem>
* </itemizedlist>
* </listitem>
* <listitem>
* <itemizedlist><title>Non-starvation on multiple streams</title>
* <listitem><para>
* If more than one stream is used with the element, the streams' queues
* will be dynamically grown (up to a limit), in order to ensure that no
* stream is risking data starvation. This guarantees that at any given
* time there are at least N bytes queued and available for each individual
* stream.
* </para><para>
* If an EOS event comes through a srcpad, the associated queue will be
* considered as 'not-empty' in the queue-size-growing algorithm.
* </para></listitem>
* </itemizedlist>
* </listitem>
* <listitem>
* <itemizedlist><title>Non-linked srcpads graceful handling</title>
* <listitem><para>
* In order to better support dynamic switching between streams, the multiqueue
* (unlike the current GStreamer queue) continues to push buffers on non-linked
* pads rather than shutting down.
* </para><para>
* In addition, to prevent a non-linked stream from very quickly consuming all
* available buffers and thus 'racing ahead' of the other streams, the element
* must ensure that buffers and inlined events for a non-linked stream are pushed
* in the same order as they were received, relative to the other streams
* controlled by the element. This means that a buffer cannot be pushed to a
* non-linked pad any sooner than buffers in any other stream which were received
* before it.
* </para></listitem>
* </itemizedlist>
* </listitem>
* </orderedlist>
* </para>
* <para>
* Data is queued until one of the limits specified by the
* #GstMultiQueue:max-size-buffers, #GstMultiQueue:max-size-bytes and/or
* #GstMultiQueue:max-size-time properties has been reached. Any attempt to push
* more buffers into the queue will block the pushing thread until more space
* becomes available. #GstMultiQueue:extra-size-buffers,
* </para>
* <para>
* #GstMultiQueue:extra-size-bytes and #GstMultiQueue:extra-size-time are
* currently unused.
* </para>
* <para>
* The default queue size limits are 5 buffers, 10MB of data, or
* two second worth of data, whichever is reached first. Note that the number
* of buffers will dynamically grow depending on the fill level of
* other queues.
* </para>
* <para>
* The #GstMultiQueue::underrun signal is emitted when all of the queues
* are empty. The #GstMultiQueue::overrun signal is emitted when one of the
* queues is filled.
* Both signals are emitted from the context of the streaming thread.
* </para>
* </refsect2>
*
* Last reviewed on 2008-01-25 (0.10.17)
*/
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <gst/gst.h>
#include "gstmultiqueue.h"
/**
* GstSingleQueue:
* @sinkpad: associated sink #GstPad
* @srcpad: associated source #GstPad
*
* Structure containing all information and properties about
* a single queue.
*/
typedef struct _GstSingleQueue GstSingleQueue;
struct _GstSingleQueue
{
/* unique identifier of the queue */
guint id;
GstMultiQueue *mqueue;
GstPad *sinkpad;
GstPad *srcpad;
/* flowreturn of previous srcpad push */
GstFlowReturn srcresult;
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
GstSegment sink_segment;
GstSegment src_segment;
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
/* queue of data */
GstDataQueue *queue;
GstDataQueueSize max_size, extra_size;
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
GstClockTime cur_time;
gboolean is_eos;
gboolean inextra; /* TRUE if the queue is currently in extradata mode */
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
/* Protected by global lock */
guint32 nextid; /* ID of the next object waiting to be pushed */
guint32 oldid; /* ID of the last object pushed (last in a series) */
GCond *turn; /* SingleQueue turn waiting conditional */
};
/* Extension of GstDataQueueItem structure for our usage */
typedef struct _GstMultiQueueItem GstMultiQueueItem;
struct _GstMultiQueueItem
{
GstMiniObject *object;
guint size;
guint64 duration;
gboolean visible;
GDestroyNotify destroy;
guint32 posid;
};
static GstSingleQueue *gst_single_queue_new (GstMultiQueue * mqueue);
static void gst_single_queue_free (GstSingleQueue * squeue);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
static void wake_up_next_non_linked (GstMultiQueue * mq);
static void compute_high_id (GstMultiQueue * mq);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink%d",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_STATIC_CAPS_ANY);
static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src%d",
GST_PAD_SRC,
GST_PAD_SOMETIMES,
GST_STATIC_CAPS_ANY);
GST_DEBUG_CATEGORY_STATIC (multi_queue_debug);
#define GST_CAT_DEFAULT (multi_queue_debug)
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
/* default limits, we try to keep up to 2 seconds of data and if there is not
* time, up to 10 MB. The number of buffers is dynamically scaled to make sure
* there is data in the queues. Normally, the byte and time limits are not hit
* in theses conditions. */
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
#define DEFAULT_MAX_SIZE_BYTES 10 * 1024 * 1024 /* 10 MB */
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
#define DEFAULT_MAX_SIZE_BUFFERS 5
#define DEFAULT_MAX_SIZE_TIME 2 * GST_SECOND
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
/* second limits. When we hit one of the above limits we are probably dealing
* with a badly muxed file and we scale the limits to these emergency values.
* This is currently not yet implemented. */
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
#define DEFAULT_EXTRA_SIZE_BYTES 10 * 1024 * 1024 /* 10 MB */
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
#define DEFAULT_EXTRA_SIZE_BUFFERS 5
#define DEFAULT_EXTRA_SIZE_TIME 3 * GST_SECOND
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
/* Signals and args */
enum
{
SIGNAL_UNDERRUN,
SIGNAL_OVERRUN,
LAST_SIGNAL
};
enum
{
ARG_0,
ARG_EXTRA_SIZE_BYTES,
ARG_EXTRA_SIZE_BUFFERS,
ARG_EXTRA_SIZE_TIME,
ARG_MAX_SIZE_BYTES,
ARG_MAX_SIZE_BUFFERS,
ARG_MAX_SIZE_TIME,
};
#define GST_MULTI_QUEUE_MUTEX_LOCK(q) G_STMT_START { \
g_mutex_lock (q->qlock); \
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
} G_STMT_END
#define GST_MULTI_QUEUE_MUTEX_UNLOCK(q) G_STMT_START { \
g_mutex_unlock (q->qlock); \
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
} G_STMT_END
static void gst_multi_queue_finalize (GObject * object);
static void gst_multi_queue_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec);
static void gst_multi_queue_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec);
static GstPad *gst_multi_queue_request_new_pad (GstElement * element,
GstPadTemplate * temp, const gchar * name);
static void gst_multi_queue_release_pad (GstElement * element, GstPad * pad);
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
static void gst_multi_queue_loop (GstPad * pad);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
#define _do_init(bla) \
GST_DEBUG_CATEGORY_INIT (multi_queue_debug, "multiqueue", 0, "multiqueue element");
GST_BOILERPLATE_FULL (GstMultiQueue, gst_multi_queue, GstElement,
GST_TYPE_ELEMENT, _do_init);
static guint gst_multi_queue_signals[LAST_SIGNAL] = { 0 };
static void
gst_multi_queue_base_init (gpointer g_class)
{
Revert previous changes to the behaviour of GstPadTemplates, etc and the possiblity to call them in class_init as it ... Original commit message from CVS: * gst/gstbin.c: (gst_bin_get_type), (gst_bin_base_init), (gst_bin_class_init): * gst/gstelement.c: (gst_element_base_class_init), (gst_element_class_add_pad_template): * gst/gstpadtemplate.c: (gst_pad_template_init): * gst/gstpipeline.c: (gst_pipeline_get_type), (gst_pipeline_base_init), (gst_pipeline_class_init): * libs/gst/base/gstbasesink.c: * libs/gst/base/gstbasesrc.c: (gst_base_src_get_type), (gst_base_src_base_init), (gst_base_src_class_init): * plugins/elements/gstcapsfilter.c: (gst_capsfilter_base_init), (gst_capsfilter_class_init): * plugins/elements/gstfakesink.c: (gst_fake_sink_base_init), (gst_fake_sink_class_init): * plugins/elements/gstfakesrc.c: (gst_fake_src_base_init), (gst_fake_src_class_init): * plugins/elements/gstfdsink.c: (gst_fd_sink_base_init), (gst_fd_sink_class_init): * plugins/elements/gstfdsrc.c: (gst_fd_src_base_init), (gst_fd_src_class_init): * plugins/elements/gstfilesink.c: (gst_file_sink_base_init), (gst_file_sink_class_init): * plugins/elements/gstfilesrc.c: (gst_file_src_base_init), (gst_file_src_class_init): * plugins/elements/gstidentity.c: (gst_identity_base_init), (gst_identity_class_init): * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init): * plugins/elements/gstqueue.c: (gst_queue_base_init), (gst_queue_class_init): * plugins/elements/gsttee.c: (gst_tee_base_init), (gst_tee_class_init): * plugins/elements/gsttypefindelement.c: (gst_type_find_element_base_init), (gst_type_find_element_class_init): * tests/check/gst/gstelement.c: (gst_element_suite): Revert previous changes to the behaviour of GstPadTemplates, etc and the possiblity to call them in class_init as it breaks too many elements. Reopens bug #491501. Should be applied again for 0.11, thus added a few FIXME 0.11 at several places.
2008-02-05 14:15:15 +00:00
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_set_details_simple (gstelement_class,
"MultiQueue",
"Generic", "Multiple data queue", "Edward Hervey <edward@fluendo.com>");
Revert previous changes to the behaviour of GstPadTemplates, etc and the possiblity to call them in class_init as it ... Original commit message from CVS: * gst/gstbin.c: (gst_bin_get_type), (gst_bin_base_init), (gst_bin_class_init): * gst/gstelement.c: (gst_element_base_class_init), (gst_element_class_add_pad_template): * gst/gstpadtemplate.c: (gst_pad_template_init): * gst/gstpipeline.c: (gst_pipeline_get_type), (gst_pipeline_base_init), (gst_pipeline_class_init): * libs/gst/base/gstbasesink.c: * libs/gst/base/gstbasesrc.c: (gst_base_src_get_type), (gst_base_src_base_init), (gst_base_src_class_init): * plugins/elements/gstcapsfilter.c: (gst_capsfilter_base_init), (gst_capsfilter_class_init): * plugins/elements/gstfakesink.c: (gst_fake_sink_base_init), (gst_fake_sink_class_init): * plugins/elements/gstfakesrc.c: (gst_fake_src_base_init), (gst_fake_src_class_init): * plugins/elements/gstfdsink.c: (gst_fd_sink_base_init), (gst_fd_sink_class_init): * plugins/elements/gstfdsrc.c: (gst_fd_src_base_init), (gst_fd_src_class_init): * plugins/elements/gstfilesink.c: (gst_file_sink_base_init), (gst_file_sink_class_init): * plugins/elements/gstfilesrc.c: (gst_file_src_base_init), (gst_file_src_class_init): * plugins/elements/gstidentity.c: (gst_identity_base_init), (gst_identity_class_init): * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init): * plugins/elements/gstqueue.c: (gst_queue_base_init), (gst_queue_class_init): * plugins/elements/gsttee.c: (gst_tee_base_init), (gst_tee_class_init): * plugins/elements/gsttypefindelement.c: (gst_type_find_element_base_init), (gst_type_find_element_class_init): * tests/check/gst/gstelement.c: (gst_element_suite): Revert previous changes to the behaviour of GstPadTemplates, etc and the possiblity to call them in class_init as it breaks too many elements. Reopens bug #491501. Should be applied again for 0.11, thus added a few FIXME 0.11 at several places.
2008-02-05 14:15:15 +00:00
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&sinktemplate));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&srctemplate));
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
}
static void
gst_multi_queue_class_init (GstMultiQueueClass * klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
gobject_class->set_property =
GST_DEBUG_FUNCPTR (gst_multi_queue_set_property);
gobject_class->get_property =
GST_DEBUG_FUNCPTR (gst_multi_queue_get_property);
/* SIGNALS */
/**
* GstMultiQueue::underrun:
* @multiqueue: the multqueue instance
*
* This signal is emitted from the streaming thread when there is
* no data in any of the queues inside the multiqueue instance (underrun).
*
* This indicates either starvation or EOS from the upstream data sources.
*/
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
gst_multi_queue_signals[SIGNAL_UNDERRUN] =
g_signal_new ("underrun", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GstMultiQueueClass, underrun), NULL, NULL,
g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
/**
* GstMultiQueue::overrun:
* @multiqueue: the multiqueue instance
*
* Reports that one of the queues in the multiqueue is full (overrun).
* A queue 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.
*
* This can be used as an indicator of pre-roll.
*/
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
gst_multi_queue_signals[SIGNAL_OVERRUN] =
g_signal_new ("overrun", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GstMultiQueueClass, overrun), NULL, NULL,
g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
/* PROPERTIES */
g_object_class_install_property (gobject_class, ARG_MAX_SIZE_BYTES,
g_param_spec_uint ("max-size-bytes", "Max. size (kB)",
"Max. amount of data in the queue (bytes, 0=disable)",
Define G_PARAM_STATIC_STRINGS if it's undefined (GLib < 2.13.0) and use it everywhere for GParamSpecs that use static... Original commit message from CVS: * docs/pwg/advanced-dparams.xml: * docs/pwg/building-props.xml: * docs/pwg/other-source.xml: * gst/glib-compat.h: * gst/gstbin.c: (gst_bin_class_init): * gst/gstclock.c: (gst_clock_class_init): * gst/gstindex.c: (gst_index_class_init): * gst/gstobject.c: (gst_object_class_init): * gst/gstpad.c: (gst_pad_class_init): * gst/gstpipeline.c: (gst_pipeline_class_init): * libs/gst/base/gstbasesink.c: (gst_base_sink_class_init): * libs/gst/base/gstbasesrc.c: (gst_base_src_class_init): * libs/gst/base/gstbasetransform.c: (gst_base_transform_class_init): * libs/gst/base/gstdataqueue.c: (gst_data_queue_class_init): * libs/gst/check/gstcheck.c: (_gst_check_fault_handler_restore), (_gst_check_fault_handler_sighandler), (_gst_check_fault_handler_setup), (gst_check_init): * libs/gst/controller/gstcontroller.c: (_gst_controller_class_init): * libs/gst/controller/gstlfocontrolsource.c: (gst_lfo_control_source_class_init): * libs/gst/net/gstnetclientclock.c: (gst_net_client_clock_class_init): * libs/gst/net/gstnettimeprovider.c: (gst_net_time_provider_class_init): * plugins/elements/gstcapsfilter.c: (gst_capsfilter_class_init): * plugins/elements/gstfakesink.c: (gst_fake_sink_class_init): * plugins/elements/gstfakesrc.c: (gst_fake_src_class_init): * plugins/elements/gstfdsink.c: (gst_fd_sink_class_init): * plugins/elements/gstfdsrc.c: (gst_fd_src_class_init): * plugins/elements/gstfilesink.c: (gst_file_sink_class_init): * plugins/elements/gstfilesrc.c: (gst_file_src_class_init): * plugins/elements/gstidentity.c: (gst_identity_class_init): * plugins/elements/gstmultiqueue.c: (gst_multi_queue_class_init): * plugins/elements/gstqueue.c: (gst_queue_class_init): * plugins/elements/gsttee.c: (gst_tee_class_init): * plugins/elements/gsttypefindelement.c: (gst_type_find_element_class_init): * plugins/indexers/gstfileindex.c: (gst_file_index_class_init): Define G_PARAM_STATIC_STRINGS if it's undefined (GLib < 2.13.0) and use it everywhere for GParamSpecs that use static strings (i.e. all). This gives us less memory usage, fewer allocations and thus less memory defragmentation. Fixes bug #523806.
2008-03-22 14:56:17 +00:00
0, G_MAXUINT, DEFAULT_MAX_SIZE_BYTES,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
g_object_class_install_property (gobject_class, ARG_MAX_SIZE_BUFFERS,
g_param_spec_uint ("max-size-buffers", "Max. size (buffers)",
Define G_PARAM_STATIC_STRINGS if it's undefined (GLib < 2.13.0) and use it everywhere for GParamSpecs that use static... Original commit message from CVS: * docs/pwg/advanced-dparams.xml: * docs/pwg/building-props.xml: * docs/pwg/other-source.xml: * gst/glib-compat.h: * gst/gstbin.c: (gst_bin_class_init): * gst/gstclock.c: (gst_clock_class_init): * gst/gstindex.c: (gst_index_class_init): * gst/gstobject.c: (gst_object_class_init): * gst/gstpad.c: (gst_pad_class_init): * gst/gstpipeline.c: (gst_pipeline_class_init): * libs/gst/base/gstbasesink.c: (gst_base_sink_class_init): * libs/gst/base/gstbasesrc.c: (gst_base_src_class_init): * libs/gst/base/gstbasetransform.c: (gst_base_transform_class_init): * libs/gst/base/gstdataqueue.c: (gst_data_queue_class_init): * libs/gst/check/gstcheck.c: (_gst_check_fault_handler_restore), (_gst_check_fault_handler_sighandler), (_gst_check_fault_handler_setup), (gst_check_init): * libs/gst/controller/gstcontroller.c: (_gst_controller_class_init): * libs/gst/controller/gstlfocontrolsource.c: (gst_lfo_control_source_class_init): * libs/gst/net/gstnetclientclock.c: (gst_net_client_clock_class_init): * libs/gst/net/gstnettimeprovider.c: (gst_net_time_provider_class_init): * plugins/elements/gstcapsfilter.c: (gst_capsfilter_class_init): * plugins/elements/gstfakesink.c: (gst_fake_sink_class_init): * plugins/elements/gstfakesrc.c: (gst_fake_src_class_init): * plugins/elements/gstfdsink.c: (gst_fd_sink_class_init): * plugins/elements/gstfdsrc.c: (gst_fd_src_class_init): * plugins/elements/gstfilesink.c: (gst_file_sink_class_init): * plugins/elements/gstfilesrc.c: (gst_file_src_class_init): * plugins/elements/gstidentity.c: (gst_identity_class_init): * plugins/elements/gstmultiqueue.c: (gst_multi_queue_class_init): * plugins/elements/gstqueue.c: (gst_queue_class_init): * plugins/elements/gsttee.c: (gst_tee_class_init): * plugins/elements/gsttypefindelement.c: (gst_type_find_element_class_init): * plugins/indexers/gstfileindex.c: (gst_file_index_class_init): Define G_PARAM_STATIC_STRINGS if it's undefined (GLib < 2.13.0) and use it everywhere for GParamSpecs that use static strings (i.e. all). This gives us less memory usage, fewer allocations and thus less memory defragmentation. Fixes bug #523806.
2008-03-22 14:56:17 +00:00
"Max. number of buffers in the queue (0=disable)", 0, G_MAXUINT,
DEFAULT_MAX_SIZE_BUFFERS,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
g_object_class_install_property (gobject_class, ARG_MAX_SIZE_TIME,
g_param_spec_uint64 ("max-size-time", "Max. size (ns)",
Define G_PARAM_STATIC_STRINGS if it's undefined (GLib < 2.13.0) and use it everywhere for GParamSpecs that use static... Original commit message from CVS: * docs/pwg/advanced-dparams.xml: * docs/pwg/building-props.xml: * docs/pwg/other-source.xml: * gst/glib-compat.h: * gst/gstbin.c: (gst_bin_class_init): * gst/gstclock.c: (gst_clock_class_init): * gst/gstindex.c: (gst_index_class_init): * gst/gstobject.c: (gst_object_class_init): * gst/gstpad.c: (gst_pad_class_init): * gst/gstpipeline.c: (gst_pipeline_class_init): * libs/gst/base/gstbasesink.c: (gst_base_sink_class_init): * libs/gst/base/gstbasesrc.c: (gst_base_src_class_init): * libs/gst/base/gstbasetransform.c: (gst_base_transform_class_init): * libs/gst/base/gstdataqueue.c: (gst_data_queue_class_init): * libs/gst/check/gstcheck.c: (_gst_check_fault_handler_restore), (_gst_check_fault_handler_sighandler), (_gst_check_fault_handler_setup), (gst_check_init): * libs/gst/controller/gstcontroller.c: (_gst_controller_class_init): * libs/gst/controller/gstlfocontrolsource.c: (gst_lfo_control_source_class_init): * libs/gst/net/gstnetclientclock.c: (gst_net_client_clock_class_init): * libs/gst/net/gstnettimeprovider.c: (gst_net_time_provider_class_init): * plugins/elements/gstcapsfilter.c: (gst_capsfilter_class_init): * plugins/elements/gstfakesink.c: (gst_fake_sink_class_init): * plugins/elements/gstfakesrc.c: (gst_fake_src_class_init): * plugins/elements/gstfdsink.c: (gst_fd_sink_class_init): * plugins/elements/gstfdsrc.c: (gst_fd_src_class_init): * plugins/elements/gstfilesink.c: (gst_file_sink_class_init): * plugins/elements/gstfilesrc.c: (gst_file_src_class_init): * plugins/elements/gstidentity.c: (gst_identity_class_init): * plugins/elements/gstmultiqueue.c: (gst_multi_queue_class_init): * plugins/elements/gstqueue.c: (gst_queue_class_init): * plugins/elements/gsttee.c: (gst_tee_class_init): * plugins/elements/gsttypefindelement.c: (gst_type_find_element_class_init): * plugins/indexers/gstfileindex.c: (gst_file_index_class_init): Define G_PARAM_STATIC_STRINGS if it's undefined (GLib < 2.13.0) and use it everywhere for GParamSpecs that use static strings (i.e. all). This gives us less memory usage, fewer allocations and thus less memory defragmentation. Fixes bug #523806.
2008-03-22 14:56:17 +00:00
"Max. amount of data in the queue (in ns, 0=disable)", 0, G_MAXUINT64,
DEFAULT_MAX_SIZE_TIME, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
g_object_class_install_property (gobject_class, ARG_EXTRA_SIZE_BYTES,
g_param_spec_uint ("extra-size-bytes", "Extra Size (kB)",
"Amount of data the queues can grow if one of them is empty (bytes, 0=disable)",
Define G_PARAM_STATIC_STRINGS if it's undefined (GLib < 2.13.0) and use it everywhere for GParamSpecs that use static... Original commit message from CVS: * docs/pwg/advanced-dparams.xml: * docs/pwg/building-props.xml: * docs/pwg/other-source.xml: * gst/glib-compat.h: * gst/gstbin.c: (gst_bin_class_init): * gst/gstclock.c: (gst_clock_class_init): * gst/gstindex.c: (gst_index_class_init): * gst/gstobject.c: (gst_object_class_init): * gst/gstpad.c: (gst_pad_class_init): * gst/gstpipeline.c: (gst_pipeline_class_init): * libs/gst/base/gstbasesink.c: (gst_base_sink_class_init): * libs/gst/base/gstbasesrc.c: (gst_base_src_class_init): * libs/gst/base/gstbasetransform.c: (gst_base_transform_class_init): * libs/gst/base/gstdataqueue.c: (gst_data_queue_class_init): * libs/gst/check/gstcheck.c: (_gst_check_fault_handler_restore), (_gst_check_fault_handler_sighandler), (_gst_check_fault_handler_setup), (gst_check_init): * libs/gst/controller/gstcontroller.c: (_gst_controller_class_init): * libs/gst/controller/gstlfocontrolsource.c: (gst_lfo_control_source_class_init): * libs/gst/net/gstnetclientclock.c: (gst_net_client_clock_class_init): * libs/gst/net/gstnettimeprovider.c: (gst_net_time_provider_class_init): * plugins/elements/gstcapsfilter.c: (gst_capsfilter_class_init): * plugins/elements/gstfakesink.c: (gst_fake_sink_class_init): * plugins/elements/gstfakesrc.c: (gst_fake_src_class_init): * plugins/elements/gstfdsink.c: (gst_fd_sink_class_init): * plugins/elements/gstfdsrc.c: (gst_fd_src_class_init): * plugins/elements/gstfilesink.c: (gst_file_sink_class_init): * plugins/elements/gstfilesrc.c: (gst_file_src_class_init): * plugins/elements/gstidentity.c: (gst_identity_class_init): * plugins/elements/gstmultiqueue.c: (gst_multi_queue_class_init): * plugins/elements/gstqueue.c: (gst_queue_class_init): * plugins/elements/gsttee.c: (gst_tee_class_init): * plugins/elements/gsttypefindelement.c: (gst_type_find_element_class_init): * plugins/indexers/gstfileindex.c: (gst_file_index_class_init): Define G_PARAM_STATIC_STRINGS if it's undefined (GLib < 2.13.0) and use it everywhere for GParamSpecs that use static strings (i.e. all). This gives us less memory usage, fewer allocations and thus less memory defragmentation. Fixes bug #523806.
2008-03-22 14:56:17 +00:00
0, G_MAXUINT, DEFAULT_EXTRA_SIZE_BYTES,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
g_object_class_install_property (gobject_class, ARG_EXTRA_SIZE_BUFFERS,
g_param_spec_uint ("extra-size-buffers", "Extra Size (buffers)",
"Amount of buffers the queues can grow if one of them is empty (0=disable)",
Define G_PARAM_STATIC_STRINGS if it's undefined (GLib < 2.13.0) and use it everywhere for GParamSpecs that use static... Original commit message from CVS: * docs/pwg/advanced-dparams.xml: * docs/pwg/building-props.xml: * docs/pwg/other-source.xml: * gst/glib-compat.h: * gst/gstbin.c: (gst_bin_class_init): * gst/gstclock.c: (gst_clock_class_init): * gst/gstindex.c: (gst_index_class_init): * gst/gstobject.c: (gst_object_class_init): * gst/gstpad.c: (gst_pad_class_init): * gst/gstpipeline.c: (gst_pipeline_class_init): * libs/gst/base/gstbasesink.c: (gst_base_sink_class_init): * libs/gst/base/gstbasesrc.c: (gst_base_src_class_init): * libs/gst/base/gstbasetransform.c: (gst_base_transform_class_init): * libs/gst/base/gstdataqueue.c: (gst_data_queue_class_init): * libs/gst/check/gstcheck.c: (_gst_check_fault_handler_restore), (_gst_check_fault_handler_sighandler), (_gst_check_fault_handler_setup), (gst_check_init): * libs/gst/controller/gstcontroller.c: (_gst_controller_class_init): * libs/gst/controller/gstlfocontrolsource.c: (gst_lfo_control_source_class_init): * libs/gst/net/gstnetclientclock.c: (gst_net_client_clock_class_init): * libs/gst/net/gstnettimeprovider.c: (gst_net_time_provider_class_init): * plugins/elements/gstcapsfilter.c: (gst_capsfilter_class_init): * plugins/elements/gstfakesink.c: (gst_fake_sink_class_init): * plugins/elements/gstfakesrc.c: (gst_fake_src_class_init): * plugins/elements/gstfdsink.c: (gst_fd_sink_class_init): * plugins/elements/gstfdsrc.c: (gst_fd_src_class_init): * plugins/elements/gstfilesink.c: (gst_file_sink_class_init): * plugins/elements/gstfilesrc.c: (gst_file_src_class_init): * plugins/elements/gstidentity.c: (gst_identity_class_init): * plugins/elements/gstmultiqueue.c: (gst_multi_queue_class_init): * plugins/elements/gstqueue.c: (gst_queue_class_init): * plugins/elements/gsttee.c: (gst_tee_class_init): * plugins/elements/gsttypefindelement.c: (gst_type_find_element_class_init): * plugins/indexers/gstfileindex.c: (gst_file_index_class_init): Define G_PARAM_STATIC_STRINGS if it's undefined (GLib < 2.13.0) and use it everywhere for GParamSpecs that use static strings (i.e. all). This gives us less memory usage, fewer allocations and thus less memory defragmentation. Fixes bug #523806.
2008-03-22 14:56:17 +00:00
0, G_MAXUINT, DEFAULT_EXTRA_SIZE_BUFFERS,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
g_object_class_install_property (gobject_class, ARG_EXTRA_SIZE_TIME,
g_param_spec_uint64 ("extra-size-time", "Extra Size (ns)",
"Amount of time the queues can grow if one of them is empty (in ns, 0=disable)",
Define G_PARAM_STATIC_STRINGS if it's undefined (GLib < 2.13.0) and use it everywhere for GParamSpecs that use static... Original commit message from CVS: * docs/pwg/advanced-dparams.xml: * docs/pwg/building-props.xml: * docs/pwg/other-source.xml: * gst/glib-compat.h: * gst/gstbin.c: (gst_bin_class_init): * gst/gstclock.c: (gst_clock_class_init): * gst/gstindex.c: (gst_index_class_init): * gst/gstobject.c: (gst_object_class_init): * gst/gstpad.c: (gst_pad_class_init): * gst/gstpipeline.c: (gst_pipeline_class_init): * libs/gst/base/gstbasesink.c: (gst_base_sink_class_init): * libs/gst/base/gstbasesrc.c: (gst_base_src_class_init): * libs/gst/base/gstbasetransform.c: (gst_base_transform_class_init): * libs/gst/base/gstdataqueue.c: (gst_data_queue_class_init): * libs/gst/check/gstcheck.c: (_gst_check_fault_handler_restore), (_gst_check_fault_handler_sighandler), (_gst_check_fault_handler_setup), (gst_check_init): * libs/gst/controller/gstcontroller.c: (_gst_controller_class_init): * libs/gst/controller/gstlfocontrolsource.c: (gst_lfo_control_source_class_init): * libs/gst/net/gstnetclientclock.c: (gst_net_client_clock_class_init): * libs/gst/net/gstnettimeprovider.c: (gst_net_time_provider_class_init): * plugins/elements/gstcapsfilter.c: (gst_capsfilter_class_init): * plugins/elements/gstfakesink.c: (gst_fake_sink_class_init): * plugins/elements/gstfakesrc.c: (gst_fake_src_class_init): * plugins/elements/gstfdsink.c: (gst_fd_sink_class_init): * plugins/elements/gstfdsrc.c: (gst_fd_src_class_init): * plugins/elements/gstfilesink.c: (gst_file_sink_class_init): * plugins/elements/gstfilesrc.c: (gst_file_src_class_init): * plugins/elements/gstidentity.c: (gst_identity_class_init): * plugins/elements/gstmultiqueue.c: (gst_multi_queue_class_init): * plugins/elements/gstqueue.c: (gst_queue_class_init): * plugins/elements/gsttee.c: (gst_tee_class_init): * plugins/elements/gsttypefindelement.c: (gst_type_find_element_class_init): * plugins/indexers/gstfileindex.c: (gst_file_index_class_init): Define G_PARAM_STATIC_STRINGS if it's undefined (GLib < 2.13.0) and use it everywhere for GParamSpecs that use static strings (i.e. all). This gives us less memory usage, fewer allocations and thus less memory defragmentation. Fixes bug #523806.
2008-03-22 14:56:17 +00:00
0, G_MAXUINT64, DEFAULT_EXTRA_SIZE_TIME,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_multi_queue_finalize);
gstelement_class->request_new_pad =
GST_DEBUG_FUNCPTR (gst_multi_queue_request_new_pad);
gstelement_class->release_pad =
GST_DEBUG_FUNCPTR (gst_multi_queue_release_pad);
}
static void
gst_multi_queue_init (GstMultiQueue * mqueue, GstMultiQueueClass * klass)
{
mqueue->nbqueues = 0;
mqueue->queues = NULL;
mqueue->max_size.bytes = DEFAULT_MAX_SIZE_BYTES;
mqueue->max_size.visible = DEFAULT_MAX_SIZE_BUFFERS;
mqueue->max_size.time = DEFAULT_MAX_SIZE_TIME;
mqueue->extra_size.bytes = DEFAULT_EXTRA_SIZE_BYTES;
mqueue->extra_size.visible = DEFAULT_EXTRA_SIZE_BUFFERS;
mqueue->extra_size.time = DEFAULT_EXTRA_SIZE_TIME;
mqueue->counter = 1;
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
mqueue->highid = -1;
mqueue->nextnotlinked = -1;
mqueue->qlock = g_mutex_new ();
}
static void
gst_multi_queue_finalize (GObject * object)
{
GstMultiQueue *mqueue = GST_MULTI_QUEUE (object);
g_list_foreach (mqueue->queues, (GFunc) gst_single_queue_free, NULL);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
g_list_free (mqueue->queues);
mqueue->queues = NULL;
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
/* free/unref instance data */
g_mutex_free (mqueue->qlock);
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
G_OBJECT_CLASS (parent_class)->finalize (object);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
}
#define SET_CHILD_PROPERTY(mq,format) G_STMT_START { \
GList * tmp = mq->queues; \
while (tmp) { \
GstSingleQueue *q = (GstSingleQueue*)tmp->data; \
q->max_size.format = mq->max_size.format; \
tmp = g_list_next(tmp); \
}; \
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
} G_STMT_END
static void
gst_multi_queue_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstMultiQueue *mq = GST_MULTI_QUEUE (object);
switch (prop_id) {
case ARG_MAX_SIZE_BYTES:
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
mq->max_size.bytes = g_value_get_uint (value);
SET_CHILD_PROPERTY (mq, bytes);
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
break;
case ARG_MAX_SIZE_BUFFERS:
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
mq->max_size.visible = g_value_get_uint (value);
SET_CHILD_PROPERTY (mq, visible);
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
break;
case ARG_MAX_SIZE_TIME:
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
mq->max_size.time = g_value_get_uint64 (value);
SET_CHILD_PROPERTY (mq, time);
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
break;
case ARG_EXTRA_SIZE_BYTES:
mq->extra_size.bytes = g_value_get_uint (value);
break;
case ARG_EXTRA_SIZE_BUFFERS:
mq->extra_size.visible = g_value_get_uint (value);
break;
case ARG_EXTRA_SIZE_TIME:
mq->extra_size.time = g_value_get_uint64 (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_multi_queue_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
GstMultiQueue *mq = GST_MULTI_QUEUE (object);
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
switch (prop_id) {
case ARG_EXTRA_SIZE_BYTES:
g_value_set_uint (value, mq->extra_size.bytes);
break;
case ARG_EXTRA_SIZE_BUFFERS:
g_value_set_uint (value, mq->extra_size.visible);
break;
case ARG_EXTRA_SIZE_TIME:
g_value_set_uint64 (value, mq->extra_size.time);
break;
case ARG_MAX_SIZE_BYTES:
g_value_set_uint (value, mq->max_size.bytes);
break;
case ARG_MAX_SIZE_BUFFERS:
g_value_set_uint (value, mq->max_size.visible);
break;
case ARG_MAX_SIZE_TIME:
g_value_set_uint64 (value, mq->max_size.time);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
}
Correct all relevant warnings found by the sparse semantic code analyzer. This include marking several symbols static... Original commit message from CVS: * gst/gstconfig.h.in: * libs/gst/base/gstcollectpads.c: (gst_collect_pads_read_buffer): * libs/gst/check/gstcheck.c: (gst_check_log_message_func), (gst_check_log_critical_func), (gst_check_drop_buffers), (gst_check_element_push_buffer_list): * libs/gst/controller/gstcontroller.c: (gst_controller_get), (gst_controller_get_type): * libs/gst/controller/gsthelper.c: (gst_object_control_properties), (gst_object_get_controller), (gst_object_get_control_source): * libs/gst/controller/gstinterpolationcontrolsource.c: (gst_interpolation_control_source_new): * libs/gst/controller/gstlfocontrolsource.c: (gst_lfo_control_source_new): * libs/gst/dataprotocol/dataprotocol.c: (gst_dp_event_from_packet_0_2): * plugins/elements/gstfdsrc.c: * plugins/elements/gstmultiqueue.c: * plugins/elements/gsttee.c: * plugins/elements/gsttypefindelement.c: * plugins/indexers/gstfileindex.c: (_file_index_id_save_xml), (gst_file_index_add_association): * plugins/indexers/gstmemindex.c: * tests/benchmarks/gstpollstress.c: (mess_some_more): * tests/check/elements/queue.c: (setup_queue): * tests/check/gst/gstpipeline.c: * tests/check/libs/collectpads.c: (setup), (teardown), (gst_collect_pads_suite): * tests/examples/adapter/adapter_test.c: * tests/examples/metadata/read-metadata.c: (make_pipeline): * tests/examples/xml/createxml.c: * tests/examples/xml/runxml.c: * tools/gst-inspect.c: * tools/gst-run.c: Correct all relevant warnings found by the sparse semantic code analyzer. This include marking several symbols static, using NULL instead of 0 for pointers, not using variable sized arrays on the stack, moving variable declarations to the beginning of a block and using "foo (void)" instead of "foo ()" for declarations.
2008-02-29 12:41:33 +00:00
static GList *
gst_multi_queue_get_internal_links (GstPad * pad)
{
GList *res = NULL;
GstMultiQueue *mqueue;
GstSingleQueue *sq = NULL;
GList *tmp;
g_return_val_if_fail (GST_IS_PAD (pad), NULL);
mqueue = GST_MULTI_QUEUE (GST_PAD_PARENT (pad));
if (!mqueue)
goto no_parent;
GST_MULTI_QUEUE_MUTEX_LOCK (mqueue);
/* Find which single queue it belongs to */
for (tmp = mqueue->queues; tmp && !res; tmp = g_list_next (tmp)) {
sq = (GstSingleQueue *) tmp->data;
if (sq->sinkpad == pad)
res = g_list_prepend (res, sq->srcpad);
if (sq->srcpad == pad)
res = g_list_prepend (res, sq->sinkpad);
}
if (!res)
GST_WARNING_OBJECT (mqueue, "That pad doesn't belong to this element ???");
GST_MULTI_QUEUE_MUTEX_UNLOCK (mqueue);
return res;
no_parent:
{
GST_DEBUG_OBJECT (pad, "no parent");
return NULL;
}
}
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
/*
* GstElement methods
*/
static GstPad *
gst_multi_queue_request_new_pad (GstElement * element, GstPadTemplate * temp,
const gchar * name)
{
GstMultiQueue *mqueue = GST_MULTI_QUEUE (element);
GstSingleQueue *squeue;
GST_LOG_OBJECT (element, "name : %s", GST_STR_NULL (name));
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
/* Create a new single queue, add the sink and source pad and return the sink pad */
squeue = gst_single_queue_new (mqueue);
GST_MULTI_QUEUE_MUTEX_LOCK (mqueue);
mqueue->queues = g_list_append (mqueue->queues, squeue);
GST_MULTI_QUEUE_MUTEX_UNLOCK (mqueue);
GST_DEBUG_OBJECT (mqueue, "Returning pad %s:%s",
GST_DEBUG_PAD_NAME (squeue->sinkpad));
return squeue->sinkpad;
}
static void
gst_multi_queue_release_pad (GstElement * element, GstPad * pad)
{
GstMultiQueue *mqueue = GST_MULTI_QUEUE (element);
GstSingleQueue *sq = NULL;
GList *tmp;
GST_LOG_OBJECT (element, "pad %s:%s", GST_DEBUG_PAD_NAME (pad));
GST_MULTI_QUEUE_MUTEX_LOCK (mqueue);
/* Find which single queue it belongs to, knowing that it should be a sinkpad */
for (tmp = mqueue->queues; tmp; tmp = g_list_next (tmp)) {
sq = (GstSingleQueue *) tmp->data;
if (sq->sinkpad == pad)
break;
}
if (!tmp) {
GST_WARNING_OBJECT (mqueue, "That pad doesn't belong to this element ???");
GST_MULTI_QUEUE_MUTEX_UNLOCK (mqueue);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
return;
}
/* FIXME: The removal of the singlequeue should probably not happen until it
* finishes draining */
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
/* remove it from the list */
mqueue->queues = g_list_delete_link (mqueue->queues, tmp);
/* FIXME : recompute next-non-linked */
GST_MULTI_QUEUE_MUTEX_UNLOCK (mqueue);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
/* delete SingleQueue */
gst_data_queue_set_flushing (sq->queue, TRUE);
gst_pad_set_active (sq->srcpad, FALSE);
gst_pad_set_active (sq->sinkpad, FALSE);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
gst_element_remove_pad (element, sq->srcpad);
gst_element_remove_pad (element, sq->sinkpad);
gst_single_queue_free (sq);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
}
static gboolean
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
gst_single_queue_flush (GstMultiQueue * mq, GstSingleQueue * sq, gboolean flush)
{
gboolean result;
GST_DEBUG_OBJECT (mq, "flush %s queue %d", (flush ? "start" : "stop"),
sq->id);
if (flush) {
sq->srcresult = GST_FLOW_WRONG_STATE;
gst_data_queue_set_flushing (sq->queue, TRUE);
/* wake up non-linked task */
GST_LOG_OBJECT (mq, "SingleQueue %d : waking up eventually waiting task",
sq->id);
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
g_cond_signal (sq->turn);
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
GST_LOG_OBJECT (mq, "SingleQueue %d : pausing task", sq->id);
result = gst_pad_pause_task (sq->srcpad);
} else {
gst_data_queue_flush (sq->queue);
gst_segment_init (&sq->sink_segment, GST_FORMAT_TIME);
gst_segment_init (&sq->src_segment, GST_FORMAT_TIME);
/* All pads start off not-linked for a smooth kick-off */
sq->srcresult = GST_FLOW_OK;
sq->cur_time = 0;
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
sq->max_size.visible = mq->max_size.visible;
sq->is_eos = FALSE;
sq->inextra = FALSE;
sq->nextid = 0;
sq->oldid = 0;
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
gst_data_queue_set_flushing (sq->queue, FALSE);
GST_LOG_OBJECT (mq, "SingleQueue %d : starting task", sq->id);
result =
gst_pad_start_task (sq->srcpad, (GstTaskFunction) gst_multi_queue_loop,
sq->srcpad);
}
return result;
}
/* calculate the diff between running time on the sink and src of the queue.
* This is the total amount of time in the queue.
* WITH LOCK TAKEN */
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
static void
update_time_level (GstMultiQueue * mq, GstSingleQueue * sq)
{
gint64 sink_time, src_time;
sink_time =
gst_segment_to_running_time (&sq->sink_segment, GST_FORMAT_TIME,
sq->sink_segment.last_stop);
if (sink_time == GST_CLOCK_TIME_NONE)
goto beach;
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
src_time = gst_segment_to_running_time (&sq->src_segment, GST_FORMAT_TIME,
sq->src_segment.last_stop);
if (src_time == GST_CLOCK_TIME_NONE)
goto beach;
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
GST_DEBUG_OBJECT (mq,
"queue %d, sink %" GST_TIME_FORMAT ", src %" GST_TIME_FORMAT, sq->id,
GST_TIME_ARGS (sink_time), GST_TIME_ARGS (src_time));
/* This allows for streams with out of order timestamping - sometimes the
* emerging timestamp is later than the arriving one(s) */
if (sink_time < src_time)
goto beach;
sq->cur_time = sink_time - src_time;
return;
beach:
sq->cur_time = 0;
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
}
/* take a NEWSEGMENT event and apply the values to segment, updating the time
* level of queue. */
static void
apply_segment (GstMultiQueue * mq, GstSingleQueue * sq, GstEvent * event,
GstSegment * segment)
{
gboolean update;
GstFormat format;
gdouble rate, arate;
gint64 start, stop, time;
gst_event_parse_new_segment_full (event, &update, &rate, &arate,
&format, &start, &stop, &time);
/* now configure the values, we use these to track timestamps on the
* sinkpad. */
if (format != GST_FORMAT_TIME) {
/* non-time format, pretent the current time segment is closed with a
* 0 start and unknown stop time. */
update = FALSE;
format = GST_FORMAT_TIME;
start = 0;
stop = -1;
time = 0;
}
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
gst_segment_set_newsegment_full (segment, update,
rate, arate, format, start, stop, time);
GST_DEBUG_OBJECT (mq,
"queue %d, configured NEWSEGMENT %" GST_SEGMENT_FORMAT, sq->id, segment);
/* segment can update the time level of the queue */
update_time_level (mq, sq);
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
}
/* take a buffer and update segment, updating the time level of the queue. */
static void
apply_buffer (GstMultiQueue * mq, GstSingleQueue * sq, GstClockTime timestamp,
GstClockTime duration, GstSegment * segment)
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
{
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
/* if no timestamp is set, assume it's continuous with the previous
* time */
if (timestamp == GST_CLOCK_TIME_NONE)
timestamp = segment->last_stop;
/* add duration */
if (duration != GST_CLOCK_TIME_NONE)
timestamp += duration;
GST_DEBUG_OBJECT (mq, "queue %d, last_stop updated to %" GST_TIME_FORMAT,
sq->id, GST_TIME_ARGS (timestamp));
gst_segment_set_last_stop (segment, GST_FORMAT_TIME, timestamp);
/* calc diff with other end */
update_time_level (mq, sq);
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
}
static GstFlowReturn
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
gst_single_queue_push_one (GstMultiQueue * mq, GstSingleQueue * sq,
GstMiniObject * object)
{
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
GstFlowReturn result = GST_FLOW_OK;
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
if (GST_IS_BUFFER (object)) {
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
GstBuffer *buffer;
GstClockTime timestamp, duration;
GstCaps *caps;
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
buffer = GST_BUFFER_CAST (object);
timestamp = GST_BUFFER_TIMESTAMP (buffer);
duration = GST_BUFFER_DURATION (buffer);
caps = GST_BUFFER_CAPS (buffer);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
apply_buffer (mq, sq, timestamp, duration, &sq->src_segment);
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
/* Applying the buffer may have made the queue non-full again, unblock it if needed */
gst_data_queue_limits_changed (sq->queue);
GST_DEBUG_OBJECT (mq,
"SingleQueue %d : Pushing buffer %p with ts %" GST_TIME_FORMAT,
sq->id, buffer, GST_TIME_ARGS (timestamp));
/* Set caps on pad before pushing, this avoids core calling the accpetcaps
* function on the srcpad, which will call acceptcaps upstream, which might
* not accept these caps (anymore). */
if (caps && caps != GST_PAD_CAPS (sq->srcpad))
gst_pad_set_caps (sq->srcpad, caps);
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
result = gst_pad_push (sq->srcpad, buffer);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
} else if (GST_IS_EVENT (object)) {
GstEvent *event;
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
event = GST_EVENT_CAST (object);
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_EOS:
result = GST_FLOW_UNEXPECTED;
break;
case GST_EVENT_NEWSEGMENT:
apply_segment (mq, sq, event, &sq->src_segment);
/* Applying the segment may have made the queue non-full again, unblock it if needed */
gst_data_queue_limits_changed (sq->queue);
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
break;
default:
break;
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
}
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
GST_DEBUG_OBJECT (mq,
"SingleQueue %d : Pushing event %p of type %s",
sq->id, event, GST_EVENT_TYPE_NAME (event));
gst_pad_push_event (sq->srcpad, event);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
} else {
g_warning ("Unexpected object in singlequeue %d (refcounting problem?)",
sq->id);
}
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
return result;
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
/* ERRORS */
}
static GstMiniObject *
gst_multi_queue_item_steal_object (GstMultiQueueItem * item)
{
GstMiniObject *res;
res = item->object;
item->object = NULL;
return res;
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
}
static void
gst_multi_queue_item_destroy (GstMultiQueueItem * item)
{
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
if (item->object)
gst_mini_object_unref (item->object);
g_slice_free (GstMultiQueueItem, item);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
}
/* takes ownership of passed mini object! */
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
static GstMultiQueueItem *
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
gst_multi_queue_item_new (GstMiniObject * object, guint32 curid)
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
{
GstMultiQueueItem *item;
item = g_slice_new (GstMultiQueueItem);
item->object = object;
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
item->destroy = (GDestroyNotify) gst_multi_queue_item_destroy;
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
item->posid = curid;
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
if (GST_IS_BUFFER (object)) {
item->size = GST_BUFFER_SIZE (object);
item->duration = GST_BUFFER_DURATION (object);
if (item->duration == GST_CLOCK_TIME_NONE)
item->duration = 0;
item->visible = TRUE;
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
} else {
item->size = 0;
item->duration = 0;
item->visible = FALSE;
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
}
return item;
}
/* Each main loop attempts to push buffers until the return value
* is not-linked. not-linked pads are not allowed to push data beyond
* any linked pads, so they don't 'rush ahead of the pack'.
*/
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
static void
gst_multi_queue_loop (GstPad * pad)
{
GstSingleQueue *sq;
GstMultiQueueItem *item;
GstDataQueueItem *sitem;
GstMultiQueue *mq;
GstMiniObject *object;
guint32 newid;
guint32 oldid = G_MAXUINT32;
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
GstFlowReturn result;
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
sq = (GstSingleQueue *) gst_pad_get_element_private (pad);
mq = sq->mqueue;
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
do {
GST_DEBUG_OBJECT (mq, "SingleQueue %d : trying to pop an object", sq->id);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
/* Get something from the queue, blocking until that happens, or we get
* flushed */
if (!(gst_data_queue_pop (sq->queue, &sitem)))
goto out_flushing;
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
item = (GstMultiQueueItem *) sitem;
newid = item->posid;
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
/* steal the object and destroy the item */
object = gst_multi_queue_item_steal_object (item);
gst_multi_queue_item_destroy (item);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
GST_LOG_OBJECT (mq, "SingleQueue %d : newid:%d , oldid:%d",
sq->id, newid, oldid);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
/* If we're not-linked, we do some extra work because we might need to
* wait before pushing. If we're linked but there's a gap in the IDs,
* or it's the first loop, or we just passed the previous highid,
* we might need to wake some sleeping pad up, so there's extra work
* there too */
if (sq->srcresult == GST_FLOW_NOT_LINKED ||
(oldid == G_MAXUINT32) || (newid != (oldid + 1)) ||
oldid > mq->highid) {
GST_LOG_OBJECT (mq, "CHECKING sq->srcresult: %s",
gst_flow_get_name (sq->srcresult));
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
/* Update the nextid so other threads know when to wake us up */
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
sq->nextid = newid;
/* Update the oldid (the last ID we output) for highid tracking */
if (oldid != G_MAXUINT32)
sq->oldid = oldid;
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
if (sq->srcresult == GST_FLOW_NOT_LINKED) {
/* Go to sleep until it's time to push this buffer */
/* Recompute the highid */
compute_high_id (mq);
while (newid > mq->highid && sq->srcresult == GST_FLOW_NOT_LINKED) {
GST_DEBUG_OBJECT (mq, "queue %d sleeping for not-linked wakeup with "
"newid %u and highid %u", sq->id, newid, mq->highid);
/* Wake up all non-linked pads before we sleep */
wake_up_next_non_linked (mq);
mq->numwaiting++;
g_cond_wait (sq->turn, mq->qlock);
mq->numwaiting--;
GST_DEBUG_OBJECT (mq, "queue %d woken from sleeping for not-linked "
"wakeup with newid %u and highid %u", sq->id, newid, mq->highid);
}
/* Re-compute the high_id in case someone else pushed */
compute_high_id (mq);
} else {
compute_high_id (mq);
/* Wake up all non-linked pads */
wake_up_next_non_linked (mq);
}
/* We're done waiting, we can clear the nextid */
sq->nextid = 0;
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
}
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
GST_LOG_OBJECT (mq, "BEFORE PUSHING sq->srcresult: %s",
gst_flow_get_name (sq->srcresult));
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
/* Try to push out the new object */
result = gst_single_queue_push_one (mq, sq, object);
sq->srcresult = result;
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
if (result != GST_FLOW_OK && result != GST_FLOW_NOT_LINKED)
goto out_flushing;
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
GST_LOG_OBJECT (mq, "AFTER PUSHING sq->srcresult: %s",
gst_flow_get_name (sq->srcresult));
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
oldid = newid;
}
while (TRUE);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
out_flushing:
{
/* Need to make sure wake up any sleeping pads when we exit */
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
compute_high_id (mq);
wake_up_next_non_linked (mq);
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
gst_data_queue_set_flushing (sq->queue, TRUE);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
gst_pad_pause_task (sq->srcpad);
GST_CAT_LOG_OBJECT (multi_queue_debug, mq,
"SingleQueue[%d] task paused, reason:%s",
sq->id, gst_flow_get_name (sq->srcresult));
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
return;
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
}
}
/**
* gst_multi_queue_chain:
*
* This is similar to GstQueue's chain function, except:
* _ we don't have leak behavioures,
* _ we push with a unique id (curid)
*/
static GstFlowReturn
gst_multi_queue_chain (GstPad * pad, GstBuffer * buffer)
{
GstSingleQueue *sq;
GstMultiQueue *mq;
GstMultiQueueItem *item;
GstFlowReturn ret = GST_FLOW_OK;
guint32 curid;
GstClockTime timestamp, duration;
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
sq = gst_pad_get_element_private (pad);
mq = (GstMultiQueue *) gst_pad_get_parent (pad);
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
/* Get a unique incrementing id */
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
curid = mq->counter++;
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
GST_LOG_OBJECT (mq, "SingleQueue %d : about to enqueue buffer %p with id %d",
sq->id, buffer, curid);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
item = gst_multi_queue_item_new (GST_MINI_OBJECT_CAST (buffer), curid);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
timestamp = GST_BUFFER_TIMESTAMP (buffer);
duration = GST_BUFFER_DURATION (buffer);
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
if (!(gst_data_queue_push (sq->queue, (GstDataQueueItem *) item)))
goto flushing;
/* update time level, we must do this after pushing the data in the queue so
* that we never end up filling the queue first. */
apply_buffer (mq, sq, timestamp, duration, &sq->sink_segment);
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
done:
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
gst_object_unref (mq);
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
return ret;
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
/* ERRORS */
flushing:
{
ret = sq->srcresult;
GST_LOG_OBJECT (mq, "SingleQueue %d : exit because task paused, reason: %s",
sq->id, gst_flow_get_name (ret));
gst_multi_queue_item_destroy (item);
goto done;
}
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
}
static gboolean
gst_multi_queue_sink_activate_push (GstPad * pad, gboolean active)
{
GstSingleQueue *sq;
sq = (GstSingleQueue *) gst_pad_get_element_private (pad);
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
if (active) {
/* All pads start off linked until they push one buffer */
sq->srcresult = GST_FLOW_OK;
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
} else {
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
sq->srcresult = GST_FLOW_WRONG_STATE;
gst_data_queue_flush (sq->queue);
}
return TRUE;
}
static gboolean
gst_multi_queue_sink_event (GstPad * pad, GstEvent * event)
{
GstSingleQueue *sq;
GstMultiQueue *mq;
guint32 curid;
GstMultiQueueItem *item;
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
gboolean res;
GstEventType type;
GstEvent *sref = NULL;
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
sq = (GstSingleQueue *) gst_pad_get_element_private (pad);
mq = (GstMultiQueue *) gst_pad_get_parent (pad);
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
type = GST_EVENT_TYPE (event);
switch (type) {
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
case GST_EVENT_FLUSH_START:
GST_DEBUG_OBJECT (mq, "SingleQueue %d : received flush start event",
sq->id);
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
res = gst_pad_push_event (sq->srcpad, event);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
gst_single_queue_flush (mq, sq, TRUE);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
goto done;
case GST_EVENT_FLUSH_STOP:
GST_DEBUG_OBJECT (mq, "SingleQueue %d : received flush stop event",
sq->id);
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
res = gst_pad_push_event (sq->srcpad, event);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
gst_single_queue_flush (mq, sq, FALSE);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
goto done;
case GST_EVENT_NEWSEGMENT:
/* take ref because the queue will take ownership and we need the event
* afterwards to update the segment */
sref = gst_event_ref (event);
break;
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
default:
if (!(GST_EVENT_IS_SERIALIZED (event))) {
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
res = gst_pad_push_event (sq->srcpad, event);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
goto done;
}
break;
}
/* Get an unique incrementing id */
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
curid = mq->counter++;
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
item = gst_multi_queue_item_new ((GstMiniObject *) event, curid);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
GST_DEBUG_OBJECT (mq,
"SingleQueue %d : Enqueuing event %p of type %s with id %d",
sq->id, event, GST_EVENT_TYPE_NAME (event), curid);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
if (!(res = gst_data_queue_push (sq->queue, (GstDataQueueItem *) item)))
goto flushing;
/* mark EOS when we received one, we must do that after putting the
* buffer in the queue because EOS marks the buffer as filled. No need to take
* a lock, the _check_full happens from this thread only, right before pushing
* into dataqueue. */
switch (type) {
case GST_EVENT_EOS:
sq->is_eos = TRUE;
break;
case GST_EVENT_NEWSEGMENT:
apply_segment (mq, sq, sref, &sq->sink_segment);
gst_event_unref (sref);
break;
default:
break;
}
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
done:
gst_object_unref (mq);
return res;
flushing:
{
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
GST_LOG_OBJECT (mq, "SingleQueue %d : exit because task paused, reason: %s",
sq->id, gst_flow_get_name (sq->srcresult));
if (sref)
gst_event_unref (sref);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
gst_multi_queue_item_destroy (item);
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
goto done;
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
}
}
static GstCaps *
gst_multi_queue_getcaps (GstPad * pad)
{
GstSingleQueue *sq = gst_pad_get_element_private (pad);
GstPad *otherpad;
GstCaps *result;
otherpad = (pad == sq->srcpad) ? sq->sinkpad : sq->srcpad;
GST_LOG_OBJECT (otherpad, "Getting caps from the peer of this pad");
result = gst_pad_peer_get_caps (otherpad);
if (result == NULL)
result = gst_caps_new_any ();
return result;
}
static GstFlowReturn
gst_multi_queue_bufferalloc (GstPad * pad, guint64 offset, guint size,
GstCaps * caps, GstBuffer ** buf)
{
GstSingleQueue *sq = gst_pad_get_element_private (pad);
return gst_pad_alloc_buffer (sq->srcpad, offset, size, caps, buf);
}
static gboolean
gst_multi_queue_src_activate_push (GstPad * pad, gboolean active)
{
GstMultiQueue *mq;
GstSingleQueue *sq;
gboolean result = FALSE;
sq = (GstSingleQueue *) gst_pad_get_element_private (pad);
mq = sq->mqueue;
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
GST_DEBUG_OBJECT (mq, "SingleQueue %d", sq->id);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
if (active) {
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
result = gst_single_queue_flush (mq, sq, FALSE);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
} else {
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
result = gst_single_queue_flush (mq, sq, TRUE);
/* make sure streaming finishes */
result |= gst_pad_stop_task (pad);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
}
return result;
}
static gboolean
gst_multi_queue_src_event (GstPad * pad, GstEvent * event)
{
GstSingleQueue *sq = gst_pad_get_element_private (pad);
return gst_pad_push_event (sq->sinkpad, event);
}
static gboolean
gst_multi_queue_src_query (GstPad * pad, GstQuery * query)
{
GstSingleQueue *sq = gst_pad_get_element_private (pad);
GstPad *peerpad;
gboolean res;
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
/* FIXME, Handle position offset depending on queue size */
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
/* default handling */
if (!(peerpad = gst_pad_get_peer (sq->sinkpad)))
goto no_peer;
res = gst_pad_query (peerpad, query);
gst_object_unref (peerpad);
return res;
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
/* ERRORS */
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
no_peer:
{
GST_LOG_OBJECT (sq->sinkpad, "Couldn't send query because we have no peer");
return FALSE;
}
}
/*
* Next-non-linked functions
*/
/* WITH LOCK TAKEN */
static void
wake_up_next_non_linked (GstMultiQueue * mq)
{
GList *tmp;
/* maybe no-one is waiting */
if (mq->numwaiting < 1)
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
return;
/* Else figure out which singlequeue(s) need waking up */
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
for (tmp = mq->queues; tmp; tmp = g_list_next (tmp)) {
GstSingleQueue *sq = (GstSingleQueue *) tmp->data;
if (sq->srcresult == GST_FLOW_NOT_LINKED) {
if (sq->nextid != 0 && sq->nextid <= mq->highid) {
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
GST_LOG_OBJECT (mq, "Waking up singlequeue %d", sq->id);
g_cond_signal (sq->turn);
}
}
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
}
}
/* WITH LOCK TAKEN */
static void
compute_high_id (GstMultiQueue * mq)
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
{
/* The high-id is either the highest id among the linked pads, or if all
* pads are not-linked, it's the lowest not-linked pad */
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
GList *tmp;
guint32 lowest = G_MAXUINT32;
guint32 highid = G_MAXUINT32;
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
for (tmp = mq->queues; tmp; tmp = g_list_next (tmp)) {
GstSingleQueue *sq = (GstSingleQueue *) tmp->data;
GST_LOG_OBJECT (mq, "inspecting sq:%d , nextid:%d, oldid:%d, srcresult:%s",
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
sq->id, sq->nextid, sq->oldid, gst_flow_get_name (sq->srcresult));
if (sq->srcresult == GST_FLOW_NOT_LINKED) {
/* No need to consider queues which are not waiting */
if (sq->nextid == 0) {
GST_LOG_OBJECT (mq, "sq:%d is not waiting - ignoring", sq->id);
continue;
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
}
if (sq->nextid < lowest)
lowest = sq->nextid;
} else if (sq->srcresult != GST_FLOW_UNEXPECTED) {
/* If we don't have a global highid, or the global highid is lower than
* this single queue's last outputted id, store the queue's one,
* unless the singlequeue is at EOS (srcresult = UNEXPECTED) */
if ((highid == G_MAXUINT32) || (sq->oldid > highid))
highid = sq->oldid;
}
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
}
if (highid == G_MAXUINT32 || lowest < highid)
mq->highid = lowest;
else
mq->highid = highid;
GST_LOG_OBJECT (mq, "Highid is now : %u, lowest non-linked %u", mq->highid,
lowest);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
}
#define IS_FILLED(format, value) ((sq->max_size.format) != 0 && \
(sq->max_size.format) <= (value))
/*
* GstSingleQueue functions
*/
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
static void
single_queue_overrun_cb (GstDataQueue * dq, GstSingleQueue * sq)
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
{
GstMultiQueue *mq = sq->mqueue;
GList *tmp;
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
GstDataQueueSize size;
gboolean filled = FALSE;
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
gst_data_queue_get_level (sq->queue, &size);
GST_LOG_OBJECT (mq, "Single Queue %d is full", sq->id);
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
for (tmp = mq->queues; tmp; tmp = g_list_next (tmp)) {
GstSingleQueue *ssq = (GstSingleQueue *) tmp->data;
GstDataQueueSize ssize;
GST_LOG_OBJECT (mq, "Checking Queue %d", ssq->id);
if (gst_data_queue_is_empty (ssq->queue)) {
GST_LOG_OBJECT (mq, "Queue %d is empty", ssq->id);
if (IS_FILLED (visible, size.visible)) {
sq->max_size.visible = size.visible + 1;
GST_DEBUG_OBJECT (mq,
"Another queue is empty, bumping single queue %d max visible to %d",
sq->id, sq->max_size.visible);
}
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
goto beach;
}
/* check if we reached the hard time/bytes limits */
gst_data_queue_get_level (ssq->queue, &ssize);
GST_DEBUG_OBJECT (mq,
"queue %d: visible %u/%u, bytes %u/%u, time %" G_GUINT64_FORMAT "/%"
G_GUINT64_FORMAT, ssq->id, ssize.visible, sq->max_size.visible,
ssize.bytes, sq->max_size.bytes, sq->cur_time, sq->max_size.time);
/* if this queue is filled completely we must signal overrun */
if (IS_FILLED (bytes, ssize.bytes) || IS_FILLED (time, sq->cur_time)) {
GST_LOG_OBJECT (mq, "Queue %d is filled", ssq->id);
filled = TRUE;
}
}
/* no queues were empty */
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
/* Overrun is always forwarded, since this is blocking the upstream element */
if (filled) {
GST_DEBUG_OBJECT (mq, "A queue is filled, signalling overrun");
g_signal_emit (G_OBJECT (mq), gst_multi_queue_signals[SIGNAL_OVERRUN], 0);
}
beach:
return;
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
}
static void
single_queue_underrun_cb (GstDataQueue * dq, GstSingleQueue * sq)
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
{
gboolean empty = TRUE;
GstMultiQueue *mq = sq->mqueue;
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
GList *tmp;
GST_LOG_OBJECT (mq,
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
"Single Queue %d is empty, Checking other single queues", sq->id);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
for (tmp = mq->queues; tmp; tmp = g_list_next (tmp)) {
GstSingleQueue *sq = (GstSingleQueue *) tmp->data;
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
if (gst_data_queue_is_full (sq->queue)) {
GstDataQueueSize size;
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
gst_data_queue_get_level (sq->queue, &size);
if (IS_FILLED (visible, size.visible)) {
sq->max_size.visible = size.visible + 1;
GST_DEBUG_OBJECT (mq,
"queue %d is filled, bumping its max visible to %d", sq->id,
sq->max_size.visible);
gst_data_queue_limits_changed (sq->queue);
}
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
}
if (!gst_data_queue_is_empty (sq->queue))
empty = FALSE;
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
}
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
if (empty) {
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
GST_DEBUG_OBJECT (mq, "All queues are empty, signalling it");
g_signal_emit (G_OBJECT (mq), gst_multi_queue_signals[SIGNAL_UNDERRUN], 0);
}
}
static gboolean
single_queue_check_full (GstDataQueue * dataq, guint visible, guint bytes,
guint64 time, GstSingleQueue * sq)
{
gboolean res;
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
GST_DEBUG ("queue %d: visible %u/%u, bytes %u/%u, time %" G_GUINT64_FORMAT
"/%" G_GUINT64_FORMAT, sq->id, visible, sq->max_size.visible, bytes,
sq->max_size.bytes, sq->cur_time, sq->max_size.time);
/* we are always filled on EOS */
if (sq->is_eos)
return TRUE;
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
/* we never go past the max visible items */
if (IS_FILLED (visible, visible))
return TRUE;
/* check time or bytes */
res = IS_FILLED (time, sq->cur_time) || IS_FILLED (bytes, bytes);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
return res;
}
static void
gst_single_queue_free (GstSingleQueue * sq)
{
/* DRAIN QUEUE */
gst_data_queue_flush (sq->queue);
g_object_unref (sq->queue);
g_cond_free (sq->turn);
g_free (sq);
}
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
static GstSingleQueue *
gst_single_queue_new (GstMultiQueue * mqueue)
{
GstSingleQueue *sq;
gchar *tmp;
sq = g_new0 (GstSingleQueue, 1);
GST_MULTI_QUEUE_MUTEX_LOCK (mqueue);
sq->id = mqueue->nbqueues++;
/* copy over max_size and extra_size so we don't need to take the lock
* any longer when checking if the queue is full. */
sq->max_size.visible = mqueue->max_size.visible;
sq->max_size.bytes = mqueue->max_size.bytes;
sq->max_size.time = mqueue->max_size.time;
sq->extra_size.visible = mqueue->extra_size.visible;
sq->extra_size.bytes = mqueue->extra_size.bytes;
sq->extra_size.time = mqueue->extra_size.time;
GST_MULTI_QUEUE_MUTEX_UNLOCK (mqueue);
GST_DEBUG_OBJECT (mqueue, "Creating GstSingleQueue id:%d", sq->id);
sq->mqueue = mqueue;
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
sq->srcresult = GST_FLOW_WRONG_STATE;
sq->queue = gst_data_queue_new ((GstDataQueueCheckFullFunction)
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
single_queue_check_full, sq);
libs/gst/base/gstdataqueue.*: Various cleanups. Original commit message from CVS: * libs/gst/base/gstdataqueue.c: (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_is_empty), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_limits_changed), (gst_data_queue_get_level): * libs/gst/base/gstdataqueue.h: Various cleanups. Added methods to get the current levels and to inform the queue that the 'full' limits changed. * plugins/elements/gstmultiqueue.c: (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_single_queue_flush), (update_time_level), (apply_segment), (apply_buffer), (gst_single_queue_push_one), (gst_multi_queue_item_steal_object), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_src_activate_push), (gst_multi_queue_src_query), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): Keep track of time in the queue by measuring the difference between running_time on input and output. This gives more accurate results and can compensate for segments correctly. Make a queue by default only 5 buffers deep. We will now increase the buffer size depending on the filledness of the other queues. Factor out commong flush code. Make sure we don't add additional refcounts to buffers when we can avoid it. Propagate GstFlowReturn differently. Use GSlice for intermediate GstMultiQueueItems. Keep track of EOS. Resize queues on over and underruns based on filled level of other queues. When checking if the queue is filled, prefer to measure in time if we can and fall back to bytes when no time is known. * plugins/elements/gstqueue.c: Fix return value.
2007-06-15 11:00:32 +00:00
sq->is_eos = FALSE;
gst_segment_init (&sq->sink_segment, GST_FORMAT_TIME);
gst_segment_init (&sq->src_segment, GST_FORMAT_TIME);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
sq->nextid = 0;
sq->oldid = 0;
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
sq->turn = g_cond_new ();
/* attach to underrun/overrun signals to handle non-starvation */
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
g_signal_connect (G_OBJECT (sq->queue), "full",
G_CALLBACK (single_queue_overrun_cb), sq);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
g_signal_connect (G_OBJECT (sq->queue), "empty",
G_CALLBACK (single_queue_underrun_cb), sq);
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
tmp = g_strdup_printf ("sink%d", sq->id);
sq->sinkpad = gst_pad_new_from_static_template (&sinktemplate, tmp);
g_free (tmp);
gst_pad_set_chain_function (sq->sinkpad,
GST_DEBUG_FUNCPTR (gst_multi_queue_chain));
gst_pad_set_activatepush_function (sq->sinkpad,
GST_DEBUG_FUNCPTR (gst_multi_queue_sink_activate_push));
gst_pad_set_event_function (sq->sinkpad,
GST_DEBUG_FUNCPTR (gst_multi_queue_sink_event));
gst_pad_set_getcaps_function (sq->sinkpad,
GST_DEBUG_FUNCPTR (gst_multi_queue_getcaps));
gst_pad_set_bufferalloc_function (sq->sinkpad,
GST_DEBUG_FUNCPTR (gst_multi_queue_bufferalloc));
gst_pad_set_internal_link_function (sq->sinkpad,
GST_DEBUG_FUNCPTR (gst_multi_queue_get_internal_links));
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
tmp = g_strdup_printf ("src%d", sq->id);
sq->srcpad = gst_pad_new_from_static_template (&srctemplate, tmp);
g_free (tmp);
gst_pad_set_activatepush_function (sq->srcpad,
GST_DEBUG_FUNCPTR (gst_multi_queue_src_activate_push));
gst_pad_set_getcaps_function (sq->srcpad,
GST_DEBUG_FUNCPTR (gst_multi_queue_getcaps));
gst_pad_set_event_function (sq->srcpad,
GST_DEBUG_FUNCPTR (gst_multi_queue_src_event));
gst_pad_set_query_function (sq->srcpad,
GST_DEBUG_FUNCPTR (gst_multi_queue_src_query));
gst_pad_set_internal_link_function (sq->srcpad,
GST_DEBUG_FUNCPTR (gst_multi_queue_get_internal_links));
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
gst_pad_set_element_private (sq->sinkpad, (gpointer) sq);
gst_pad_set_element_private (sq->srcpad, (gpointer) sq);
/* only activate the pads when we are not in the NULL state
* and add the pad under the state_lock to prevend state changes
* between activating and adding */
g_static_rec_mutex_lock (GST_STATE_GET_LOCK (mqueue));
if (GST_STATE_TARGET (mqueue) != GST_STATE_NULL) {
gst_pad_set_active (sq->srcpad, TRUE);
gst_pad_set_active (sq->sinkpad, TRUE);
}
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
gst_element_add_pad (GST_ELEMENT (mqueue), sq->srcpad);
gst_element_add_pad (GST_ELEMENT (mqueue), sq->sinkpad);
g_static_rec_mutex_unlock (GST_STATE_GET_LOCK (mqueue));
libs/gst/base/: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing fun... Original commit message from CVS: * libs/gst/base/Makefile.am: * libs/gst/base/gstdataqueue.c: (gst_data_queue_get_type), (gst_data_queue_base_init), (gst_data_queue_class_init), (gst_data_queue_init), (gst_data_queue_new), (gst_data_queue_cleanup), (gst_data_queue_finalize), (gst_data_queue_locked_flush), (gst_data_queue_locked_is_empty), (gst_data_queue_locked_is_full), (gst_data_queue_flush), (gst_data_queue_is_empty), (gst_data_queue_is_full), (gst_data_queue_set_flushing), (gst_data_queue_push), (gst_data_queue_pop), (gst_data_queue_drop_head), (gst_data_queue_set_property), (gst_data_queue_get_property): * libs/gst/base/gstdataqueue.h: New GstDataQueue object for threadsafe queueing. Most useful for elements that need some queueing functionnality. * docs/libs/gstreamer-libs-docs.sgml: * docs/libs/gstreamer-libs-sections.txt: Insert documentation for GstDataQueue * plugins/elements/Makefile.am: * plugins/elements/gstelements.c: * plugins/elements/gstmultiqueue.c: (gst_multi_queue_base_init), (gst_multi_queue_class_init), (gst_multi_queue_init), (gst_multi_queue_finalize), (gst_multi_queue_set_property), (gst_multi_queue_get_property), (gst_multi_queue_request_new_pad), (gst_multi_queue_release_pad), (gst_single_queue_push_one), (gst_multi_queue_item_destroy), (gst_multi_queue_item_new), (gst_multi_queue_loop), (gst_multi_queue_chain), (gst_multi_queue_sink_activate_push), (gst_multi_queue_sink_event), (gst_multi_queue_getcaps), (gst_multi_queue_bufferalloc), (gst_multi_queue_src_activate_push), (gst_multi_queue_acceptcaps), (gst_multi_queue_src_event), (gst_multi_queue_src_query), (wake_up_next_non_linked), (compute_next_non_linked), (single_queue_overrun_cb), (single_queue_underrun_cb), (single_queue_check_full), (gst_single_queue_new): * plugins/elements/gstmultiqueue.h: New multiqueue element, using GstDataQueue. Used for queuing multiple streams. Closes #344639 and #347785
2006-11-28 12:07:06 +00:00
GST_DEBUG_OBJECT (mqueue, "GstSingleQueue [%d] created and pads added",
sq->id);
return sq;
}