Shows how to access incoming substreams.
#include "substream_dumper_filter.h"
cDemoSubStreamDumper::cDemoSubStreamDumper()
{
SetDescription("Use this filter to dump data of all samples of all available substreams.");
SetHelpLink("$(ADTF_DIR)/doc/html/page_substream_dumper.html");
SetDescription("input", "Incoming data of substreams for printing.");
{
m_oRequests.clear();
{
object_ptr<IStreamingRequest> pRequest;
THROW_IF_FAILED(m_pReader->RequestSamples(pRequest, nSubStreamId));
m_oRequests.push_back(pRequest);
});
});
}
cDemoSubStreamDumper::~cDemoSubStreamDumper() = default;
{
{
auto pSubStreamType = stream_meta_type_substreams::GetSubStreamType(*pStreamType.Get(), strName);
cSampleCodecFactory oCodecFactory(pSubStreamType);
if (IS_OK(oCodecFactory.IsValid()))
{
m_oCodecFactories[nSubStreamId] = {oCodecFactory, strName};
}
});
}
{
if (itCodecFactory != m_oCodecFactories.end())
{
auto oDecoder = itCodecFactory->second.oCodecFactory.MakeDecoderFor(pSample);
LOG_INFO(
"Sample from %s:", itCodecFactory->second.strName.c_str());
DumpSample(oDecoder);
}
}
{
LOG_INFO("%s = %s",
oElement.getFullName().c_str(),
oElement.getStringValue().c_str());
});
}
ADTF_PLUGIN(
"Substream Dumper Plugin", cDemoSubStreamDumper);
#define ADTF_PLUGIN(__plugin_identifier,...)
Definition adtf_plugin.h:29
#define LOG_INFO(...)
Logs an info message.
Definition log.h:388
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
Definition result.h:736
#define RETURN_NOERROR
Return status ERR_NOERROR, which requires the calling function's return type to be tResult.
Definition result.h:29
virtual tResult AcceptType(streaming::flash::ISampleReader *pReader, const ucom::ant::iobject_ptr< const streaming::ant::IStreamType > &pType)
Definition samplestreamer_intf.h:188
virtual T * Get() const =0
Get raw pointer to shared object.
Namespace for the ADTF Base SDK.
Definition adtf_base_type_traits.h:13
Namespace for the ADTF Filter SDK.
Definition configurable_runner.h:18
Namespace for the ADTF Streaming SDK.
Definition bindingproxyinport.h:14
uint32_t get_sample_substream_id(const ant::ISample &oSample)
Namespace for the ADTF uCOM SDK.
Definition adtf_system.h:324
ant::iobject_ptr< T > iobject_ptr
Alias always bringing the latest version of ant::iobject_ptr into scope.
Definition object_ptr_intf.h:437
definition of the ddl namespace
Definition codec.h:21