def __init__(self, ventana_id, device="/dev/video0"):

        gobject.GObject.__init__(self)

        if PR:
            print "JAMediaWebCamMenu Iniciada"

        self.ventana_id = ventana_id
        self.pipeline = gst.Pipeline()

        camara = gst.Bin()

        if "Escritorio" in device:
            from VideoBins import ximagesrc_bin
            camara = ximagesrc_bin()

        else:
            if "/dev/video" in device:
                from VideoBins import v4l2src_bin
                camara = v4l2src_bin()
                camara.set_device(device)

            else:
                from VideoBins import In_lan_udpsrc_bin
                camara = In_lan_udpsrc_bin(device)

        from VideoBins import Balance_bin
        balance = Balance_bin()

        from VideoBins import xvimage_bin
        xvimage = xvimage_bin()

        self.pipeline.add(camara)
        self.pipeline.add(balance)
        self.pipeline.add(xvimage)

        camara.link(balance)
        balance.link(xvimage)

        self.bus = self.pipeline.get_bus()
        #self.bus.set_sync_handler(self.__bus_handler)
        self.bus.add_signal_watch()  # ****
        #self.bus.connect('message', self.__on_mensaje)          # ****
        self.bus.enable_sync_message_emission()  # ****
        self.bus.connect('sync-message', self.__sync_message)  # ****
    def __init__(self, ventana_id, device="/dev/video0"):

        gobject.GObject.__init__(self)

        if PR:
            print "JAMediaWebCamMenu Iniciada"

        self.ventana_id = ventana_id
        self.pipeline = gst.Pipeline()

        camara = gst.Bin()

        if "Escritorio" in device:
            from VideoBins import ximagesrc_bin
            camara = ximagesrc_bin()

        else:
            if "/dev/video" in device:
                from VideoBins import v4l2src_bin
                camara = v4l2src_bin()
                camara.set_device(device)

            else:
                from VideoBins import In_lan_udpsrc_bin
                camara = In_lan_udpsrc_bin(device)

        from VideoBins import Balance_bin
        balance = Balance_bin()

        from VideoBins import xvimage_bin
        xvimage = xvimage_bin()

        self.pipeline.add(camara)
        self.pipeline.add(balance)
        self.pipeline.add(xvimage)

        camara.link(balance)
        balance.link(xvimage)

        self.bus = self.pipeline.get_bus()
        #self.bus.set_sync_handler(self.__bus_handler)
        self.bus.add_signal_watch()                             # ****
        #self.bus.connect('message', self.__on_mensaje)          # ****
        self.bus.enable_sync_message_emission()                 # ****
        self.bus.connect('sync-message', self.__sync_message)   # ****
Beispiel #3
0
    def __init__(self, ventana_id, device="/dev/video0"):

        gobject.GObject.__init__(self)

        if PR:
            print "JAMediaWebCamMenu Iniciada"

        self.ventana_id = ventana_id
        self.pipeline = gst.Pipeline()

        camara = gst.Bin()

        if "Escritorio" in device:
            from VideoBins import ximagesrc_bin
            camara = ximagesrc_bin()

        else:
            if "/dev/video" in device:
                from VideoBins import v4l2src_bin
                camara = v4l2src_bin()
                camara.set_device(device)

            else:
                from VideoBins import In_lan_udpsrc_bin
                camara = In_lan_udpsrc_bin(device)

        from VideoBins import Balance_bin
        balance = Balance_bin()

        from VideoBins import xvimage_bin
        xvimage = xvimage_bin()

        self.pipeline.add(camara)
        self.pipeline.add(balance)
        self.pipeline.add(xvimage)

        camara.link(balance)
        balance.link(xvimage)

        self.bus = self.pipeline.get_bus()
        self.bus.set_sync_handler(self.__bus_handler)
