From 07778061705873896db2a31a9874241f244e3117 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Thu, 29 Oct 2009 15:18:37 +0100 Subject: [PATCH] baseparse: custom bufferflag indicates not to count frame in stats --- gst/audioparsers/gstbaseparse.c | 4 +++- gst/audioparsers/gstbaseparse.h | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/gst/audioparsers/gstbaseparse.c b/gst/audioparsers/gstbaseparse.c index 7e5c937b96..fa506a1b2c 100644 --- a/gst/audioparsers/gstbaseparse.c +++ b/gst/audioparsers/gstbaseparse.c @@ -942,7 +942,9 @@ gst_base_parse_push_buffer (GstBaseParse * parse, GstBuffer * buffer) /* update stats */ parse->priv->bytecount += GST_BUFFER_SIZE (buffer); - parse->priv->framecount++; + parse->priv->framecount += + !GST_BUFFER_FLAG_IS_SET (buffer, GST_BASE_PARSE_BUFFER_FLAG_NO_FRAME); + GST_BUFFER_FLAG_UNSET (buffer, GST_BASE_PARSE_BUFFER_FLAG_NO_FRAME); if (parse->priv->update_interval && (parse->priv->framecount % parse->priv->update_interval) == 0) gst_base_parse_update_duration (parse); diff --git a/gst/audioparsers/gstbaseparse.h b/gst/audioparsers/gstbaseparse.h index 2654cb194d..a6a5f54f2f 100644 --- a/gst/audioparsers/gstbaseparse.h +++ b/gst/audioparsers/gstbaseparse.h @@ -78,6 +78,17 @@ G_BEGIN_DECLS */ #define GST_BASE_PARSE_FLOW_DROPPED GST_FLOW_CUSTOM_SUCCESS +/** + * GST_BASE_PARSE_BUFFER_FLAG_NO_FRAME: + * + * A #GstBufferFlag that can be set to have this buffer not counted as frame, + * e.g. if this frame is dependent on a previous one. As it is not counted as + * a frame, bitrate increases but frame to time conversions are maintained. + * + * Since: 0.10.x + */ +#define GST_BASE_PARSE_BUFFER_FLAG_NO_FRAME GST_BUFFER_FLAG_LAST + /** * GST_BASE_PARSE_LOCK: * @obj: base parse instance