Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gstreamer
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thibault Saunier
gstreamer
Commits
0d7db77b
Commit
0d7db77b
authored
May 11, 2019
by
Michael Olbrich
Committed by
Tim-Philipp Müller
May 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdb: refactor time formating
Make it reuseable independent of the GstClockTimePrinter.
parent
744687e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
24 deletions
+33
-24
libs/gst/helpers/gst_gdb.py
libs/gst/helpers/gst_gdb.py
+33
-24
No files found.
libs/gst/helpers/gst_gdb.py
View file @
0d7db77b
...
...
@@ -91,6 +91,38 @@ class GstObjectPrettyPrinter:
return
"0x
%
x"
%
long
(
self
.
val
)
GST_SECOND
=
1000000000
GST_CLOCK_TIME_NONE
=
2
**
64
-
1
GST_CLOCK_STIME_NONE
=
-
2
**
63
def
format_time
(
n
,
signed
):
prefix
=
""
invalid
=
False
if
signed
:
if
n
==
GST_CLOCK_STIME_NONE
:
invalid
=
True
prefix
=
"+"
if
n
>=
0
else
"-"
n
=
abs
(
n
)
else
:
if
n
==
GST_CLOCK_TIME_NONE
:
invalid
=
True
if
invalid
:
return
"99:99:99.999999999"
return
"
%
s
%
u:
%02
u:
%02
u.
%09
u"
%
(
prefix
,
n
/
(
GST_SECOND
*
60
*
60
),
(
n
/
(
GST_SECOND
*
60
))
%
60
,
(
n
/
GST_SECOND
)
%
60
,
n
%
GST_SECOND
)
def
format_time_value
(
val
):
return
format_time
(
int
(
val
),
str
(
val
.
type
)
==
"GstClockTimeDiff"
)
class
GstClockTimePrinter
:
"Prints a GstClockTime / GstClockTimeDiff"
...
...
@@ -98,30 +130,7 @@ class GstClockTimePrinter:
self
.
val
=
val
def
to_string
(
self
):
GST_SECOND
=
1000000000
GST_CLOCK_TIME_NONE
=
2
**
64
-
1
GST_CLOCK_STIME_NONE
=
-
2
**
63
n
=
int
(
self
.
val
)
prefix
=
""
invalid
=
False
if
str
(
self
.
val
.
type
)
==
"GstClockTimeDiff"
:
if
n
==
GST_CLOCK_STIME_NONE
:
invalid
=
True
prefix
=
"+"
if
n
>=
0
else
"-"
n
=
abs
(
n
)
else
:
if
n
==
GST_CLOCK_TIME_NONE
:
invalid
=
True
if
invalid
:
return
str
(
n
)
+
" [99:99:99.999999999]"
return
str
(
n
)
+
" [
%
s
%
u:
%02
u:
%02
u.
%09
u]"
%
(
prefix
,
n
/
(
GST_SECOND
*
60
*
60
),
(
n
/
(
GST_SECOND
*
60
))
%
60
,
(
n
/
GST_SECOND
)
%
60
,
n
%
GST_SECOND
)
return
"
%
d [
%
s]"
%
(
int
(
self
.
val
),
format_time_value
(
self
.
val
))
def
gst_pretty_printer_lookup
(
val
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment