Beispiel #1
0
    def _set_source_image(self, width, height):
        imgBuf, imagesOverflowed, textOverflowed = \
            genimg.generateOverlay(
                text=self.text,
                font=self.font,
                showFlumotion=self.showFlumotion,
                showCC=self.showCC,
                showXiph=self.showXiph,
                width=width, height=height)

        if textOverflowed:
            m = messages.Warning(T_(
                N_("Overlayed text '%s' too wide for the video image."),
                self.text),
                                 mid="text-too-wide")
            self.addMessage(m)

        if imagesOverflowed:
            m = messages.Warning(T_(
                N_("Overlayed logotypes too wide for the video image.")),
                                 mid="image-too-wide")
            self.addMessage(m)

        if self.source.get_factory().get_name() == 'appsrc':
            self.imgBuf = imgBuf
        else:
            self.source.imgBuf = imgBuf
Beispiel #2
0
    def _set_source_image(self, width, height):
        imgBuf, imagesOverflowed, textOverflowed = \
            genimg.generateOverlay(
                text=self.text,
                font=self.font,
                showFlumotion=self.showFlumotion,
                showCC=self.showCC,
                showXiph=self.showXiph,
                width=width, height=height)

        if textOverflowed:
            m = messages.Warning(
                T_(N_("Overlayed text '%s' too wide for the video image."),
                   self.text), mid="text-too-wide")
            self.addMessage(m)

        if imagesOverflowed:
            m = messages.Warning(
                T_(N_("Overlayed logotypes too wide for the video image.")),
                mid="image-too-wide")
            self.addMessage(m)

        if self.source.get_factory().get_name() == 'appsrc':
            self.imgBuf = imgBuf
        else:
            self.source.imgBuf = imgBuf
Beispiel #3
0
    def configure_pipeline(self, pipeline, properties):
        p = properties
        self.fixRenamedProperties(p, [
                ('show_text', 'show-text'),
                ('fluendo_logo', 'fluendo-logo'),
                ('cc_logo', 'cc-logo'),
                ('xiph_logo', 'xiph-logo')])

        text = None
        if p.get('show-text', False):
            text = p.get('text', 'set the "text" property')
        self.imgBuf, imagesOverflowed, textOverflowed = \
            genimg.generateOverlay(
                text=text,
                showFlumotion=p.get('fluendo-logo', False),
                showCC=p.get('cc-logo', False),
                showXiph=p.get('xiph-logo', False),
                width=p['width'],
                height=p['height'])

        if textOverflowed:
            m = messages.Warning(
                T_(N_("Overlayed text '%s' too wide for the video image."),
                   text), mid="text-too-wide")
            self.addMessage(m)

        if imagesOverflowed:
            m = messages.Warning(
                T_(N_("Overlayed logotypes too wide for the video image.")),
                mid="image-too-wide")
            self.addMessage(m)
        self.capsStr = "video/x-raw-rgb,bpp=32,depth=32,width=%d,height=%d," \
            "red_mask=-16777216,green_mask=16711680,blue_mask=65280," \
            "alpha_mask=255,framerate=0/1" % (p['width'], p['height'])
        padcaps = gst.caps_from_string(self.capsStr)
        source = self.get_element('source')
        if source.get_factory().get_name() == 'appsrc':
            # push buffer when we need to, currently we push a duration of
            # G_MAXINT_64 so we never need to push another one
            # but if we want dynamic change of overlay, we should make
            # duration tunable in properties
            source.connect('need-data', self.push_buffer)
            source.props.caps = padcaps
        else:
            # FIXME: fluoverlaysrc only needed on gst-plugins-base < 0.10.22
            source.imgBuf = self.imgBuf
            source.capsStr = self.capsStr
        vmixerVersion = gstreamer.get_plugin_version('videomixer')
        if vmixerVersion == (0, 10, 7, 0):
            m = messages.Warning(
                T_(N_("The 'videomixer' GStreamer element has a bug in this "
                      "version (0.10.7). You may see many errors in the debug "
                      "output, but it should work correctly anyway.")),
                mid="videomixer-bug")
            self.addMessage(m)