示例#1
0
文件: actor.py 项目: arjunrn/mopidy
    def set_position(self, position):
        """
        Set position in milliseconds.

        :param position: the position in milliseconds
        :type position: int
        :rtype: :class:`True` if successful, else :class:`False`
        """
        gst_position = utils.millisecond_to_clocktime(position)
        return self._playbin.seek_simple(
            gst.Format(gst.FORMAT_TIME), gst.SEEK_FLAG_FLUSH, gst_position)
示例#2
0
文件: actor.py 项目: ysilvela/mopidy
    def set_position(self, position):
        """
        Set position in milliseconds.

        :param position: the position in milliseconds
        :type position: int
        :rtype: :class:`True` if successful, else :class:`False`
        """
        gst_position = utils.millisecond_to_clocktime(position)
        return self._playbin.seek_simple(gst.Format(gst.FORMAT_TIME),
                                         gst.SEEK_FLAG_FLUSH, gst_position)
示例#3
0
文件: actor.py 项目: HaBaLeS/mopidy
    def set_position(self, position):
        """
        Set position in milliseconds.

        :param position: the position in milliseconds
        :type position: int
        :rtype: :class:`True` if successful, else :class:`False`
        """
        # TODO: double check seek flags in use.
        gst_position = utils.millisecond_to_clocktime(position)
        result = self._playbin.seek_simple(gst.Format(gst.FORMAT_TIME), gst.SEEK_FLAG_FLUSH, gst_position)
        gst_logger.debug("Sent flushing seek: position=%s", gst_position)
        return result
示例#4
0
    def set_position(self, position):
        """
        Set position in milliseconds.

        :param position: the position in milliseconds
        :type position: int
        :rtype: :class:`True` if successful, else :class:`False`
        """
        # TODO: double check seek flags in use.
        gst_position = utils.millisecond_to_clocktime(position)
        result = self._playbin.seek_simple(gst.Format(gst.FORMAT_TIME),
                                           gst.SEEK_FLAG_FLUSH, gst_position)
        gst_logger.debug('Sent flushing seek: position=%s', gst_position)
        return result
示例#5
0
    def set_position(self, position):
        """
        Set position in milliseconds.

        :param position: the position in milliseconds
        :type position: int
        :rtype: :class:`True` if successful, else :class:`False`
        """
        # TODO: double check seek flags in use.
        gst_position = utils.millisecond_to_clocktime(position)
        gst_logger.debug('Sending flushing seek: position=%r', gst_position)
        # Send seek event to the queue not the playbin. The default behavior
        # for bins is to forward this event to all sinks. Which results in
        # duplicate seek events making it to appsrc. Since elements are not
        # allowed to act on the seek event, only modify it, this should be safe
        # to do.
        result = self._queue.seek_simple(Gst.Format.TIME, Gst.SeekFlags.FLUSH,
                                         gst_position)
        return result
示例#6
0
    def set_position(self, position):
        """
        Set position in milliseconds.

        :param position: the position in milliseconds
        :type position: int
        :rtype: :class:`True` if successful, else :class:`False`
        """
        # TODO: double check seek flags in use.
        gst_position = utils.millisecond_to_clocktime(position)
        gst_logger.debug('Sending flushing seek: position=%r', gst_position)
        # Send seek event to the queue not the playbin. The default behavior
        # for bins is to forward this event to all sinks. Which results in
        # duplicate seek events making it to appsrc. Since elements are not
        # allowed to act on the seek event, only modify it, this should be safe
        # to do.
        result = self._queue.seek_simple(
            Gst.Format.TIME, Gst.SeekFlags.FLUSH, gst_position)
        return result