After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 760403 - VideoFilter works with gst 1.4.5 but not 1.6
VideoFilter works with gst 1.4.5 but not 1.6
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-python
1.6.1
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-01-10 18:00 UTC by tripzero.kev
Modified: 2018-11-03 15:36 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description tripzero.kev 2016-01-10 18:00:41 UTC
#!/usr/bin/env python

from gi.repository import GObject, GstVideo, Gst, GstBase

GObject.threads_init()
Gst.init()


class TestFilter(GstVideo.VideoFilter):
        """ A basic, buffer forwarding Gstreamer element """

        #here we register our plugin details
        __gstmetadata__ = (
                "TeetFilter plugin",
                "Generic",
                "TestFilter is a filter",
                "Test Author")

        _srctemplate = Gst.PadTemplate.new('src',
                Gst.PadDirection.SRC,
                Gst.PadPresence.ALWAYS,
                Gst.Caps.from_string("video/x-raw,format=I420"))

        _sinktemplate = Gst.PadTemplate.new('sink',
                Gst.PadDirection.SINK,
                Gst.PadPresence.ALWAYS,
                Gst.Caps.from_string("video/x-raw,format=I420"))

        __gsttemplates__ = (_srctemplate, _sinktemplate)

        def __init__(self):
                GstVideo.VideoFilter.__init__(self)
                self.set_passthrough(True)

        def do_transform_frame_ip(self, inframe):
                print("succes!!!")
                return Gst.FlowReturn.OK

        def do_set_info(self, incaps, in_info, outcaps, out_info):
                return True

def plugin_init_testfilter(plugin):
        t = GObject.type_register (TestFilter)
        Gst.Element.register(plugin, "testfilter", 0, t)
        return True

Gst.Plugin.register_static(Gst.VERSION_MAJOR, Gst.VERSION_MINOR, "testfilter", "test filter plugin", plugin_init_testfilter, '1', 'LGPL', 'testfilter', 'testfilter', '')

#
# Simple Sink element created entirely in python
#
class TestVideoSink(GstBase.BaseSink):
    __gstmetadata__ = ('TestVideoSink','Sink', \
                      'Custom test sink element', 'Edward Hervey')

    __gsttemplates__ = Gst.PadTemplate.new("sink",
                                           Gst.PadDirection.SINK,
                                           Gst.PadPresence.ALWAYS,
                                           Gst.Caps.new_any())

    def do_render(self, buffer):
        Gst.info("timestamp(buffer):%s" % (Gst.TIME_ARGS(buffer.pts)))
        print("do_render")
        return Gst.FlowReturn.OK

def plugin_init_testvideosink(plugin):
        t = GObject.type_register(TestVideoSink)
        Gst.Element.register(plugin, "testvideosink", 0, t)
        return True

Gst.Element.register(None, "testvideosink", Gst.Rank.NONE, TestVideoSink)

if __name__ == '__main__':
        filter = Gst.ElementFactory.make('testfilter')
        sink = Gst.ElementFactory.make('testvideosink')

        assert(filter)
        assert(sink)
Comment 1 tripzero.kev 2016-01-10 18:08:26 UTC
The above test works on Ubuntu 15.04 with gstreamer 1.4.5 but not with Ubuntu 15.10 with 1.6.1.

On 1.6.1 I get:

(See next comment cuz Android sux at copy paste)
Comment 2 tripzero.kev 2016-01-10 18:08:43 UTC
python testfilter.py

(python:8202): GStreamer-WARNING **: Element factory metadata for 'testfilter' has no valid long-name field

(python:8202): GStreamer-WARNING **: Element factory metadata for 'testvideosink' has no valid long-name field
Traceback (most recent call last):
  • File "testfilter.py", line 77 in <module>
    assert(filter) AssertionError

Comment 3 GStreamer system administrator 2018-11-03 15:36:54 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-python/issues/6.