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 <adtfbase/macroresolver_intf.h>
16#include <adtfstreaming3/streamtype_intf.h>
17#include <adtfstreaming3/streammetatypesubstreams.h>
18#include <adtfmediadescription/type_reflection.h>
19#include <QJSEngine>
20
21namespace adtf
22{
23
24namespace javascript
25{
26
27namespace scripting
28{
29
33class cScriptStructure : public QObject, public ddl::DDStructure
34{
35 Q_OBJECT
36
37public:
39 cScriptStructure(const QString& strStructName, QJSEngine& oEngine);
41
53 Q_INVOKABLE QObject* add(const QString& strElementName, const QJSValue& oElementType, quint64 nArraySize = 1);
54
55private:
56 QJSEngine& m_oEngine;
57};
58
62class cStreamTypeWrapper : public QObject
63{
64 Q_OBJECT
65public:
67 cStreamTypeWrapper(ucom::object_ptr<adtf::streaming::IStreamType> pType, QJSEngine& oEngine);
68 ucom::object_ptr<const adtf::streaming::IStreamType> getType() const;
69 QString getStreamMetaType() const;
70 QVariantMap getProperties() const;
72
74 Q_PROPERTY(QVariantMap properties READ getProperties)
76 Q_PROPERTY(QString stream_meta_type READ getStreamMetaType)
82 Q_INVOKABLE void setProperty(const QString& strName, const QJSValue& oValue);
83
92 Q_INVOKABLE QList<QString> getSubStreams();
93
103 Q_INVOKABLE QObject* getSubStreamType(const QString& strSubStream);
104
105private:
106 ucom::object_ptr<adtf::streaming::IStreamType> m_pType;
107 QJSEngine& m_oEngine;
108};
109
113
114class cSubStreamsTypeWrapper : public QObject
115{
116 Q_OBJECT
117public:
119 cSubStreamsTypeWrapper(QJSEngine& oEngine);
120 ucom::object_ptr<const adtf::streaming::IStreamType> getType() const;
122
129 Q_INVOKABLE void setSubStream(const QString& strName, quint32 nSubStreamId, const QJSValue& oStreamType);
130
131private:
132 streaming::hollow::cSubStreamTypes m_oSubStreams;
133 QJSEngine& m_oEngine;
134};
135
139class cScriptTypes : public QObject
140{
141 Q_OBJECT
142
143public:
145 cScriptTypes(QJSEngine& oEngine,
146 const adtf::util::cFilepath& strScriptFolder,
147 const ucom::iobject_ptr<adtf::services::ant::IMacroResolver>& pMacroResolver);
149
159 Q_INVOKABLE QObject* createDefinition(const QString& strStructName);
160
170 Q_INVOKABLE QObject* getDefinition(const QString& strStructName);
171
182 Q_INVOKABLE QObject* createStreamType(const QString& strMetaType);
183
194 Q_INVOKABLE QObject* createPlainStreamType(const QString& strCType);
195
203 Q_INVOKABLE QObject* createSubStreamsType();
204
218 Q_INVOKABLE QObject*
219 fromDescriptionFile(const QString& strStructName, const QString& strFileName, bool bResolveStruct = true);
220
233 Q_INVOKABLE QObject* fromDescriptionString(const QString& strStructName,
234 const QString& strMediaDescription,
235 bool bResolveStruct = true);
236
237private:
238 QJSEngine& m_oEngine;
239 adtf::util::cFilepath m_strScriptFolder;
240 ucom::weak_object_ptr<adtf::services::ant::IMacroResolver> m_pMacroResolver;
241};
242
244ucom::object_ptr<const adtf::streaming::IStreamType> get_stream_type(const QJSValue& oStreamType);
246
247} // namespace scripting
248} // namespace javascript
249} // 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:74
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:76
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