ADTF  3.18.2
Source Code for Demo QML Property Filter Plugin
Location
./src/examples/src/adtf/filters/standard_filters/demo_qt_property_extension/
Namespace for entire ADTF SDK.
Build Environment
To see how to set up the build environment have a look at ADTF CMake Environment
this implementation shows:
  • how to use properties
Header
#ifndef _DEMO_POPERTY_QML_EXTENSION_FILTER_H_
#define _DEMO_POPERTY_QML_EXTENSION_FILTER_H_
//*************************************************************************************************
#define CID_DEMO_POPERTY_QML_EXTENSION "demo_qml_property.filter.adtf.cid"
using namespace adtf_util;
using namespace ddl;
using namespace adtf::ucom;
using namespace adtf::base;
using namespace adtf::streaming;
using namespace adtf::mediadescription;
using namespace adtf::filter;
class cSimpleFilter : public cFilter
{
public:
ADTF_CLASS_ID_NAME(cSimpleFilter,
CID_DEMO_POPERTY_QML_EXTENSION,
"Demo QML Property Filter");
cSimpleFilter();
virtual ~cSimpleFilter() = default;
tResult Process(tNanoSeconds tmTimeOfTrigger, IRunner* pRunner) override;
private:
property_variable<cFilename> m_propFilename;
property_variable<cFilenameList> m_propFilenameList;
property_variable<cFilepath> m_propFilepath;
};
//*************************************************************************************************
#endif // _DEMO_POPERTY_QML_EXTENSION_FILTER_H_
#define ADTF_CLASS_ID_NAME(_class, _strcid, _strclabel)
Common macro to enable correct treatment of class identifier AND Class Name by IClassInfo.
Definition: class_id.h:33
Namespace for the ADTF Base SDK.
Namespace for the ADTF Filter SDK.
Namespace for the ADTF Media Description SDK.
Namespace for the ADTF Streaming SDK.
Namespace for the ADTF uCOM3 SDK.
ADTF adtf_util Namespace - Within adtf this is used as adtf::util or adtf_util and also defined as A_...
Implementation
#include <adtf3.h>
#include <random>
#include "demo_property_extension.h"
#include <easy/profiler.h>
#include <sstream>
ADTF_PLUGIN("Demo Property Qml Extension Plugin", cSimpleFilter);
//CTOR of the TriggerFuntion
//This is to initialize the Trigger
cSimpleFilter::cSimpleFilter()
{
//Register Properties
m_propFilename.SetDescription("Select a single file.");
RegisterPropertyVariable("Filename", m_propFilename);
m_propFilenameList.SetDescription("Select a list of files.");
RegisterPropertyVariable("FilenameList", m_propFilenameList);
m_propFilepath.SetDescription("Select a directory.");
RegisterPropertyVariable("Filepath", m_propFilepath);
// sets a short description for the component
set_description(*this, "Use this filter to provide properties of type 'Filename', 'FilenameList' and 'Filepath'.");
// set help link to jump to documentation from ADTF Configuration Editor
set_help_link(*this, "$(ADTF_DIR)/doc/adtf_html/page_demo_qml_property_filter.html");
}
//this function will be executed each time a trigger occured on the configured timer
tResult cSimpleFilter::Process(tNanoSeconds tmTimeOfTrigger, IRunner* /*pRunner*/)
{
std::ostringstream stream;
stream << "Timestamp: ";
stream << tmTimeOfTrigger.nCount;
stream << " | ";
stream << "Filename: ";
stream << *m_propFilename;
stream << " | ";
stream << "FilenameList: ";
for (const auto &item : *m_propFilenameList)
{
stream << item;
stream << ", ";
}
stream << " | ";
stream << "Filepath: ";
stream << *m_propFilepath;
LOG_INFO("%s", stream.str().c_str());
}
Copyright © Audi Electronics Venture GmbH.
#define ADTF_PLUGIN(__plugin_identifier,...)
The ADTF Plugin Macro will add the code of a adtf::ucom::ant::IPlugin implementation.
Definition: adtf_plugin.h:22
#define RETURN_NOERROR
Return status ERR_NOERROR, which requires the calling function's return type to be tResult.
void set_description(base::ant::IConfiguration &oConfig, const char *strDescription)
Sets description information.
void set_help_link(base::ant::IConfiguration &oConfig, const char *strUrl)
Set the link to the corresponding help/documentation.