Skip to content

Commit

Permalink
Preview helper uses sync=false
Browse files Browse the repository at this point in the history
  • Loading branch information
hyades committed Dec 7, 2014
1 parent fc0c3d3 commit fb6bfa5
Showing 1 changed file with 36 additions and 6 deletions.
42 changes: 36 additions & 6 deletions python-api/gstswitch/testsource.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,26 @@ def __init__(self, port):
self.preview_port = port
src = self.make_tcpclientsrc()
self.add(src)

gdpdepay = self.make_gdpdepay()
self.add(gdpdepay)
src.link(gdpdepay)
sink = self.make_autovideosink()

conv1 = self.make_videoconvert("conv1")
self.add(conv1)
gdpdepay.link(conv1)

cairo = self.make_cairooverlay()
self.add(cairo)
conv1.link(cairo)

conv2 = self.make_videoconvert("conv2")
self.add(conv2)
cairo.link(conv2)

sink = self.make_xvimagesink()
self.add(sink)
gdpdepay.link(sink)
conv2.link(sink)

def make_tcpclientsrc(self):
"""Return a TCP Client Source element
Expand All @@ -258,14 +272,30 @@ def make_gdpdepay(self):
element = self.make('gdpdepay', 'gdpdepay')
return element

def make_autovideosink(self):
"""Return a auto video sink element to show the video
:returns: A Auto Video Sink element
def make_videoconvert(self, desc):
"""Return a videoconvert element
:returns: A videoconvert element
"""
element = self.make('videoconvert', desc)
return element

def make_cairooverlay(self):
"""Return a cairooverlay element
:returns: A cairooverlay element
"""
element = self.make('cairooverlay', 'cairooverlay')
return element

def make_xvimagesink(self):
"""Return a xvimagesink element
:returns: A xvimagesink element
"""
element = self.make('autovideosink', 'autovideosink')
element = self.make('xvimagesink', 'xvimagesink')
element.set_property('sync', 'false')
return element



class VideoSrc(object):

"""A Test Video Source
Expand Down

0 comments on commit fb6bfa5

Please sign in to comment.