Example #1
0
    def update(self, render=None):
        videoSample = self.videoSink.get_property("last-sample")
        if videoSample:
            videoBuf = videoSample.get_buffer()
            videoData = videoBuf.extract_dup(0, videoBuf.get_size())

            pixels = sf.Pixels()
            pixels.data = videoData
            pixels.width = self._texture.width
            pixels.height = self._texture.height
            self._texture.update_from_pixels(pixels)

        message = self.bus.pop()
        while message:
            if message.type == Gst.MessageType.STREAM_START:
                self.initVideo()
            message = self.bus.pop()

        Widget.update(self, render)
Example #2
0
    def update(self):
        """Update the Window. It Update all event, and update framerate.
        It Draw and display also all widgets child"""
        if self.canUpdate:
            self._event.update()
            self._framerate = 1/(self._event.elapsedTime*10**-6)

            if self._event.isResize:
                Render._setSize(self,self.size)

            if self.event._mouseMoved:
                Widget.widgetFocus = None
    
            if self.event._mouseMoved and self.event.isMouseInRect(self.rect):
                Updatable._focusIsChecked= False
                Updatable.updateFocus(self)
            Widget.update(self, self)
            self.display()
            self.clear(self.backgroundColor)
Example #3
0
 def update(self, time):
     Widget.update(self, time)
     for w in self.widgets:
         w.update(time)
Example #4
0
 def update(self, time):
     Widget.update(self, time)
     for w in self.widgets:
         w.update(time)
Example #5
0
 def update(self, render=None):
     Active.update(self)
     Widget.update(self, render)