Example #1
0
    def __init__(self, options={}): 
        base.Base.__init__(self, options)
        Gst.Bin.__init__(self)

        # FIXME check route in conf/recorderui and define options
        if "background" not in self.options:
            background= (path.join(path.dirname(path.abspath(galicaster.__file__)), "..", "resources", "bg.png") )
        else:
            background = (path.join(path.dirname(path.abspath(galicaster.__file__)), "..", self.options["background"]))

        if self.options["drivertype"] == "v4l":
            driver_type = "v4lsrc"
        else:
            driver_type = "v4l2src"

        aux = (pipestr.replace("gc-epiphan-preview", "sink-" + self.options['name'])
                      .replace('gc-epiphan-enc', self.options['videoencoder'])
                      .replace('gc-epiphan-mux', self.options['muxer']))
        size = self.options['resolution']
        width, height =  [int(a) for a in size.split(re.search('[,x:]',size).group())]
        bin_end = Gst.parse_bin_from_description(aux, True)
        logger.info("Setting background for Epiphan: %s", background)
        bin_start = Switcher("canguro", self.options['location'], background, 
                             driver_type, [width,height], self.options['framerate'])
        self.bin_start=bin_start            
        self.add(bin_start, bin_end)
        bin_start.link(bin_end)

        sink = self.get_by_name("gc-epiphan-sink")
        sink.set_property('location', path.join(self.options['path'], self.options['file']))
Example #2
0
    def __init__(self, options={}):
        base.Base.__init__(self, options)
        gst.Bin.__init__(self, self.options['name'])

        # FIXME check route in conf/recorderui and define options
        if "background" not in self.options:
            background = (path.join(
                path.dirname(path.abspath(galicaster.__file__)), "..",
                "resources", "bg.png"))
        else:
            background = (path.join(
                path.dirname(path.abspath(galicaster.__file__)), "..",
                self.options["background"]))

        if self.options["drivertype"] == "v4l":
            driver_type = "v4lsrc"
        else:
            driver_type = "v4l2src"

        bin_end = gst.parse_bin_from_description(
            pipestr.replace("gc-vga2usb-preview",
                            "sink-" + self.options['name']), True)
        log.info("Setting background for Epiphan: %s", background)
        bin_start = Switcher("canguro", self.options['location'], background,
                             driver_type)
        self.bin_start = bin_start

        self.add(bin_start, bin_end)
        bin_start.link(bin_end)

        sink = self.get_by_name("gc-vga2usb-sink")
        sink.set_property(
            'location', path.join(self.options['path'], self.options['file']))
Example #3
0
    def __init__(self, options={}): 
        base.Base.__init__(self, options)
        gst.Bin.__init__(self, self.options['name'])

        # FIXME check route in conf/recorderui and define options
        if "background" not in self.options:
            background= (path.join(path.dirname(path.abspath(galicaster.__file__)), "..", "resources", "bg.png") )
        else:
            background = (path.join(path.dirname(path.abspath(galicaster.__file__)), "..", self.options["background"]))

        if self.options["drivertype"] == "v4l":
            driver_type = "v4lsrc"
        else:
            driver_type = "v4l2src"

        aux = (pipestr.replace("gc-vga2usb-preview", "sink-" + self.options['name'])
                      .replace('gc-vga2usb-enc', self.options['encoder'])
                      .replace('gc-vga2usb-mux', self.options['muxer']))


        bin_end = gst.parse_bin_from_description(aux, True)
        log.info("Setting background for Epiphan: %s", background)
        bin_start = Switcher("canguro", self.options['location'], background, driver_type)
        self.bin_start=bin_start            

        self.add(bin_start, bin_end)
        bin_start.link(bin_end)

        sink = self.get_by_name("gc-vga2usb-sink")
        sink.set_property('location', path.join(self.options['path'], self.options['file']))
Example #4
0
    def __init__(self, options={}):
        base.Base.__init__(self, options)
        gst.Bin.__init__(self, self.options['name'])

        # FIXME check route in conf/recorderui and define options
        if "background" not in self.options:
            background = (path.join(
                path.dirname(path.abspath(galicaster.__file__)), "..",
                "resources", "bg.png"))
        else:
            background = (path.join(
                path.dirname(path.abspath(galicaster.__file__)), "..",
                self.options["background"]))

        if self.options["drivertype"] == "v4l":
            driver_type = "v4lsrc"
        else:
            driver_type = "v4l2src"

        aux = (pipestr.replace("gc-epiphan-preview",
                               "sink-" + self.options['name']).replace(
                                   'gc-epiphan-enc',
                                   self.options['videoencoder']).replace(
                                       'gc-epiphan-mux',
                                       self.options['muxer']))
        size = self.options['resolution']
        width, height = [
            int(a) for a in size.split(re.search('[,x:]', size).group())
        ]
        bin_end = gst.parse_bin_from_description(aux, True)
        logger.info("Setting background for Epiphan: %s", background)
        bin_start = Switcher("canguro", self.options['location'], background,
                             driver_type, [width, height],
                             self.options['framerate'])
        self.bin_start = bin_start
        self.add(bin_start, bin_end)
        bin_start.link(bin_end)

        sink = self.get_by_name("gc-epiphan-sink")
        sink.set_property(
            'location', path.join(self.options['path'], self.options['file']))