Merge branch 'master' into 0.11

Conflicts:
	gst/gstbin.c
This commit is contained in:
Wim Taymans 2011-11-04 19:11:19 +01:00
commit c2c9776027
8 changed files with 57 additions and 40 deletions

View file

@ -610,8 +610,14 @@ AG_GST_SET_PLUGINDIR
GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-no-export-2.0, gthread-2.0"
AC_SUBST(GST_PKG_DEPS)
dnl make sure it doesn't complain about unused variables if debugging is disabled
NO_WARNINGS=""
if test "x${GST_DISABLE_GST_DEBUG}" = "xyes"; then
NO_WARNINGS="-Wno-unused"
fi
dnl define an ERROR_CFLAGS Makefile variable
AG_GST_SET_ERROR_CFLAGS($GST_GIT, [-Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wformat-nonliteral -Wformat-security -Wold-style-definition -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return -Wno-multichar -Wnested-externs])
AG_GST_SET_ERROR_CFLAGS($GST_GIT, [-Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wformat-nonliteral -Wformat-security -Wold-style-definition -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return -Wno-multichar -Wnested-externs $NO_WARNINGS])
dnl define correct level for debugging messages
AG_GST_SET_LEVEL_DEFAULT($GST_GIT)
@ -660,7 +666,7 @@ dnl - src and build dirs need to be added because every piece that gets built
dnl will need the GStreamer source and generated headers
dnl LIBS: XML doesn't need to be added because we don't explicitly use symbols
dnl from LibXML except for in the core library
GST_ALL_CXXFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir) -I\$(top_builddir)/libs -I\$(top_builddir) $GLIB_CFLAGS $(GLIB_EXTRA_CFLAGS) $XML_CFLAGS \$(GST_OPTION_CXXFLAGS) \$(ERROR_CXXFLAGS)"
GST_ALL_CXXFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir) -I\$(top_builddir)/libs -I\$(top_builddir) $GLIB_CFLAGS \$(GLIB_EXTRA_CFLAGS) $XML_CFLAGS \$(GST_OPTION_CXXFLAGS) \$(ERROR_CXXFLAGS)"
GST_ALL_CFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir) -I\$(top_builddir)/libs -I\$(top_builddir) $GLIB_CFLAGS \$(GLIB_EXTRA_CFLAGS) $XML_CFLAGS \$(GST_OPTION_CFLAGS) \$(ERROR_CFLAGS)"
dnl FIXME: check if LTLIBINTL is needed everywhere

View file

@ -1775,7 +1775,7 @@ gst_bin_get_state_func (GstElement * element, GstState * state,
typedef struct _GstBinSortIterator
{
GstIterator it;
GQueue *queue; /* elements queued for state change */
GQueue queue; /* elements queued for state change */
GstBin *bin; /* bin we iterate */
gint mode; /* adding or removing dependency */
GstElement *best; /* next element with least dependencies */
@ -1819,7 +1819,7 @@ add_to_queue (GstBinSortIterator * bit, GstElement * element)
GST_DEBUG_OBJECT (bit->bin, "adding '%s' to queue",
GST_ELEMENT_NAME (element));
gst_object_ref (element);
g_queue_push_tail (bit->queue, element);
g_queue_push_tail (&bit->queue, element);
HASH_SET_DEGREE (bit, element, -1);
}
@ -1828,11 +1828,11 @@ remove_from_queue (GstBinSortIterator * bit, GstElement * element)
{
GList *find;
if ((find = g_queue_find (bit->queue, element))) {
if ((find = g_queue_find (&bit->queue, element))) {
GST_DEBUG_OBJECT (bit->bin, "removing '%s' from queue",
GST_ELEMENT_NAME (element));
g_queue_delete_link (bit->queue, find);
g_queue_delete_link (&bit->queue, find);
gst_object_unref (element);
} else {
GST_DEBUG_OBJECT (bit->bin, "unable to remove '%s' from queue",
@ -1989,8 +1989,7 @@ gst_bin_sort_iterator_next (GstBinSortIterator * bit, GValue * result)
GstBin *bin = bit->bin;
/* empty queue, we have to find a next best element */
if (g_queue_is_empty (bit->queue)) {
if (g_queue_is_empty (&bit->queue)) {
bit->best = NULL;
bit->best_deg = G_MAXINT;
g_list_foreach (bin->children, (GFunc) find_element, bit);
@ -2015,7 +2014,7 @@ gst_bin_sort_iterator_next (GstBinSortIterator * bit, GValue * result)
}
} else {
/* everything added to the queue got reffed */
best = g_queue_pop_head (bit->queue);
best = g_queue_pop_head (&bit->queue);
g_value_set_object (result, best);
gst_object_unref (best);
}
@ -2035,7 +2034,7 @@ gst_bin_sort_iterator_resync (GstBinSortIterator * bit)
GST_DEBUG_OBJECT (bin, "resync");
bit->dirty = FALSE;
clear_queue (bit->queue);
clear_queue (&bit->queue);
/* reset degrees */
g_list_foreach (bin->children, (GFunc) reset_degree, bit);
/* calc degrees, incrementing */
@ -2052,8 +2051,7 @@ gst_bin_sort_iterator_free (GstBinSortIterator * bit)
GstBin *bin = bit->bin;
GST_DEBUG_OBJECT (bin, "free");
clear_queue (bit->queue);
g_queue_free (bit->queue);
clear_queue (&bit->queue);
g_hash_table_destroy (bit->hash);
gst_object_unref (bin);
}
@ -2076,7 +2074,7 @@ gst_bin_sort_iterator_new (GstBin * bin)
(GstIteratorItemFunction) NULL,
(GstIteratorResyncFunction) gst_bin_sort_iterator_resync,
(GstIteratorFreeFunction) gst_bin_sort_iterator_free);
result->queue = g_queue_new ();
g_queue_init (&result->queue);
result->hash = g_hash_table_new (NULL, NULL);
gst_object_ref (bin);
result->bin = bin;

View file

@ -81,28 +81,41 @@ typedef gpointer GstClockID;
*/
#define GST_CLOCK_TIME_IS_VALID(time) (((GstClockTime)(time)) != GST_CLOCK_TIME_NONE)
/* FIXME: still need to explicitly force types on the defines below */
/**
* GST_SECOND:
*
* Constant that defines one GStreamer second.
*
* Value: 1000000000
*
*/
#define GST_SECOND (G_USEC_PER_SEC * G_GINT64_CONSTANT (1000))
/**
* GST_MSECOND:
*
* Constant that defines one GStreamer millisecond.
*
* Value: 1000000
*
*/
#define GST_MSECOND (GST_SECOND / G_GINT64_CONSTANT (1000))
/**
* GST_USECOND:
*
* Constant that defines one GStreamer microsecond.
*
* Value: 1000
*
*/
#define GST_USECOND (GST_SECOND / G_GINT64_CONSTANT (1000000))
/**
* GST_NSECOND:
*
* Constant that defines one GStreamer nanosecond
*
* Value: 1
*
*/
#define GST_NSECOND (GST_SECOND / G_GINT64_CONSTANT (1000000000))

View file

@ -137,7 +137,7 @@ struct _GstCollectData2
/*< private >*/
/* state: bitfield for easier extension;
* eos, flushing, new_segment, waiting */
guint state;
GstCollectPads2StateFlags state;
/* refcounting for struct, and destroy callback */
GstCollectData2DestroyNotify destroy_notify;

View file

@ -91,7 +91,7 @@ GST_DEBUG_CATEGORY_STATIC (queue_dataflow);
queue->cur_level.time, \
queue->min_threshold.time, \
queue->max_size.time, \
queue->queue->length)
queue->queue.length)
/* Queue signals and args */
enum
@ -420,7 +420,8 @@ gst_queue_init (GstQueue * queue)
queue->qlock = g_mutex_new ();
queue->item_add = g_cond_new ();
queue->item_del = g_cond_new ();
queue->queue = g_queue_new ();
g_queue_init (&queue->queue);
queue->sinktime = GST_CLOCK_TIME_NONE;
queue->srctime = GST_CLOCK_TIME_NONE;
@ -438,16 +439,15 @@ gst_queue_init (GstQueue * queue)
static void
gst_queue_finalize (GObject * object)
{
GstMiniObject *data;
GstQueue *queue = GST_QUEUE (object);
GST_DEBUG_OBJECT (queue, "finalizing queue");
while (!g_queue_is_empty (queue->queue)) {
GstMiniObject *data = g_queue_pop_head (queue->queue);
while ((data = g_queue_pop_head (&queue->queue)))
gst_mini_object_unref (data);
}
g_queue_free (queue->queue);
g_queue_clear (&queue->queue);
g_mutex_free (queue->qlock);
g_cond_free (queue->item_add);
g_cond_free (queue->item_del);
@ -631,9 +631,9 @@ apply_buffer (GstQueue * queue, GstBuffer * buffer, GstSegment * segment,
static void
gst_queue_locked_flush (GstQueue * queue)
{
while (!g_queue_is_empty (queue->queue)) {
GstMiniObject *data = g_queue_pop_head (queue->queue);
GstMiniObject *data;
while ((data = g_queue_pop_head (&queue->queue))) {
/* Then lose another reference because we are supposed to destroy that
data when flushing */
gst_mini_object_unref (data);
@ -664,7 +664,7 @@ gst_queue_locked_enqueue_buffer (GstQueue * queue, gpointer item)
queue->cur_level.bytes += gst_buffer_get_size (buffer);
apply_buffer (queue, buffer, &queue->sink_segment, TRUE, TRUE);
g_queue_push_tail (queue->queue, item);
g_queue_push_tail (&queue->queue, item);
GST_QUEUE_SIGNAL_ADD (queue);
}
@ -685,7 +685,7 @@ gst_queue_locked_enqueue_event (GstQueue * queue, gpointer item)
case GST_EVENT_SEGMENT:
apply_segment (queue, event, &queue->sink_segment, TRUE);
/* if the queue is empty, apply sink segment on the source */
if (queue->queue->length == 0) {
if (queue->queue.length == 0) {
GST_CAT_LOG_OBJECT (queue_dataflow, queue, "Apply segment on srcpad");
apply_segment (queue, event, &queue->src_segment, FALSE);
queue->newseg_applied_to_src = TRUE;
@ -698,7 +698,7 @@ gst_queue_locked_enqueue_event (GstQueue * queue, gpointer item)
break;
}
g_queue_push_tail (queue->queue, item);
g_queue_push_tail (&queue->queue, item);
GST_QUEUE_SIGNAL_ADD (queue);
}
@ -708,7 +708,7 @@ gst_queue_locked_dequeue (GstQueue * queue, gboolean * is_buffer)
{
GstMiniObject *item;
item = g_queue_pop_head (queue->queue);
item = g_queue_pop_head (&queue->queue);
if (item == NULL)
goto no_item;
@ -865,7 +865,7 @@ out_eos:
static gboolean
gst_queue_is_empty (GstQueue * queue)
{
if (queue->queue->length == 0)
if (queue->queue.length == 0)
return TRUE;
/* It is possible that a max size is reached before all min thresholds are.

View file

@ -105,7 +105,7 @@ struct _GstQueue {
gboolean eos;
/* the queue of data we're keeping our grubby hands on */
GQueue *queue;
GQueue queue;
GstQueueSize
cur_level, /* currently in the queue */

View file

@ -155,7 +155,7 @@ enum
queue->max_level.time, \
(guint64) (!QUEUE_IS_USING_QUEUE(queue) ? \
queue->current->writing_pos - queue->current->max_reading_pos : \
queue->queue->length))
queue->queue.length))
#define GST_QUEUE2_MUTEX_LOCK(q) G_STMT_START { \
g_mutex_lock (q->qlock); \
@ -433,7 +433,7 @@ gst_queue2_init (GstQueue2 * queue)
queue->item_add = g_cond_new ();
queue->waiting_del = FALSE;
queue->item_del = g_cond_new ();
queue->queue = g_queue_new ();
g_queue_init (&queue->queue);
queue->buffering_percent = 100;
@ -458,13 +458,13 @@ gst_queue2_finalize (GObject * object)
GST_DEBUG_OBJECT (queue, "finalizing queue");
while (!g_queue_is_empty (queue->queue)) {
GstMiniObject *data = g_queue_pop_head (queue->queue);
while (!g_queue_is_empty (&queue->queue)) {
GstMiniObject *data = g_queue_pop_head (&queue->queue);
gst_mini_object_unref (data);
}
g_queue_free (queue->queue);
g_queue_clear (&queue->queue);
g_mutex_free (queue->qlock);
g_cond_free (queue->item_add);
g_cond_free (queue->item_del);
@ -1442,8 +1442,8 @@ gst_queue2_locked_flush (GstQueue2 * queue)
gst_queue2_flush_temp_file (queue);
init_ranges (queue);
} else {
while (!g_queue_is_empty (queue->queue)) {
GstMiniObject *data = g_queue_pop_head (queue->queue);
while (!g_queue_is_empty (&queue->queue)) {
GstMiniObject *data = g_queue_pop_head (&queue->queue);
/* Then lose another reference because we are supposed to destroy that
data when flushing */
@ -1853,7 +1853,7 @@ gst_queue2_locked_enqueue (GstQueue2 * queue, gpointer item, gboolean isbuffer)
update_buffering (queue);
if (QUEUE_IS_USING_QUEUE (queue)) {
g_queue_push_tail (queue->queue, item);
g_queue_push_tail (&queue->queue, item);
} else {
gst_mini_object_unref (GST_MINI_OBJECT_CAST (item));
}
@ -1884,7 +1884,7 @@ gst_queue2_locked_dequeue (GstQueue2 * queue, gboolean * is_buffer)
if (!QUEUE_IS_USING_QUEUE (queue))
item = gst_queue2_read_item_from_file (queue);
else
item = g_queue_pop_head (queue->queue);
item = g_queue_pop_head (&queue->queue);
if (item == NULL)
goto no_item;
@ -2065,7 +2065,7 @@ gst_queue2_is_empty (GstQueue2 * queue)
if (!QUEUE_IS_USING_QUEUE (queue) && queue->current) {
return queue->current->writing_pos <= queue->current->max_reading_pos;
} else {
if (queue->queue->length == 0)
if (queue->queue.length == 0)
return TRUE;
}

View file

@ -95,7 +95,7 @@ struct _GstQueue2
gboolean unexpected;
/* the queue of data we're keeping our hands on */
GQueue *queue;
GQueue queue;
GstQueue2Size cur_level; /* currently in the queue */
GstQueue2Size max_level; /* max. amount of data allowed in the queue */