ADTF Qt5
Loading...
Searching...
No Matches
adtf::javascript::scripting::cScriptStructure Class Reference

#include <types.h>

Inherits QObject, and ddl::DDStructure.

Public Member Functions

Q_INVOKABLE QObject * add (const QString &strElementName, const QJSValue &oElementType, quint64 nArraySize=1)
 

Detailed Description

A wrapper for adtf::mediadescription::structure.

Member Function Documentation

◆ add()

Q_INVOKABLE QObject * adtf::javascript::scripting::cScriptStructure::add ( const QString & strElementName,
const QJSValue & oElementType,
quint64 nArraySize = 1 )

Adds an element to the structure definition.

Example Usage

var outputType = types.createDefinition("my_data")
.add("value1", "tUInt32")
.add("value2", "tFloat32")
var output = filter.createOutputPin("output", outputType)
var runner = filter.createRunner("generate_data")
var counter = 0
runner.trigger.connect(function(timestamp)
{
output.write(timestamp, {value1: counter, value2: counter})
++counter
})
Parameters
[in]strElementNameThe name of the element.
[in]oElementTypeEither the Type name (i.e. "tUInt32") or a cScriptStructure sub-structure definition.
[in]nArraySizeThe array size.
Returns
itself.

The documentation for this class was generated from the following file: