ADTF Qt5
Loading...
Searching...
No Matches
types.h
Go to the documentation of this file.
1
7
8/*
9 * This file depends on Qt which is licensed under LGPLv3.
10 * See ADTF_DIR/3rdparty/qt5 and doc/license for detailed information.
11 */
12#pragma once
13
14#include <adtf_utils.h>
15#include <adtfstreaming3/streamtype_intf.h>
16#include <adtfstreaming3/streammetatypesubstreams.h>
17#include <adtfmediadescription/type_reflection.h>
18#include <QJSEngine>
19
20namespace adtf
21{
22
23namespace javascript
24{
25
26namespace scripting
27{
28
32class cScriptStructure : public QObject, public ddl::DDStructure
33{
34 Q_OBJECT
35
36public:
38 cScriptStructure(const QString& strStructName, QJSEngine& oEngine);
40
52 Q_INVOKABLE QObject* add(const QString& strElementName, const QJSValue& oElementType, quint64 nArraySize = 1);
53
54private:
55 QJSEngine& m_oEngine;
56};
57
61class cStreamTypeWrapper : public QObject
62{
63 Q_OBJECT
64public:
66 cStreamTypeWrapper(ucom::object_ptr<adtf::streaming::IStreamType> pType, QJSEngine& oEngine);
67 ucom::object_ptr<const adtf::streaming::IStreamType> getType() const;
68 QString getStreamMetaType() const;
69 QVariantMap getProperties() const;
71
73 Q_PROPERTY(QVariantMap properties READ getProperties)
75 Q_PROPERTY(QString stream_meta_type READ getStreamMetaType)
81 Q_INVOKABLE void setProperty(const QString& strName, const QJSValue& oValue);
82
91 Q_INVOKABLE QList<QString> getSubStreams();
92
102 Q_INVOKABLE QObject* getSubStreamType(const QString& strSubStream);
103
104private:
105 ucom::object_ptr<adtf::streaming::IStreamType> m_pType;
106 QJSEngine& m_oEngine;
107};
108
112
113class cSubStreamsTypeWrapper : public QObject
114{
115 Q_OBJECT
116public:
118 cSubStreamsTypeWrapper(QJSEngine& oEngine);
119 ucom::object_ptr<const adtf::streaming::IStreamType> getType() const;
121
128 Q_INVOKABLE void setSubStream(const QString& strName, quint32 nSubStreamId, const QJSValue& oStreamType);
129
130private:
131 streaming::hollow::cSubStreamTypes m_oSubStreams;
132 QJSEngine& m_oEngine;
133};
134
138class cScriptTypes : public QObject
139{
140 Q_OBJECT
141
142public:
144 cScriptTypes(QJSEngine& oEngine, const adtf::util::cFilepath& strScriptFolder);
146
156 Q_INVOKABLE QObject* createDefinition(const QString& strStructName);
157
169 Q_INVOKABLE QObject* getDefinition(const QString& strStructName);
170
181 Q_INVOKABLE QObject* createStreamType(const QString& strMetaType);
182
193 Q_INVOKABLE QObject* createPlainStreamType(const QString& strCType);
194
202 Q_INVOKABLE QObject* createSubStreamsType();
203
217 Q_INVOKABLE QObject*
218 fromDescriptionFile(const QString& strStructName, const QString& strFileName, bool bResolveStruct = true);
219
232 Q_INVOKABLE QObject* fromDescriptionString(const QString& strStructName,
233 const QString& strMediaDescription,
234 bool bResolveStruct = true);
235
236private:
237 QJSEngine& m_oEngine;
238 adtf::util::cFilepath m_strScriptFolder;
239};
240
242ucom::object_ptr<const adtf::streaming::IStreamType> get_stream_type(const QJSValue& oStreamType);
244
245} // namespace scripting
246} // namespace javascript
247} // namespace adtf
Q_INVOKABLE QObject * add(const QString &strElementName, const QJSValue &oElementType, quint64 nArraySize=1)
Q_INVOKABLE QObject * createDefinition(const QString &strStructName)
Q_INVOKABLE QObject * fromDescriptionFile(const QString &strStructName, const QString &strFileName, bool bResolveStruct=true)
Q_INVOKABLE QObject * createStreamType(const QString &strMetaType)
Q_INVOKABLE QObject * fromDescriptionString(const QString &strStructName, const QString &strMediaDescription, bool bResolveStruct=true)
Q_INVOKABLE QObject * createPlainStreamType(const QString &strCType)
Q_INVOKABLE QObject * getDefinition(const QString &strStructName)
Q_INVOKABLE QObject * createSubStreamsType()
QVariantMap properties
Returns the properties of the stream type.
Definition types.h:73
Q_INVOKABLE void setProperty(const QString &strName, const QJSValue &oValue)
QString stream_meta_type
Returns the stream meta type of the stream type.
Definition types.h:75
Q_INVOKABLE QList< QString > getSubStreams()
Q_INVOKABLE QObject * getSubStreamType(const QString &strSubStream)
Q_INVOKABLE void setSubStream(const QString &strName, quint32 nSubStreamId, const QJSValue &oStreamType)
Definition clock.h:25
Namespace for the ADTF JavaScript Filter SDK.
Definition clock.h:22
Namespace for all functionality provided by ADTF and its SDKs.
Definition adtfui_pkg.h:13