NVIDIA DeepStream SDK API Reference

6.4 Release
ds3d::GuardDataMixer Class Reference

Detailed Description

GuardDataMixer is the safe access entry for abiDataMixer.

Applications can use it to make C-based APIs safer. it would manage abiRefDataMixer automatically. with that, App user do not need to refCopy_i or destroy abiRefDataMixer manually.

For example: abiRefDataMixer* rawRef = creator(); GuardDataMixer guardMixer(rawRef, true); // take the ownership of rawRef guardMixer.setUserData(userdata, [](void*){ ...free... }); guardMixer.setErrorCallback([](ErrCode c, const char* msg){ stderr << msg; }); ErrCode c = guardMixer.start(config, path); DS_ASSERT(isGood(c)); c = guardMixer.start(config, path); // invoke abiDataMixer::start_i(...) GuardDataMap inputData = ...; // prepare input data // invoke abiDataMixer::process_i(...) c = guardMixer.process(inputData, [](ErrCode c, const abiRefDataMap* d){ GuardDataMap outputData(<em>d); // output data processing std::cout << "output data processing starts" << std::endl; }, [](ErrCode c, const abiRefDataMap d){ GuardDataMap doneData(*d); std::cout << "input data consumed" << std::endl; }); DS_ASSERT(isGood(c)); //... wait for all data processed before stop c = guardMixer.flush(); c = guardMixer.stop(); // invoke abiDataMixer::stop_i(...) guardMixer.reset(); // destroy abiRefDataMixer, when all reference // destroyed, abiDataMixer would be freed.

Definition at line 55 of file datamixer.hpp.

Inheritance diagram for ds3d::GuardDataMixer:
Collaboration diagram for ds3d::GuardDataMixer:

Public Types

using abiRefType = abiRefT< abiDataMixer >
 

Public Member Functions

template<typename... Args>
 GuardDataMixer (Args &&... args)
 
 ~GuardDataMixer ()=default
 
ErrCode process (const int portId, GuardDataMap datamap, abiOnDataCB::CppFunc inputConsumedCB)
 
ErrCode setOutputCb (abiOnDataCB::CppFunc outputDataCB)
 
ErrCode updateInput (int portId, MixerUpdate updateType)
 
void setUserData (void *data, DelF delF)
 
virtual void * getUserData () const
 
void setErrorCallback (abiErrorCB::CppFunc errCb)
 
ErrCode start (const std::string &content, const std::string &path="")
 
ErrCode flush ()
 
ErrCode stop ()
 
State state () const
 
std::string getCaps (CapsPort port)
 
std::string getOutputCaps ()
 
std::string getInputCaps ()
 
GuardTy cast ()
 
abiDataMixerptr () const
 
abiDataMixeroperator-> () const
 
 operator bool () const
 
 operator ShrdPtr< abiDataMixer > ()
 
abiRefT< abiDataMixer > * release ()
 
void reset (abiRefT< abiDataMixer > *abiref=nullptr)
 
abiRefT< abiDataMixer > * abiRef () const
 

Member Typedef Documentation

◆ abiRefType

Definition at line 333 of file obj.hpp.

Constructor & Destructor Documentation

◆ GuardDataMixer()

template<typename... Args>
ds3d::GuardDataMixer::GuardDataMixer ( Args &&...  args)
inline

Definition at line 60 of file datamixer.hpp.

◆ ~GuardDataMixer()

ds3d::GuardDataMixer::~GuardDataMixer ( )
default

Member Function Documentation

◆ abiRef()

abiRefT< abiDataMixer > * ds3d::GuardRef< abiRefT< abiDataMixer > , >::abiRef
inlineinherited

Definition at line 269 of file obj.hpp.

◆ cast()

GuardTy ds3d::GuardDataT< abiDataMixer >::cast
inlineinherited

Definition at line 356 of file obj.hpp.

◆ flush()

ErrCode ds3d::GuardDataProcess< abiDataMixer , >::flush
inlineinherited

Definition at line 76 of file dataprocess.hpp.

◆ getCaps()

std::string ds3d::GuardDataProcess< abiDataMixer , >::getCaps ( CapsPort  port)
inlineinherited

Definition at line 94 of file dataprocess.hpp.

◆ getInputCaps()

std::string ds3d::GuardDataProcess< abiDataMixer , >::getInputCaps
inlineinherited

Definition at line 101 of file dataprocess.hpp.

◆ getOutputCaps()

std::string ds3d::GuardDataProcess< abiDataMixer , >::getOutputCaps
inlineinherited

Definition at line 100 of file dataprocess.hpp.

◆ getUserData()

virtual void* ds3d::GuardDataProcess< abiDataMixer , >::getUserData
inlinevirtualinherited

Definition at line 55 of file dataprocess.hpp.

◆ operator bool()

ds3d::GuardDataT< abiDataMixer >::operator bool
inlineinherited

Definition at line 370 of file obj.hpp.

◆ operator ShrdPtr< abiDataMixer >()

ds3d::GuardDataT< abiDataMixer >::operator ShrdPtr< abiDataMixer >
inlineinherited

Definition at line 372 of file obj.hpp.

◆ operator->()

abiDataMixer * ds3d::GuardDataT< abiDataMixer >::operator->
inlineinherited

Definition at line 368 of file obj.hpp.

◆ process()

ErrCode ds3d::GuardDataMixer::process ( const int  portId,
GuardDataMap  datamap,
abiOnDataCB::CppFunc  inputConsumedCB 
)
inline

◆ ptr()

abiDataMixer * ds3d::GuardDataT< abiDataMixer >::ptr
inlineinherited

Definition at line 361 of file obj.hpp.

◆ release()

abiRefT< abiDataMixer > * ds3d::GuardRef< abiRefT< abiDataMixer > , >::release
inlineinherited

Definition at line 253 of file obj.hpp.

◆ reset()

void ds3d::GuardRef< abiRefT< abiDataMixer > , >::reset ( abiRefT< abiDataMixer > *  abiref = nullptr)
inlineinherited

Definition at line 260 of file obj.hpp.

◆ setErrorCallback()

void ds3d::GuardDataProcess< abiDataMixer , >::setErrorCallback ( abiErrorCB::CppFunc  errCb)
inlineinherited

Definition at line 62 of file dataprocess.hpp.

◆ setOutputCb()

◆ setUserData()

void ds3d::GuardDataProcess< abiDataMixer , >::setUserData ( void *  data,
DelF  delF 
)
inlineinherited

Definition at line 44 of file dataprocess.hpp.

◆ start()

ErrCode ds3d::GuardDataProcess< abiDataMixer , >::start ( const std::string &  content,
const std::string &  path = "" 
)
inlineinherited

Definition at line 70 of file dataprocess.hpp.

◆ state()

State ds3d::GuardDataProcess< abiDataMixer , >::state
inlineinherited

Definition at line 88 of file dataprocess.hpp.

◆ stop()

ErrCode ds3d::GuardDataProcess< abiDataMixer , >::stop
inlineinherited

Definition at line 82 of file dataprocess.hpp.

◆ updateInput()

ErrCode ds3d::GuardDataMixer::updateInput ( int  portId,
MixerUpdate  updateType 
)
inline

The documentation for this class was generated from the following file: