gboolean res = TRUE;
GstCaps *rawcaps;
GstPad *pad;
+ GValue item = { 0, };
*have_out = FALSE;
*is_raw = FALSE;
pads_iter = gst_element_iterate_src_pads (decoder->source);
while (!done) {
- switch (gst_iterator_next (pads_iter, (gpointer) & pad)) {
+ switch (gst_iterator_next (pads_iter, &item)) {
case GST_ITERATOR_ERROR:
res = FALSE;
/* FALLTROUGH */
gst_iterator_resync (pads_iter);
break;
case GST_ITERATOR_OK:
+ pad = g_value_get_object (&item);
/* we now officially have an ouput pad */
*have_out = TRUE;
/* if FALSE, this pad has no caps and we continue with the next pad. */
if (!has_all_raw_caps (pad, rawcaps, is_raw)) {
- gst_object_unref (pad);
+ g_value_reset (&item);
break;
}
}
expose_decoded_pad (outelem, pad, decoder);
}
- gst_object_unref (pad);
+ g_value_reset (&item);
break;
}
}
+ g_value_unset (&item);
gst_iterator_free (pads_iter);
gst_caps_unref (rawcaps);
{
post_missing_plugin_error (GST_ELEMENT_CAST (decoder), "queue2");
- gst_object_unref (pad);
+ g_value_unset (&item);
gst_iterator_free (pads_iter);
gst_caps_unref (rawcaps);
}
static gboolean
-decoder_query_duration_fold (GstPad * item, GValue * ret, QueryFold * fold)
+decoder_query_duration_fold (const GValue * item, GValue * ret,
+ QueryFold * fold)
{
- if (gst_pad_query (item, fold->query)) {
+ GstPad *pad = g_value_get_object (item);
+
+ if (gst_pad_query (pad, fold->query)) {
gint64 duration;
g_value_set_boolean (ret, TRUE);
if (duration > fold->max)
fold->max = duration;
}
- gst_object_unref (item);
return TRUE;
}
}
static gboolean
-decoder_query_position_fold (GstPad * item, GValue * ret, QueryFold * fold)
+decoder_query_position_fold (const GValue * item, GValue * ret,
+ QueryFold * fold)
{
- if (gst_pad_query (item, fold->query)) {
+ GstPad *pad = g_value_get_object (item);
+
+ if (gst_pad_query (pad, fold->query)) {
gint64 position;
g_value_set_boolean (ret, TRUE);
fold->max = position;
}
- gst_object_unref (item);
return TRUE;
}
}
static gboolean
-decoder_query_latency_fold (GstPad * item, GValue * ret, QueryFold * fold)
+decoder_query_latency_fold (const GValue * item, GValue * ret, QueryFold * fold)
{
- if (gst_pad_query (item, fold->query)) {
+ GstPad *pad = g_value_get_object (item);
+
+ if (gst_pad_query (pad, fold->query)) {
GstClockTime min, max;
gboolean live;
fold->live = live;
}
- gst_object_unref (item);
return TRUE;
}
/* we are seekable if all srcpads are seekable */
static gboolean
-decoder_query_seeking_fold (GstPad * item, GValue * ret, QueryFold * fold)
+decoder_query_seeking_fold (const GValue * item, GValue * ret, QueryFold * fold)
{
- if (gst_pad_query (item, fold->query)) {
+ GstPad *pad = g_value_get_object (item);
+
+ if (gst_pad_query (pad, fold->query)) {
gboolean seekable;
g_value_set_boolean (ret, TRUE);
if (fold->seekable == TRUE)
fold->seekable = seekable;
}
- gst_object_unref (item);
return TRUE;
}
/* generic fold, return first valid result */
static gboolean
-decoder_query_generic_fold (GstPad * item, GValue * ret, QueryFold * fold)
+decoder_query_generic_fold (const GValue * item, GValue * ret, QueryFold * fold)
{
+ GstPad *pad = g_value_get_object (item);
gboolean res;
- if ((res = gst_pad_query (item, fold->query))) {
+ if ((res = gst_pad_query (pad, fold->query))) {
g_value_set_boolean (ret, TRUE);
GST_DEBUG_OBJECT (item, "answered query %p", fold->query);
}
- gst_object_unref (item);
-
/* and stop as soon as we have a valid result */
return !res;
}