Beispiel #4
0
    def __init__(self, ventana_id, device="/dev/video0",
        formato="ogg", efectos=[]):

        gobject.GObject.__init__(self)

        if PR:
            print "JAMediaWebCamVideo Iniciada"

        self.actualizador = False
        self.tamanio = 0
        self.timer = 0
        self.estado = None
        self.ventana_id = ventana_id
        self.formato = formato
        self.path_archivo = ""
        self.foto_contador = 0
        self.rafaga = False

        self.pipeline = gst.Pipeline()

        camara = gst.Bin()

        if "Escritorio" in device:
            from VideoBins import ximagesrc_bin
            camara = ximagesrc_bin()

        else:
            if "/dev/video" in device:
                from VideoBins import v4l2src_bin
                camara = v4l2src_bin()
                camara.set_device(device)

            else:
                from VideoBins import In_lan_udpsrc_bin
                camara = In_lan_udpsrc_bin(device)

        from VideoBins import Balance_bin
        self.balance = Balance_bin()

        self.pipeline.add(camara)
        self.pipeline.add(self.balance)

        if efectos:
            from VideoBins import Video_Efectos_bin
            efectos_bin = Video_Efectos_bin(efectos)
            self.pipeline.add(efectos_bin)
            camara.link(efectos_bin)
            efectos_bin.link(self.balance)

        else:
            camara.link(self.balance)

        self.tee = gst.element_factory_make('tee', "tee")
        self.tee.set_property('pull-mode', 1)

        self.pipeline.add(self.tee)

        from VideoBins import xvimage_bin
        xvimage = xvimage_bin()
        self.pipeline.add(xvimage)

        self.balance.link(self.tee)
        self.tee.link(xvimage)

        from VideoBins import Foto_bin
        fotobin = Foto_bin()
        self.pipeline.add(fotobin)

        self.tee.link(fotobin)

        self.bus = self.pipeline.get_bus()
        self.bus.set_sync_handler(self.__bus_handler)
Beispiel #5
0
    def __init__(self,
                 ventana_id,
                 device="/dev/video0",
                 formato="ogg",
                 efectos=[]):

        gobject.GObject.__init__(self)

        if PR:
            print "JAMediaWebCamVideo Iniciada"

        self.actualizador = False
        self.tamanio = 0
        self.timer = 0
        self.estado = None
        self.ventana_id = ventana_id
        self.formato = formato
        self.path_archivo = ""
        self.foto_contador = 0
        self.rafaga = False

        self.pipeline = gst.Pipeline()

        camara = gst.Bin()

        if "Escritorio" in device:
            from VideoBins import ximagesrc_bin
            camara = ximagesrc_bin()

        else:
            if "/dev/video" in device:
                from VideoBins import v4l2src_bin
                camara = v4l2src_bin()
                camara.set_device(device)

            else:
                from VideoBins import In_lan_udpsrc_bin
                camara = In_lan_udpsrc_bin(device)

        from VideoBins import Balance_bin
        self.balance = Balance_bin()

        self.pipeline.add(camara)
        self.pipeline.add(self.balance)

        if efectos:
            from VideoBins import Video_Efectos_bin
            efectos_bin = Video_Efectos_bin(efectos)
            self.pipeline.add(efectos_bin)
            camara.link(efectos_bin)
            efectos_bin.link(self.balance)

        else:
            camara.link(self.balance)

        self.tee = gst.element_factory_make('tee', "tee")
        self.tee.set_property('pull-mode', 1)

        self.pipeline.add(self.tee)

        from VideoBins import xvimage_bin
        xvimage = xvimage_bin()
        self.pipeline.add(xvimage)

        self.balance.link(self.tee)
        self.tee.link(xvimage)

        from VideoBins import Foto_bin
        fotobin = Foto_bin()
        self.pipeline.add(fotobin)

        self.tee.link(fotobin)

        self.bus = self.pipeline.get_bus()
        self.bus.add_signal_watch()
        self.bus.connect('message', self.__on_mensaje)
        self.bus.enable_sync_message_emission()
        self.bus.connect('sync-message', self.__sync_message)