python_plugin_template

Attributes

SIMAAI_META_STR

PLUGIN_CPU_TYPE

Classes

MetaStruct

SimaaiPythonBuffer

ValueType

Generic enumeration.

AggregatorTemplate

A Python based gstreamer plugin template. Enables the user to:

Module Contents

python_plugin_template.SIMAAI_META_STR = 'GstSimaMeta'
python_plugin_template.PLUGIN_CPU_TYPE = 'APU'
class python_plugin_template.MetaStruct(buffer_name, stream_id, timestamp, frame_id)
buffer_name
stream_id
timestamp
frame_id
class python_plugin_template.SimaaiPythonBuffer(metadata: MetaStruct, map: gi.repository.Gst.MapInfo)
metadata
data
size
class python_plugin_template.ValueType

Generic enumeration.

Derive from this class to define new enumerations.

INT64 = 0
UINT64 = 0
STRING = 0
DOUBLE = 0
class python_plugin_template.AggregatorTemplate(plugin_name, out_size)

A Python based gstreamer plugin template. Enables the user to: - Accept incoming buffers from dynamic pads - Define any custom plugin runtime logic User has to only override the run() function

transmit
silent
config
plugin_name
dynamic_pads = []
src_caps_set = False
timestamp = 0
frame_id = 0
is_pcie = False
in_pcie_buf_id = 0
stream_id = 'unknown-stream'
buffer_name = 'default'
plugin_id = 'python-agg-template'
t0 = None
t1 = None
out_size
request_new_pad(templ, direction=None, name=None)

Handle dynamic pad requests. Pads are created when a new input stream is added dynamically.

do_start()

Handle start even for the aggregator.

finish_buffer(buffer)

Finalizes and pushes the buffer downstream.

do_set_property(property_id, value)
do_get_property(property_id)
extract_metadata(buffer: gi.repository.Gst.Buffer) None

Input: buffer Gst.Buffer: Input buffer from which metadata will be extracted.

insert_metadata(buffer: gi.repository.Gst.Buffer) None

Input: buffer Gst.Buffer: Buffer to be inserted with custom metadata

get_gobject_value(value, value_type: ValueType) gi.repository.GObject.Value
do_aggregate(timeout)

Called when buffers are queued on all sinkpads. Calls the run() function defined by the user

abstract run(input_buffers: List[gi.repository.Gst.Buffer], output_buffer: gi.repository.Gst.Buffer) None

Input: input_buffers: List[Gst.Buffer] List of input buffers, source from each pad. output_buffer: Gst.Buffer Output buffer that needs to be overwritten.

Implement your logic within this function. Process the input buffers, and modify the output buffer.