[Bug 772853] New: example of python identity element for 1.0

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Thu Oct 13 11:24:13 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=772853

            Bug ID: 772853
           Summary: example of python identity element for 1.0
    Classification: Platform
           Product: GStreamer
           Version: 1.x
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: Normal
         Component: gst-python
          Assignee: gstreamer-bugs at lists.freedesktop.org
          Reporter: msb at qtec.com
        QA Contact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---

Right now you only have an example for a sink in:
https://cgit.freedesktop.org/gstreamer/gst-python/tree/examples/plugins/python

Here is one for a transform, a simple identity (if of interest):

#!/usr/bin/env python
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4

import gi
gi.require_version('GstBase', '1.0')

from gi.repository import Gst, GObject, GstBase
Gst.init(None)

#
# Simple Identity element created entirely in python
#
class Identity(GstBase.BaseTransform):
    __gstmetadata__ = ('Identity Python','Transform', \
                      'Simple identity element written in python', 'Marianna S.
Buschle')

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

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

GObject.type_register(Identity)
__gstelementfactory__ = ("identity_py", Gst.Rank.NONE, Identity)

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list