ADTF  3.18.2
builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/javascriptfiltersdk/src/writer.h
Go to the documentation of this file.
1 
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>
16 #include <QJSValue>
17 #include <QJSValueIterator>
18 #include <QJSEngine>
19 #include <unordered_map>
20 #include <string>
21 
22 namespace adtf
23 {
24 
25 namespace javascript
26 {
27 
28 namespace scripting
29 {
30 
34 class cScriptWriter: public QObject
35 {
36  Q_OBJECT
37 
38  public:
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 
77  private:
78  void OnNewType(const adtf::streaming::IStreamType& oType);
79  void FillSampleViaDDL(adtf::streaming::ISample& oSample,
81  const QJSValue& oValue);
82  void FillSampleWithByteArray(adtf::streaming::ISample& oSample, const QByteArray& oArray);
83 
84  private:
86  QJSEngine& m_oEngine;
87 
88  struct tSubStream
89  {
90  uint32_t nId;
92  };
93 
94  std::unordered_map<std::string, tSubStream> m_oSubStreams;
95 
97 };
98 
99 }
100 }
101 }
Copyright © Audi Electronics Venture GmbH.
Q_INVOKABLE void writeSubStream(qint64 tmTimeStamp, const QString &strSubStream, const QJSValue &oValue)
Writes a new sample with a given substream id to the connected Sample Stream.
Q_INVOKABLE void manualTrigger()
Trigger all child runners manually.
Q_INVOKABLE void changeType(const QJSValue &oStreamType)
Changes the type of the output stream.
Q_INVOKABLE void write(qint64 tmTimeStamp, const QJSValue &oValue)
Writes a new sample to the connected Sample Stream.
Factory class for ddl codecs for samples.
Definition: sample_codec.h:946
The ISample interface sets and retrieves properties on samples .
Definition: sample_intf.h:35
Defines access methods for the interface of a Stream Type - see also Stream Type and Stream Meta Type...
Interface for sample writers that write to sample streams via output pins.
Namespace for entire ADTF SDK.
Copyright © Audi Electronics Venture GmbH.
Copyright © Audi Electronics Venture GmbH.