return TRUE;
}
+static inline void
+set_descriptors_array_on_structure (GstStructure * structure, GQuark quark,
+ GValueArray * descriptors)
+{
+ GValue value = { 0 };
+
+ g_value_init (&value, G_TYPE_VALUE_ARRAY);
+ g_value_take_boxed (&value, descriptors);
+ gst_structure_id_take_value (structure, quark, &value);
+}
+
static gboolean
mpegts_packetizer_parse_descriptors (MpegTSPacketizer2 * packetizer,
guint8 ** buffer, guint8 * buffer_end, GValueArray * descriptors)
g_value_array_free (descriptors);
goto error;
}
- gst_structure_id_set (cat_info, QUARK_DESCRIPTORS, G_TYPE_VALUE_ARRAY,
- descriptors, NULL);
- g_value_array_free (descriptors);
+ set_descriptors_array_on_structure (cat_info, QUARK_DESCRIPTORS, descriptors);
return cat_info;
error:
goto error;
}
- gst_structure_id_set (pmt, QUARK_DESCRIPTORS, G_TYPE_VALUE_ARRAY,
- descriptors, NULL);
- g_value_array_free (descriptors);
+ set_descriptors_array_on_structure (pmt, QUARK_DESCRIPTORS, descriptors);
}
g_value_init (&programs, GST_TYPE_LIST);
goto error;
}
- gst_structure_id_set (stream_info,
- QUARK_DESCRIPTORS, G_TYPE_VALUE_ARRAY, descriptors, NULL);
- g_value_array_free (descriptors);
+ set_descriptors_array_on_structure (stream_info, QUARK_DESCRIPTORS,
+ descriptors);
}
}
g_value_array_free (descriptors);
goto error;
}
- gst_structure_id_set (nit, QUARK_DESCRIPTORS, G_TYPE_VALUE_ARRAY,
- descriptors, NULL);
- g_value_array_free (descriptors);
+ set_descriptors_array_on_structure (nit, QUARK_DESCRIPTORS, descriptors);
}
}
goto error;
}
- gst_structure_id_set (transport, QUARK_DESCRIPTORS, G_TYPE_VALUE_ARRAY,
- descriptors, NULL);
- g_value_array_free (descriptors);
+ set_descriptors_array_on_structure (transport, QUARK_DESCRIPTORS,
+ descriptors);
}
g_value_init (&transport_value, GST_TYPE_STRUCTURE);
g_value_array_free (descriptors);
goto error;
}
-
- gst_structure_id_set (service, QUARK_DESCRIPTORS, G_TYPE_VALUE_ARRAY,
- descriptors, NULL);
-
- g_value_array_free (descriptors);
+ set_descriptors_array_on_structure (service, QUARK_DESCRIPTORS,
+ descriptors);
}
g_value_init (&service_value, GST_TYPE_STRUCTURE);
g_value_array_free (descriptors);
goto error;
}
- gst_structure_id_set (event, QUARK_DESCRIPTORS, G_TYPE_VALUE_ARRAY,
- descriptors, NULL);
- g_value_array_free (descriptors);
+ set_descriptors_array_on_structure (event, QUARK_DESCRIPTORS,
+ descriptors);
}
g_value_init (&event_value, GST_TYPE_STRUCTURE);