#include "demo_md_data_generator.h"
cMediaDescriptionDataGenerator);
cMediaDescriptionDataGenerator::cMediaDescriptionDataGenerator():
m_oDistribution(0.0, 100.0)
{
m_pWriter = CreateOutputPin<encoding_sample_writer<>>("data");
SetDescription("data", "Provides the generated data based on the configured media description structure");
SetDescription("data_generator_function", "Runner to periodically trigger the function which generates the output samples");
m_strMediaDescriptionStructName.SetDescription("The name of the DDL structure to generate.");
RegisterPropertyVariable("data_generator_function/media_description_struct_name", m_strMediaDescriptionStructName);
SetDescription("Use this filter to generate random values for a specified Media Description structure configured by property 'media_description_struct_name'.");
SetHelpLink("$(ADTF_DIR)/doc/adtf_html/page_demo_md_data_generator_filter.html");
}
tResult cMediaDescriptionDataGenerator::Init(tInitStage eStage)
{
if (eStage == StageNormal)
{
}
}
tResult cMediaDescriptionDataGenerator::Process(tNanoSeconds tmTimeOfTrigger,
IRunner* )
{
double fRandomValue = m_oDistribution(m_oRandomGenerator);
auto oSample = m_pWriter->MakeSample(tmTimeOfTrigger);
[&fRandomValue](auto& oElement) {
oElement.setValue(fRandomValue);
});
m_pWriter->Write(oSample);
}
#define ADTF_PLUGIN(__plugin_identifier,...)
The ADTF Plugin Macro will add the code of a adtf::ucom::ant::IPlugin implementation.
#define RETURN_IF_FAILED(s)
Return if expression is failed, which requires the calling function's return type to be tResult.
#define RETURN_NOERROR
Return status ERR_NOERROR, which requires the calling function's return type to be tResult.
Object pointer implementation used for reference counting on objects of type IObject.
std::chrono::seconds seconds
Compatibility to C++11 std::chrono::seconds