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'[source]
python_plugin_template.PLUGIN_CPU_TYPE = 'APU'[source]
class python_plugin_template.MetaStruct(buffer_name, stream_id, timestamp, frame_id)[source]
buffer_name[source]
stream_id[source]
timestamp[source]
frame_id[source]
class python_plugin_template.SimaaiPythonBuffer(metadata: MetaStruct, map: gi.repository.Gst.MapInfo)[source]
metadata[source]
data[source]
size[source]
class python_plugin_template.ValueType[source]

Generic enumeration.

Derive from this class to define new enumerations.

INT64 = 0[source]
UINT64 = 0[source]
STRING = 0[source]
DOUBLE = 0[source]
class python_plugin_template.AggregatorTemplate(plugin_name, out_size)[source]

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[source]
silent[source]
config[source]
plugin_name[source]
dynamic_pads = [][source]
src_caps_set = False[source]
timestamp = 0[source]
frame_id = 0[source]
is_pcie = False[source]
in_pcie_buf_id = 0[source]
stream_id = 'unknown-stream'[source]
buffer_name = 'default'[source]
plugin_id = 'python-agg-template'[source]
t0 = None[source]
t1 = None[source]
out_size[source]
request_new_pad(templ, direction=None, name=None)[source]

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

do_start()[source]

Handle start even for the aggregator.

finish_buffer(buffer)[source]

Finalizes and pushes the buffer downstream.

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

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

insert_metadata(buffer: gi.repository.Gst.Buffer) None[source]

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

get_gobject_value(value, value_type: ValueType) gi.repository.GObject.Value[source]
do_aggregate(timeout)[source]

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[source]

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.