Exemple #1
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`
        """
        gst_position = utils.millisecond_to_clocktime(position)
        return self._playbin.seek_simple(
            gst.Format(gst.FORMAT_TIME), gst.SEEK_FLAG_FLUSH, gst_position)
Exemple #2
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`
        """
        gst_position = utils.millisecond_to_clocktime(position)
        return self._playbin.seek_simple(gst.Format(gst.FORMAT_TIME),
                                         gst.SEEK_FLAG_FLUSH, gst_position)
Exemple #3
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
Exemple #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
Exemple #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
Exemple #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