Commit f51a23a8 authored by Sebastian Dröge's avatar Sebastian Dröge

Merge branch 'master' into 0.11

parents 62329c60 8839c513
......@@ -763,6 +763,7 @@ init_post (GOptionContext * context, GOptionGroup * group, gpointer data,
_gst_value_initialize ();
g_type_class_ref (gst_param_spec_fraction_get_type ());
_gst_tag_initialize ();
gst_parse_context_get_type ();
_gst_plugin_initialize ();
......
......@@ -180,7 +180,7 @@ gst_buffer_list_len (GstBufferList * list)
* gst_buffer_list_foreach:
* @list: a #GstBufferList
* @func: (scope call): a #GstBufferListFunc to call
* @user_data: user data passed to @func
* @user_data: (closure): user data passed to @func
*
* Call @func with @data for each buffer in @list.
*
......
......@@ -42,9 +42,9 @@
/**
* gst_filter_run:
* @list: a linked list
* @func: the function to execute for each item
* @func: (scope call): the function to execute for each item
* @first: flag to stop execution after a successful item
* @user_data: user data
* @user_data: (closure): user data
*
* Iterates over the elements in @list, calling @func with the
* list item data for each item. If @func returns TRUE, @data is
......
......@@ -73,6 +73,7 @@ struct _GstProxyPadPrivate
G_DEFINE_TYPE (GstProxyPad, gst_proxy_pad, GST_TYPE_PAD);
static GstPad *gst_proxy_pad_get_target (GstPad * pad);
static GstPad *gst_proxy_pad_get_internal (GstPad * pad);
static void gst_proxy_pad_dispose (GObject * object);
static void gst_proxy_pad_finalize (GObject * object);
......@@ -99,9 +100,12 @@ static gboolean
gst_proxy_pad_do_event (GstPad * pad, GstEvent * event)
{
gboolean res = FALSE;
GstPad *internal = GST_PROXY_PAD_INTERNAL (pad);
GstPad *internal = gst_proxy_pad_get_internal (pad);
res = gst_pad_push_event (internal, event);
if (internal) {
res = gst_pad_push_event (internal, event);
gst_object_unref (internal);
}
return res;
}
......@@ -139,10 +143,13 @@ static GstFlowReturn
gst_proxy_pad_do_bufferalloc (GstPad * pad, guint64 offset, guint size,
GstCaps * caps, GstBuffer ** buf)
{
GstFlowReturn result;
GstPad *internal = GST_PROXY_PAD_INTERNAL (pad);
GstFlowReturn result = GST_FLOW_WRONG_STATE;
GstPad *internal = gst_proxy_pad_get_internal (pad);
result = gst_pad_alloc_buffer (internal, offset, size, caps, buf);
if (internal) {
result = gst_pad_alloc_buffer (internal, offset, size, caps, buf);
gst_object_unref (internal);
}
return result;
}
......@@ -349,6 +356,20 @@ gst_proxy_pad_get_target (GstPad * pad)
return target;
}
static GstPad *
gst_proxy_pad_get_internal (GstPad * pad)
{
GstPad *internal;
GST_PROXY_LOCK (pad);
internal = GST_PROXY_PAD_INTERNAL (pad);
if (internal)
gst_object_ref (internal);
GST_PROXY_UNLOCK (pad);
return internal;
}
static void
gst_proxy_pad_do_unlink (GstPad * pad)
{
......
......@@ -136,7 +136,7 @@ gst_element_implements_interface (GstElement * element, GType iface_type)
* cast a given object to an interface type, and check whether this
* interface is supported for this specific instance.
*
* Returns: a gpointer to the interface type
* Returns: (transfer none): a gpointer to the interface type
*/
gpointer
......
......@@ -471,8 +471,8 @@ filter_free (GstIteratorFilter * it)
/**
* gst_iterator_filter:
* @it: The #GstIterator to filter
* @func: the compare function to select elements
* @user_data: user data passed to the compare function
* @func: (scope call): the compare function to select elements
* @user_data: (closure): user data passed to the compare function
*
* Create a new iterator from an existing iterator. The new iterator
* will only return those elements that match the given compare function @func.
......@@ -481,7 +481,7 @@ filter_free (GstIteratorFilter * it)
*
* When this iterator is freed, @it will also be freed.
*
* Returns: a new #GstIterator.
* Returns: (transfer full): a new #GstIterator.
*
* MT safe.
*/
......@@ -510,9 +510,9 @@ gst_iterator_filter (GstIterator * it, GCompareFunc func, gpointer user_data)
/**
* gst_iterator_fold:
* @it: The #GstIterator to fold over
* @func: the fold function
* @func: (scope call): the fold function
* @ret: the seed value passed to the fold function
* @user_data: user data passed to the fold function
* @user_data: (closure): user data passed to the fold function
*
* Folds @func over the elements of @iter. That is to say, @func will be called
* as @func (object, @ret, @user_data) for each object in @it. The normal use
......@@ -578,8 +578,8 @@ foreach_fold_func (gpointer item, GValue * unused, ForeachFoldData * data)
/**
* gst_iterator_foreach:
* @it: The #GstIterator to iterate
* @func: the function to call for each element.
* @user_data: user data passed to the function
* @func: (scope call): the function to call for each element.
* @user_data: (closure): user data passed to the function
*
* Iterate over all element of @it and call the given function @func for
* each element. As in gst_iterator_fold(), the refcount of a refcounted
......@@ -630,8 +630,8 @@ find_custom_fold_func (gpointer item, GValue * ret, FindCustomFoldData * data)
/**
* gst_iterator_find_custom:
* @it: The #GstIterator to iterate
* @func: the compare function to use
* @user_data: user data passed to the compare function
* @func: (scope call): the compare function to use
* @user_data: (closure): user data passed to the compare function
*
* Find the first element in @it that matches the compare function @func.
* @func should return 0 when the element is found. As in gst_iterator_fold(),
......@@ -643,7 +643,7 @@ find_custom_fold_func (gpointer item, GValue * ret, FindCustomFoldData * data)
*
* This function will return NULL if an error happened to the iterator.
*
* Returns: The element in the iterator that matches the compare
* Returns: (transfer full): The element in the iterator that matches the compare
* function or NULL when no element matched.
*
* MT safe.
......
......@@ -202,7 +202,7 @@ gst_mini_object_make_writable (GstMiniObject * mini_object)
* of memcpy operations in a pipeline, especially if the miniobject
* is a #GstBuffer.
*
* Returns: the mini-object.
* Returns: (transfer full): the mini-object.
*/
GstMiniObject *
gst_mini_object_ref (GstMiniObject * mini_object)
......
......@@ -3750,7 +3750,8 @@ gst_pad_chain_data_unchecked (GstPad * pad, gboolean is_buffer, void *data,
goto no_function;
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
"calling chainfunction &%s", GST_DEBUG_FUNCPTR_NAME (chainfunc));
"calling chainfunction &%s with buffer %p",
GST_DEBUG_FUNCPTR_NAME (chainfunc), data);
if (cache) {
cache->peer = gst_object_ref (pad);
......@@ -3760,8 +3761,8 @@ gst_pad_chain_data_unchecked (GstPad * pad, gboolean is_buffer, void *data,
ret = chainfunc (pad, GST_BUFFER_CAST (data));
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
"called chainfunction &%s, returned %s",
GST_DEBUG_FUNCPTR_NAME (chainfunc), gst_flow_get_name (ret));
"called chainfunction &%s with buffer %p, returned %s",
GST_DEBUG_FUNCPTR_NAME (chainfunc), data, gst_flow_get_name (ret));
} else {
GstPadChainListFunction chainlistfunc;
......@@ -4170,14 +4171,15 @@ gst_pad_push (GstPad * pad, GstBuffer * buffer)
if (G_UNLIKELY (g_atomic_pointer_get (cache_ptr) == PAD_CACHE_INVALID))
goto invalid;
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad, "calling chainfunction &%s",
GST_DEBUG_FUNCPTR_NAME (GST_PAD_CHAINFUNC (peer)));
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
"calling chainfunction &%s with buffer %p",
GST_DEBUG_FUNCPTR_NAME (GST_PAD_CHAINFUNC (peer)), buffer);
ret = GST_PAD_CHAINFUNC (peer) (peer, buffer);
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
"called chainfunction &%s, returned %s",
GST_DEBUG_FUNCPTR_NAME (GST_PAD_CHAINFUNC (peer)),
"called chainfunction &%s with buffer %p, returned %s",
GST_DEBUG_FUNCPTR_NAME (GST_PAD_CHAINFUNC (peer)), buffer,
gst_flow_get_name (ret));
GST_PAD_STREAM_UNLOCK (peer);
......
......@@ -44,6 +44,42 @@
#include "parse/types.h"
#endif
static void
_prepend_missing_element (gchar * element, GList ** list)
{
*list = g_list_prepend (*list, g_strdup (element));
}
static GstParseContext *
gst_parse_context_copy (const GstParseContext * context)
{
GstParseContext *ret = NULL;
#ifndef GST_DISABLE_PARSE
ret = gst_parse_context_new ();
if (context) {
g_list_foreach (context->missing_elements, (GFunc) _prepend_missing_element,
&ret->missing_elements);
ret->missing_elements = g_list_reverse (ret->missing_elements);
}
#endif
return ret;
}
GType
gst_parse_context_get_type (void)
{
static GType type = 0;
if (G_UNLIKELY (type == 0)) {
type = g_boxed_type_register_static ("GstParseContext",
(GBoxedCopyFunc) gst_parse_context_copy,
(GBoxedFreeFunc) gst_parse_context_free);
}
return type;
}
/**
* gst_parse_error_quark:
*
......
......@@ -75,6 +75,8 @@ typedef enum
GST_PARSE_FLAG_FATAL_ERRORS = (1 << 0)
} GstParseFlags;
#define GST_TYPE_PARSE_CONTEXT (gst_parse_context_get_type())
/**
* GstParseContext:
*
......@@ -86,6 +88,7 @@ typedef struct _GstParseContext GstParseContext;
/* create, process and free a parse context */
GType gst_parse_context_get_type (void);
GstParseContext * gst_parse_context_new (void);
gchar ** gst_parse_context_get_missing_elements (GstParseContext * context);
......
......@@ -353,9 +353,36 @@ plugin_loader_create_blacklist_plugin (GstPluginLoader * l,
static gboolean
gst_plugin_loader_try_helper (GstPluginLoader * loader, gchar * location)
{
#ifdef __APPLE__
#if defined(__x86_64__)
char *argv[] = { (char *) "/usr/bin/arch", (char *) "-x86_64",
location, (char *) "-l", NULL
};
#elif defined(__i386__)
char *argv[] = { (char *) "/usr/bin/arch", (char *) "-i386",
location, (char *) "-l", NULL
};
#elif defined(__ppc__)
char *argv[] = { (char *) "/usr/bin/arch", (char *) "-ppc",
location, (char *) "-l", NULL
};
#elif defined(__ppc64__)
char *argv[] = { (char *) "/usr/bin/arch", (char *) "-ppc64",
location, (char *) "-l", NULL
};
#endif
#else /* ! __APPLE__ */
char *argv[] = { location, (char *) "-l", NULL };
#endif
#ifdef __APPLE__
GST_LOG ("Trying to spawn gst-plugin-scanner helper at %s with arch %s",
location, argv[1]);
#else
GST_LOG ("Trying to spawn gst-plugin-scanner helper at %s", location);
#endif
if (!g_spawn_async_with_pipes (NULL, argv, NULL,
G_SPAWN_DO_NOT_REAP_CHILD /* | G_SPAWN_STDERR_TO_DEV_NULL */ ,
NULL, NULL, &loader->child_pid, &loader->fd_w.fd, &loader->fd_r.fd,
......
......@@ -606,7 +606,7 @@ gst_registry_remove_feature (GstRegistry * registry, GstPluginFeature * feature)
/**
* gst_registry_plugin_filter:
* @registry: registry to query
* @filter: the filter to use
* @filter: (scope call): the filter to use
* @first: only return first match
* @user_data: (closure): user data passed to the filter function
*
......@@ -726,7 +726,7 @@ gst_registry_get_typefind_factory_list (GstRegistry * registry)
/**
* gst_registry_feature_filter:
* @registry: registry to query
* @filter: the filter to use
* @filter: (scope call): the filter to use
* @first: only return first match
* @user_data: (closure): user data passed to the filter function
*
......
......@@ -1074,7 +1074,7 @@ gst_structure_nth_field_name (const GstStructure * structure, guint index)
/**
* gst_structure_foreach:
* @structure: a #GstStructure
* @func: a function to call for each field
* @func: (scope call): a function to call for each field
* @user_data: (closure): private data
*
* Calls the provided function once for each field in the #GstStructure. The
......@@ -1110,7 +1110,7 @@ gst_structure_foreach (const GstStructure * structure,
/**
* gst_structure_map_in_place:
* @structure: a #GstStructure
* @func: a function to call for each field
* @func: (scope call): a function to call for each field
* @user_data: (closure): private data
*
* Calls the provided function once for each field in the #GstStructure. In
......
......@@ -1286,9 +1286,13 @@ gst_element_factory_can_accept_all_caps_in_direction (GstElementFactory *
GstStaticPadTemplate *template = (GstStaticPadTemplate *) templates->data;
if (template->direction == direction) {
if (gst_caps_is_always_compatible (caps,
gst_static_caps_get (&template->static_caps)))
GstCaps *templcaps = gst_static_caps_get (&template->static_caps);
if (gst_caps_is_always_compatible (caps, templcaps)) {
gst_caps_unref (templcaps);
return TRUE;
}
gst_caps_unref (templcaps);
}
templates = g_list_next (templates);
}
......@@ -1311,9 +1315,13 @@ gst_element_factory_can_accept_any_caps_in_direction (GstElementFactory *
GstStaticPadTemplate *template = (GstStaticPadTemplate *) templates->data;
if (template->direction == direction) {
if (gst_caps_can_intersect (caps,
gst_static_caps_get (&template->static_caps)))
GstCaps *templcaps = gst_static_caps_get (&template->static_caps);
if (gst_caps_can_intersect (caps, templcaps)) {
gst_caps_unref (templcaps);
return TRUE;
}
gst_caps_unref (templcaps);
}
templates = g_list_next (templates);
}
......@@ -3821,7 +3829,7 @@ gst_util_get_timestamp (void)
* @array: the sorted input array
* @num_elements: number of elements in the array
* @element_size: size of every element in bytes
* @search_func: function to compare two elements, @search_data will always be passed as second argument
* @search_func: (scope call): function to compare two elements, @search_data will always be passed as second argument
* @mode: search mode that should be used
* @search_data: element that should be found
* @user_data: (closure): data to pass to @search_func
......@@ -3834,7 +3842,7 @@ gst_util_get_timestamp (void)
*
* The complexity of this search function is O(log (num_elements)).
*
* Returns: The address of the found element or %NULL if nothing was found
* Returns: (transfer none): The address of the found element or %NULL if nothing was found
*
* Since: 0.10.23
*/
......
......@@ -35,7 +35,7 @@ PRINT (const char *format, ...)
%}
_operator [(){}.!,;=]
_identifier [[:alpha:]][[:alnum:]\-_%:]*
_identifier [[:alnum:]_][[:alnum:]\-_%:]*
_char ("\\".)|([^[:space:]])
_string {_char}+|("\""([^\"]|"\\\"")*"\"")|("'"([^']|"\\\'")*"'")
......
......@@ -1216,14 +1216,11 @@ gst_base_parse_update_bitrates (GstBaseParse * parse, GstBaseParseFrame * frame)
/* Only update the tag on a 10 kbps delta */
static const gint update_threshold = 10000;
GstBaseParseClass *klass;
guint64 data_len, frame_dur;
gint overhead, frame_bitrate, old_avg_bitrate;
gboolean update_min = FALSE, update_avg = FALSE, update_max = FALSE;
GstBuffer *buffer = frame->buffer;
klass = GST_BASE_PARSE_GET_CLASS (parse);
overhead = frame->overhead;
if (overhead == -1)
return;
......
......@@ -653,6 +653,8 @@ gst_base_sink_pad_buffer_alloc (GstPad * pad, guint64 offset, guint size,
GstFlowReturn result = GST_FLOW_OK;
bsink = GST_BASE_SINK (gst_pad_get_parent (pad));
if (G_UNLIKELY (bsink == NULL))
return GST_FLOW_WRONG_STATE;
bclass = GST_BASE_SINK_GET_CLASS (bsink);
if (bclass->buffer_alloc)
......@@ -3402,6 +3404,10 @@ gst_base_sink_event (GstPad * pad, GstEvent * event)
GstBaseSinkClass *bclass;
basesink = GST_BASE_SINK (gst_pad_get_parent (pad));
if (G_UNLIKELY (basesink == NULL)) {
gst_event_unref (event);
return FALSE;
}
bclass = GST_BASE_SINK_GET_CLASS (basesink);
......
......@@ -1225,8 +1225,13 @@ static gboolean
gst_base_transform_query (GstPad * pad, GstQuery * query)
{
gboolean ret = FALSE;
GstBaseTransform *trans = GST_BASE_TRANSFORM (gst_pad_get_parent (pad));
GstPad *otherpad = (pad == trans->srcpad) ? trans->sinkpad : trans->srcpad;
GstBaseTransform *trans;
GstPad *otherpad;
trans = GST_BASE_TRANSFORM (gst_pad_get_parent (pad));
if (G_UNLIKELY (trans == NULL))
return FALSE;
otherpad = (pad == trans->srcpad) ? trans->sinkpad : trans->srcpad;
switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_POSITION:{
......@@ -1716,6 +1721,8 @@ gst_base_transform_buffer_alloc (GstPad * pad, guint64 offset, guint size,
gsize size_suggest;
trans = GST_BASE_TRANSFORM (gst_pad_get_parent (pad));
if (G_UNLIKELY (trans == NULL))
return GST_FLOW_WRONG_STATE;
klass = GST_BASE_TRANSFORM_GET_CLASS (trans);
priv = trans->priv;
......@@ -1997,6 +2004,10 @@ gst_base_transform_sink_event (GstPad * pad, GstEvent * event)
gboolean forward = TRUE;
trans = GST_BASE_TRANSFORM (gst_pad_get_parent (pad));
if (G_UNLIKELY (trans == NULL)) {
gst_event_unref (event);
return FALSE;
}
bclass = GST_BASE_TRANSFORM_GET_CLASS (trans);
if (bclass->event)
......
......@@ -191,7 +191,10 @@ gst_funnel_sink_buffer_alloc (GstPad * pad, guint64 offset, guint size,
GstCaps * caps, GstBuffer ** buf)
{
GstFunnel *funnel = GST_FUNNEL (gst_pad_get_parent_element (pad));
GstFlowReturn ret = GST_FLOW_OK;
GstFlowReturn ret;
if (G_UNLIKELY (funnel == NULL))
return GST_FLOW_WRONG_STATE;
ret = gst_pad_alloc_buffer (funnel->srcpad, offset, size, caps, buf);
......@@ -246,6 +249,9 @@ gst_funnel_sink_getcaps (GstPad * pad)
GstFunnel *funnel = GST_FUNNEL (gst_pad_get_parent (pad));
GstCaps *caps;
if (G_UNLIKELY (funnel == NULL))
return gst_caps_new_any ();
caps = gst_pad_peer_get_caps_reffed (funnel->srcpad);
if (caps == NULL)
caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad));
......@@ -327,6 +333,11 @@ gst_funnel_sink_event (GstPad * pad, GstEvent * event)
gboolean forward = TRUE;
gboolean res = TRUE;
if (G_UNLIKELY (funnel == NULL)) {
gst_event_unref (event);
return FALSE;
}
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_NEWSEGMENT:
{
......@@ -346,7 +357,6 @@ gst_funnel_sink_event (GstPad * pad, GstEvent * event)
GST_OBJECT_UNLOCK (funnel);
forward = FALSE;
gst_event_unref (event);
}
break;
case GST_EVENT_FLUSH_STOP:
......@@ -363,6 +373,8 @@ gst_funnel_sink_event (GstPad * pad, GstEvent * event)
if (forward)
res = gst_pad_push_event (funnel->srcpad, event);
else
gst_event_unref (event);
gst_object_unref (funnel);
......@@ -379,7 +391,10 @@ gst_funnel_src_event (GstPad * pad, GstEvent * event)
gboolean done = FALSE;
funnel = gst_pad_get_parent_element (pad);
g_return_val_if_fail (funnel != NULL, FALSE);
if (G_UNLIKELY (funnel == NULL)) {
gst_event_unref (event);
return FALSE;
}
iter = gst_element_iterate_sink_pads (funnel);
......
......@@ -386,6 +386,10 @@ gst_selector_pad_event (GstPad * pad, GstEvent * event)
GstPad *active_sinkpad;
sel = GST_INPUT_SELECTOR (gst_pad_get_parent (pad));
if (G_UNLIKELY (sel == NULL)) {
gst_event_unref (event);
return FALSE;
}
selpad = GST_SELECTOR_PAD_CAST (pad);
GST_INPUT_SELECTOR_LOCK (sel);
......@@ -513,6 +517,8 @@ gst_selector_pad_getcaps (GstPad * pad)
GstCaps *caps;
sel = GST_INPUT_SELECTOR (gst_pad_get_parent (pad));
if (G_UNLIKELY (sel == NULL))
return gst_caps_new_any ();
GST_DEBUG_OBJECT (sel, "Getting caps of srcpad peer");
caps = gst_pad_peer_get_caps_reffed (sel->srcpad);
......@@ -531,6 +537,8 @@ gst_selector_pad_acceptcaps (GstPad * pad, GstCaps * caps)
gboolean res;
sel = GST_INPUT_SELECTOR (gst_pad_get_parent (pad));
if (G_UNLIKELY (sel == NULL))
return FALSE;
GST_DEBUG_OBJECT (sel, "Checking acceptcaps of srcpad peer");
res = gst_pad_peer_accept_caps (sel->srcpad, caps);
......@@ -550,6 +558,9 @@ gst_selector_pad_bufferalloc (GstPad * pad, guint64 offset,
GstSelectorPad *selpad;
sel = GST_INPUT_SELECTOR (gst_pad_get_parent (pad));
if (G_UNLIKELY (sel == NULL))
return GST_FLOW_WRONG_STATE;
selpad = GST_SELECTOR_PAD_CAST (pad);
GST_LOG_OBJECT (pad, "received alloc");
......
......@@ -1780,8 +1780,8 @@ gst_single_queue_new (GstMultiQueue * mqueue, gint id)
sq->src_tainted = TRUE;
name = g_strdup_printf ("sink%d", sq->id);
sq->sinkpad = gst_pad_new_from_static_template (&sinktemplate, name);
g_free (name);
gst_pad_set_chain_function (sq->sinkpad,
GST_DEBUG_FUNCPTR (gst_multi_queue_chain));
......
......@@ -294,10 +294,13 @@ gst_output_selector_get_property (GObject * object, guint prop_id,
static GstCaps *
gst_output_selector_sink_getcaps (GstPad * pad)
{
GstOutputSelector *sel = GST_OUTPUT_SELECTOR (GST_PAD_PARENT (pad));
GstOutputSelector *sel = GST_OUTPUT_SELECTOR (gst_pad_get_parent (pad));
GstPad *active = NULL;
GstCaps *caps = NULL;
if (G_UNLIKELY (sel == NULL))
return gst_caps_new_any ();
GST_OBJECT_LOCK (sel);
if (sel->pending_srcpad)
active = gst_object_ref (sel->pending_srcpad);
......@@ -312,6 +315,8 @@ gst_output_selector_sink_getcaps (GstPad * pad)
if (caps == NULL) {
caps = gst_caps_new_any ();
}
gst_object_unref (sel);
return caps;
}
......@@ -363,7 +368,9 @@ gst_output_selector_buffer_alloc (GstPad * pad, guint64 offset, guint size,
GstFlowReturn res;
GstPad *allocpad;
sel = GST_OUTPUT_SELECTOR (GST_PAD_PARENT (pad));
sel = GST_OUTPUT_SELECTOR (gst_pad_get_parent (pad));
if (G_UNLIKELY (sel == NULL))
return GST_FLOW_WRONG_STATE;
res = GST_FLOW_NOT_LINKED;
GST_OBJECT_LOCK (sel);
......@@ -390,6 +397,7 @@ gst_output_selector_buffer_alloc (GstPad * pad, guint64 offset, guint size,