mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
tracer/gsttr-stats: move time unit hack into method
This commit is contained in:
parent
68d1925826
commit
2150443565
1 changed files with 6 additions and 2 deletions
|
@ -108,6 +108,11 @@ def format_ts(ts):
|
||||||
s = (ts / sec)
|
s = (ts / sec)
|
||||||
return '{:02d}.{:02d}.{:010.7f}'.format(h,m,s)
|
return '{:02d}.{:02d}.{:010.7f}'.format(h,m,s)
|
||||||
|
|
||||||
|
def is_time_field(f):
|
||||||
|
# TODO: need proper units
|
||||||
|
return (f.endswith('/time') or f.endswith('-dts') or f.endswith('-pts') or
|
||||||
|
f.endswith('-duration'))
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
import argparse
|
import argparse
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
|
@ -127,8 +132,7 @@ if __name__ == '__main__':
|
||||||
mi = tv.get('min', '-')
|
mi = tv.get('min', '-')
|
||||||
ma = tv.get('max', '-')
|
ma = tv.get('max', '-')
|
||||||
avg = tv['sum']/tv['num']
|
avg = tv['sum']/tv['num']
|
||||||
# TODO: need proper units
|
if is_time_field(tk):
|
||||||
if tk.endswith('/time') or tk.endswith('-dts') or tk.endswith('-pts'):
|
|
||||||
if mi != '-':
|
if mi != '-':
|
||||||
mi = format_ts(mi)
|
mi = format_ts(mi)
|
||||||
if ma != '-':
|
if ma != '-':
|
||||||
|
|
Loading…
Reference in a new issue