Fixes some bug, probably?
[python-gstreamer-examples] / example4.py
index 73987820b1e3ca70550f54938ea3919250ba17d4..b39d17529d0dac0a058d1aa18fcb8f8ae0b5de44 100755 (executable)
@@ -38,7 +38,7 @@ class Main:
         # Add a videotestsrc element, set it to pattern "ball" and some other properties
         self.ball = Gst.ElementFactory.make("videotestsrc", "ball")
         self.ball.set_property("pattern", "ball")
         # Add a videotestsrc element, set it to pattern "ball" and some other properties
         self.ball = Gst.ElementFactory.make("videotestsrc", "ball")
         self.ball.set_property("pattern", "ball")
-        self.ball.set_property("flip", True)
+        #self.ball.set_property("flip", True)
 
         # Add a capsfilter that we want to apply to our ball
         self.ballcaps = Gst.ElementFactory.make("capsfilter", "ballcaps")
 
         # Add a capsfilter that we want to apply to our ball
         self.ballcaps = Gst.ElementFactory.make("capsfilter", "ballcaps")
@@ -92,7 +92,7 @@ class Main:
     def SetInput1(self, widget):
         print("Switch to input 1")
         # Halt current pipeline and tear it down
     def SetInput1(self, widget):
         print("Switch to input 1")
         # Halt current pipeline and tear it down
-        self.pipeline.set_state(Gst.State.NULL)
+        self.pipeline.set_state(Gst.State.READY)
         self.webcamcaps.unlink(self.videosink)
         self.pipeline.remove(self.webcam)
         self.pipeline.remove(self.webcamcaps)
         self.webcamcaps.unlink(self.videosink)
         self.pipeline.remove(self.webcam)
         self.pipeline.remove(self.webcamcaps)
@@ -106,7 +106,7 @@ class Main:
     def SetInput2(self, widget):
         print("Switch to input 2")
         # Halt current pipeline and tear it down
     def SetInput2(self, widget):
         print("Switch to input 2")
         # Halt current pipeline and tear it down
-        self.pipeline.set_state(Gst.State.NULL)
+        self.pipeline.set_state(Gst.State.READY)
         self.ballcaps.unlink(self.videosink)
         self.pipeline.remove(self.ball)
         self.pipeline.remove(self.ballcaps)
         self.ballcaps.unlink(self.videosink)
         self.pipeline.remove(self.ball)
         self.pipeline.remove(self.ballcaps)