baseparse: custom bufferflag indicates not to count frame in stats

This commit is contained in:
Mark Nauwelaerts 2009-10-29 15:18:37 +01:00
parent 9eae24835e
commit 8f8f97dd2d
2 changed files with 14 additions and 1 deletions

View file

@ -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);

View file

@ -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