audioparsers: Add bitrate calculation to baseparse
authorArun Raghavan <arun.raghavan@collabora.co.uk>
Thu, 25 Mar 2010 11:22:58 +0000 (11:22 +0000)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Fri, 8 Apr 2011 17:07:04 +0000 (18:07 +0100)
commit733669e076215b2a0dcfd19cda9afc4f48632f79
tree568bb36f8dfaaf7fcbd183ef84018fb322f7352e
parentead9bd6b6246976d48adb4e50b1bfc61ec74bb33
audioparsers: Add bitrate calculation to baseparse

This makes baseparse keep a running average of the stream bitrate, as
well as the minimum and maximum bitrates. Subclasses can override a
vfunc to make sure that per-frame overhead from the container is not
accounted for in the bitrate calculation.

We take care not to override the bitrate, minimum-bitrate, and
maximum-bitrate tags if they have been posted upstream. We also
rate-limit the emission of bitrate so that it is only triggered by a
change of >10 kbps.
gst/audioparsers/gstbaseparse.c
gst/audioparsers/gstbaseparse.h