ADTF Qt5
Loading...
Searching...
No Matches
writer.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#include <adtf_utils.h>
14#include <adtfstreaming3/samplestreamer_intf.h>
15#include <adtfmediadescription/sample_codec.h>
16#include <QJSValue>
17#include <QJSValueIterator>
18#include <QJSEngine>
19#include <unordered_map>
20#include <string>
21
22namespace adtf
23{
24
25namespace javascript
26{
27
28namespace scripting
29{
30
34class cScriptWriter : public QObject
35{
36 Q_OBJECT
37
38public:
40 cScriptWriter(adtf::streaming::ISampleWriter* pWriter, QJSEngine& oEngine);
42
51 Q_INVOKABLE void write(qint64 tmTimeStamp, const QJSValue& oValue);
52
59 Q_INVOKABLE void writeSubStream(qint64 tmTimeStamp, const QString& strSubStream, const QJSValue& oValue);
60
68 Q_INVOKABLE void manualTrigger();
69
74 Q_INVOKABLE void changeType(const QJSValue& oStreamType);
75
77private:
78 void OnNewType(const adtf::streaming::IStreamType& oType);
79 void FillSampleViaDDL(adtf::streaming::ISample& oSample,
80 const adtf::mediadescription::cSampleCodecFactory& oFactory,
81 const QJSValue& oValue);
82 void FillSampleWithByteArray(adtf::streaming::ISample& oSample, const QByteArray& oArray);
83
84private:
85 adtf::streaming::ISampleWriter* m_pWriter;
86 QJSEngine& m_oEngine;
87
88 struct tSubStream
89 {
90 uint32_t nId;
91 adtf::mediadescription::cSampleCodecFactory oCodecFactory;
92 };
93
94 std::unordered_map<std::string, tSubStream> m_oSubStreams;
95
97};
98
99} // namespace scripting
100} // namespace javascript
101} // namespace adtf
Q_INVOKABLE void changeType(const QJSValue &oStreamType)
Q_INVOKABLE void writeSubStream(qint64 tmTimeStamp, const QString &strSubStream, const QJSValue &oValue)
Q_INVOKABLE void write(qint64 tmTimeStamp, const QJSValue &oValue)
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