mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 11:32:38 +00:00
stats: handle buffer lists
This commit is contained in:
parent
75fb1f1a73
commit
37721fdc9d
1 changed files with 46 additions and 0 deletions
|
@ -484,6 +484,46 @@ do_push_buffer_post (GstStatsTracer * self, va_list var_args)
|
|||
do_element_stats (self, pad, stats->last_ts, ts);
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GstStatsTracer *self;
|
||||
GstPad *pad;
|
||||
GstPadStats *stats;
|
||||
guint64 ts;
|
||||
} DoPushBufferListArgs;
|
||||
|
||||
static gboolean
|
||||
do_push_buffer_list_item (GstBuffer ** buffer, guint idx, gpointer user_data)
|
||||
{
|
||||
DoPushBufferListArgs *args = (DoPushBufferListArgs *) user_data;
|
||||
|
||||
do_pad_stats (args->self, args->pad, args->stats, *buffer, args->ts);
|
||||
do_transmission_stats (args->self, args->pad, *buffer, args->ts);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
do_push_buffer_list_pre (GstStatsTracer * self, va_list var_args)
|
||||
{
|
||||
guint64 ts = va_arg (var_args, guint64);
|
||||
GstPad *pad = va_arg (var_args, GstPad *);
|
||||
GstBufferList *list = va_arg (var_args, GstBufferList *);
|
||||
GstPadStats *stats = get_pad_stats (self, pad);
|
||||
DoPushBufferListArgs args = { self, pad, stats, ts };
|
||||
|
||||
gst_buffer_list_foreach (list, do_push_buffer_list_item, &args);
|
||||
}
|
||||
|
||||
static void
|
||||
do_push_buffer_list_post (GstStatsTracer * self, va_list var_args)
|
||||
{
|
||||
guint64 ts = va_arg (var_args, guint64);
|
||||
GstPad *pad = va_arg (var_args, GstPad *);
|
||||
GstPadStats *stats = get_pad_stats (self, pad);
|
||||
|
||||
do_element_stats (self, pad, stats->last_ts, ts);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_stats_tracer_invoke (GstTracer * obj, GstTracerHookId hid,
|
||||
GstTracerMessageId mid, va_list var_args)
|
||||
|
@ -497,6 +537,12 @@ gst_stats_tracer_invoke (GstTracer * obj, GstTracerHookId hid,
|
|||
case GST_TRACER_MESSAGE_ID_PAD_PUSH_POST:
|
||||
do_push_buffer_post (self, var_args);
|
||||
break;
|
||||
case GST_TRACER_MESSAGE_ID_PAD_PUSH_LIST_PRE:
|
||||
do_push_buffer_list_pre (self, var_args);
|
||||
break;
|
||||
case GST_TRACER_MESSAGE_ID_PAD_PUSH_LIST_POST:
|
||||
do_push_buffer_list_post (self, var_args);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue