gboolean handled;
gboolean marshalled;
- GHook **called_probes;
+ gulong *called_probes;
guint n_called_probes;
guint called_probes_size;
gboolean retry;
{
GstPadProbeType type;
+ GST_DEBUG_OBJECT (pad,
+ "cleaning up hook %" G_GUINT64_FORMAT " with flags %08x", hook->hook_id,
+ hook->flags);
+
if (!G_HOOK_IS_VALID (hook))
return;
/* Default latency implementation */
typedef struct
{
- guint count;
gboolean live;
GstClockTime min, max;
} LatencyFoldData;
GST_LOG_OBJECT (pad, "got latency live:%s min:%" G_GINT64_FORMAT
" max:%" G_GINT64_FORMAT, live ? "true" : "false", min, max);
- /* FIXME : Why do we only take values into account if it's live ? */
- if (live || fold_data->count == 0) {
+ if (live) {
if (min > fold_data->min)
fold_data->min = min;
else if (max < fold_data->max)
fold_data->max = max;
- fold_data->live = live;
+ fold_data->live = TRUE;
}
- fold_data->count += 1;
} else if (peer) {
GST_DEBUG_OBJECT (pad, "latency query failed");
g_value_set_boolean (ret, FALSE);
g_value_init (&ret, G_TYPE_BOOLEAN);
retry:
- fold_data.count = 0;
fold_data.live = FALSE;
fold_data.min = 0;
fold_data.max = GST_CLOCK_TIME_NONE;
ret = gst_pad_query_latency_default (pad, query);
forward = FALSE;
break;
+ case GST_QUERY_BITRATE:
+ /* FIXME: better default handling */
+ forward = TRUE;
+ break;
case GST_QUERY_POSITION:
case GST_QUERY_SEEKING:
case GST_QUERY_FORMATS:
* if we're actually calling probes a second time */
if (data->retry) {
for (i = 0; i < data->n_called_probes; i++) {
- if (data->called_probes[i] == hook) {
+ if (data->called_probes[i] == hook->hook_id) {
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad,
"hook %lu already called", hook->hook_id);
return;
if (data->called_probes_size > N_STACK_ALLOCATE_PROBES) {
data->called_probes_size *= 2;
data->called_probes =
- g_renew (GHook *, data->called_probes, data->called_probes_size);
+ g_renew (gulong, data->called_probes, data->called_probes_size);
} else {
- GHook **tmp = data->called_probes;
+ gulong *tmp = data->called_probes;
data->called_probes_size *= 2;
- data->called_probes = g_new (GHook *, data->called_probes_size);
+ data->called_probes = g_new (gulong, data->called_probes_size);
memcpy (data->called_probes, tmp,
- N_STACK_ALLOCATE_PROBES * sizeof (GHook *));
+ N_STACK_ALLOCATE_PROBES * sizeof (gulong));
}
}
- data->called_probes[data->n_called_probes++] = hook;
+ data->called_probes[data->n_called_probes++] = hook->hook_id;
flags = hook->flags >> G_HOOK_FLAG_USER_SHIFT;
type = info->type;
ProbeMarshall data;
guint cookie;
gboolean is_block;
- GHook *called_probes[N_STACK_ALLOCATE_PROBES];
+ gulong called_probes[N_STACK_ALLOCATE_PROBES];
data.pad = pad;
data.info = info;