|summary||dmai-perf inaccuracty in fps and bps calculation||dmai-perf inaccuracy in fps and bps calculation
Fixed in Commit #538
Now the dmaiperf element is printing data per second instead of data per
I reverted to previous commit to follow standard approval procedure (commit
Also, the patch with these changes was attached here, to follow the correct
I'm a little confused as your change doesn't quite match with what Todd F. and I
discussed on IRC. On IRC Todd had suggested doing fixed-point division to three
decimal places so we don't incur the overhead of floating-point operations for
each frame we display. However, your code has a variable named
"factor" that is type float, so every divide operation with
"factor" in it is a floating-point divide. From our
discussion I was expecting to see something more like factor being an int that
was calculated with a "/ 1000" instead of a "*
0.001", and perhaps the printf needing to compensate for the fact that
you moved the decimal point three places.
Truth is, since gstreamer keeps track of time in MSECONDS anyway, we probably
don't really even need to think about fixed point to 3 places -- all the values
are already ints.
Can you explain your thinking here?
Thanks and regards,
I changed the code to calculate the fps and bps using fixed point operations.
Changes was included in patch attached (fixedPoint.patch)
Attaching patch with all changes included in the last two patches added
Thanks, this looks better. I only have one more comment -- instead of using
"long long", for your data type, would it make more sense to
use "GstClockTime"? The gst folks created this type to
guarantee that it will be large enough to hold clock values on all platforms.
This happens to be a guint64 (or unsigned long long) on our platforms, but you
can't necessarily make this assumption.
Thanks and regards,
Using "GstClockTime" instead of "long long".
Changes included on realDataPerSecond_fixedPoint_typevarfixed.patch patch
Thanks for the update, Lix.
When you changed "long long" to
"GstClockTime", technically you should have changed the %lld
fields of the two printfs to %llu as well. Could you make this change before
committing? I'm ok if you just make this change and commit without posting
Otherwise, it looks fine.
I changed lld by llu, the patch was committed directly on trunk including this