/**
* gst_util_dump_mem:
- * @mem: a pointer to the memory to dump
+ * @mem: (array length=size): a pointer to the memory to dump
* @size: the size of the memory block to dump
*
* Dumps the memory block into a hex representation. Useful for debugging.
* on a segment-done message to be the same as that of the last seek event, to
* indicate that event and the message correspond to the same segment.
*
- * This function never returns GST_SEQNUM_INVALID (which is 0).
+ * This function never returns %GST_SEQNUM_INVALID (which is 0).
*
* Returns: A constantly incrementing 32-bit unsigned integer, which might
* overflow at some point. Use gst_util_seqnum_compare() to make sure
return FALSE;
} else {
/* no need to release any request pad as the case of unset destpatname and
- * destpad being a requst pad has already been taken care of when looking
+ * destpad being a request pad has already been taken care of when looking
* though the destination pads above */
if (destpad) {
gst_object_unref (destpad);
GstQuery *query;
gboolean ret;
+ if (cur != NULL)
+ *cur = GST_CLOCK_TIME_NONE;
+
g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
g_return_val_if_fail (format != GST_FORMAT_UNDEFINED, FALSE);
GstQuery *query;
gboolean ret;
+ if (duration != NULL)
+ *duration = GST_CLOCK_TIME_NONE;
+
g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
g_return_val_if_fail (format != GST_FORMAT_UNDEFINED, FALSE);
* @debug: (in) (allow-none): an additional debug information string, or %NULL
*
* A default error function that uses g_printerr() to display the error message
- * and the optional debug sting..
+ * and the optional debug string..
*
* The default handler will simply print the error string using g_print.
*/
GstQuery *query;
gboolean ret;
+ if (cur != NULL)
+ *cur = GST_CLOCK_TIME_NONE;
+
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
g_return_val_if_fail (format != GST_FORMAT_UNDEFINED, FALSE);
GstQuery *query;
gboolean ret = FALSE;
+ if (cur != NULL)
+ *cur = GST_CLOCK_TIME_NONE;
+
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
g_return_val_if_fail (format != GST_FORMAT_UNDEFINED, FALSE);
GstQuery *query;
gboolean ret;
+ if (duration != NULL)
+ *duration = GST_CLOCK_TIME_NONE;
+
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
g_return_val_if_fail (format != GST_FORMAT_UNDEFINED, FALSE);
GstQuery *query;
gboolean ret = FALSE;
+ if (duration != NULL)
+ *duration = GST_CLOCK_TIME_NONE;
+
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
g_return_val_if_fail (GST_PAD_IS_SINK (pad), FALSE);
g_return_val_if_fail (format != GST_FORMAT_UNDEFINED, FALSE);
* and want them all ghosted, you will have to create the ghost pads
* yourself).
*
- * Returns: (transfer floating) (type Gst.Element): a newly-created
+ * Returns: (transfer floating) (type Gst.Element) (nullable): a newly-created
* element, which is guaranteed to be a bin unless
* GST_FLAG_NO_SINGLE_ELEMENT_BINS was passed, or %NULL if an error
* occurred.
clock_gettime (CLOCK_MONOTONIC, &now);
return GST_TIMESPEC_TO_TIME (now);
#else
- GTimeVal now;
-
- g_get_current_time (&now);
- return GST_TIMEVAL_TO_TIME (now);
+ return g_get_monotonic_time () * 1000;
#endif
}
* This function is used to generate a new group-id for the
* stream-start event.
*
+ * This function never returns %GST_GROUP_ID_INVALID (which is 0)
+ *
* Returns: A constantly incrementing unsigned integer, which might
* overflow back to 0 at some point.
*/
guint
gst_util_group_id_next (void)
{
- static gint counter = 0;
- return g_atomic_int_add (&counter, 1);
+ static gint counter = 1;
+ gint ret = g_atomic_int_add (&counter, 1);
+
+ /* Make sure we don't return GST_GROUP_ID_INVALID */
+ if (G_UNLIKELY (ret == GST_GROUP_ID_INVALID))
+ ret = g_atomic_int_add (&counter, 1);
+
+ return ret;
}
/* Compute log2 of the passed 64-bit number by finding the highest set bit */