#include "sdl_display.h"
cSDLVideoSink);
cSDLVideoSink::cSDLVideoSink()
{
SetDescription("Use this Streaming Sink to visualize data based on a simple SDL Application.");
SetHelpLink("$(ADTF_DIR)/doc/html/page_demo_sdl_display.html");
}
tResult cSDLVideoSink::RequestDynamicInputPin(
const char *strName,
const iobject_ptr<const IStreamType> &pType)
{
if (m_pReader)
{
}
m_pReader = CreateInputPin<cSingleSampleReader>(strName, pType, false, false);
if (pType.Get())
{
}
{
});
}
{
object_ptr<ISDLApplication> pApp;
return pApp->RegisterSDLDrawer(*this);
}
{
object_ptr<ISDLApplication> pApp;
pApp->UnregisterSDLDrawer(*this);
return cSampleStreamingSink::Shutdown();
}
tResult cSDLVideoSink::OnPaint(ISDLApplication::ISDLCanvas& oCanvas)
{
object_ptr<const ISample> pSample;
if (
IS_OK(m_pReader->GetLastSample(pSample)))
{
object_ptr_shared_locked<const ISampleBuffer> pBuffer;
RETURN_IF_FAILED(oCanvas.DrawImage(m_sCurrentFormat, pBuffer->GetPtr(), pBuffer->GetSize()));
}
}
#define ADTF_PLUGIN(__plugin_identifier,...)
The ADTF Plugin Macro will add the code of a adtf::ucom::ant::IPlugin implementation.
#define RETURN_ERROR_DESC(_code,...)
Same as RETURN_ERROR(_error) using a printf like parameter list for detailed error description.
#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.
#define IS_OK(s)
Check if result is OK.
virtual tResult GetObject(iobject_ptr< IObject > &pObject, const char *strNameOID) const =0
Get registered object from object registry.
virtual T * Get() const =0
Get raw pointer to shared object.
Base object pointer to realize binary compatible reference counting in interface methods.
tResult get_stream_type_image_format(tStreamImageFormat &oFormat, const IStreamType &oType)
Helper function to retrieve the oFormat (tStreamImageFormat) out of the of a IStreamType for a stream...
adtf::ucom::IRuntime * _runtime
Global Runtime Pointer to reference to the current runtime.