gst1: Update FORMAT_* with Format.*
This commit is contained in:
parent
74cf32ede2
commit
5d6981d70e
@ -614,7 +614,7 @@ class Audio(pykka.ThreadingActor):
|
|||||||
:rtype: int
|
:rtype: int
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
gst_position = self._playbin.query_position(Gst.FORMAT_TIME)[0]
|
gst_position = self._playbin.query_position(Gst.Format.TIME)[0]
|
||||||
return utils.clocktime_to_millisecond(gst_position)
|
return utils.clocktime_to_millisecond(gst_position)
|
||||||
except Gst.QueryError:
|
except Gst.QueryError:
|
||||||
# TODO: take state into account for this and possibly also return
|
# TODO: take state into account for this and possibly also return
|
||||||
@ -633,7 +633,7 @@ class Audio(pykka.ThreadingActor):
|
|||||||
# TODO: double check seek flags in use.
|
# TODO: double check seek flags in use.
|
||||||
gst_position = utils.millisecond_to_clocktime(position)
|
gst_position = utils.millisecond_to_clocktime(position)
|
||||||
result = self._playbin.seek_simple(
|
result = self._playbin.seek_simple(
|
||||||
Gst.Format(Gst.FORMAT_TIME), Gst.SeekFlags.FLUSH, gst_position)
|
Gst.Format.TIME, Gst.SeekFlags.FLUSH, gst_position)
|
||||||
gst_logger.debug('Sent flushing seek: position=%s', gst_position)
|
gst_logger.debug('Sent flushing seek: position=%s', gst_position)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|||||||
@ -116,7 +116,7 @@ def _start_pipeline(pipeline):
|
|||||||
|
|
||||||
def _query_duration(pipeline):
|
def _query_duration(pipeline):
|
||||||
try:
|
try:
|
||||||
duration = pipeline.query_duration(Gst.FORMAT_TIME, None)[0]
|
duration = pipeline.query_duration(Gst.Format.TIME, None)[0]
|
||||||
except Gst.QueryError:
|
except Gst.QueryError:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ def _query_duration(pipeline):
|
|||||||
|
|
||||||
|
|
||||||
def _query_seekable(pipeline):
|
def _query_seekable(pipeline):
|
||||||
query = Gst.query_new_seeking(Gst.FORMAT_TIME)
|
query = Gst.query_new_seeking(Gst.Format.TIME)
|
||||||
pipeline.query(query)
|
pipeline.query(query)
|
||||||
return query.parse_seeking()[1]
|
return query.parse_seeking()[1]
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user