A specific signal handler for feeding data.
Users must implement the IDataProvider interface to create a data feeder. Data feeder can only be attached to elements that supports "need-data/enough-data" signal, typically an "appsrc".
Definition at line 39 of file data_feeder.hpp.
Data Structures | |
class | IDataProvider |
required interface for a data feeder More... | |
Public Member Functions | |
DataFeeder (const std::string &name, IDataProvider *provider) | |
Constructor. More... | |
DataFeeder (const std::string &name, const char *factory, IDataProvider *provider) | |
Constructor. More... | |
virtual | ~DataFeeder () |
Destructor. More... | |
void | startFeed (void *appsrc, unsigned int size) |
Start feeding, called by the pipeline. More... | |
void | stopFeed () |
Stop feeding, called by the pipeline. More... | |
bool | doFeed (void *appsrc, unsigned int size) |
Complete the feeding, called by the feeding thread. More... | |
void * | getCallbackFn (const std::string &name) const |
Return the callback for a specific signal. More... | |
const std::string | getName () const |
Return the name assigned during the construction. More... | |
operator bool () const noexcept | |
Check if the object is void. More... | |
bool | operator== (const Object &other) noexcept |
Check if the two objects are the same. More... | |
GstObject * | give () |
Give up the ownership and return the opaque pointer. More... | |
GstObject * | getGObject () |
Return the opaque object pointer. More... | |
Object & | take (GstObject *object) |
Takes the ownership of a object through the opaque pointer. More... | |
Object & | seize (GstObject *object) |
Seize a opaque object to prevent it from being destroyed somewhere. More... | |
Object & | set (const YAML::Node ¶ms) |
Set the properties from key/value pairs in the yaml format. More... | |
Object & | set (const std::string &name, const Value &value) |
template<typename T , typename... Args> | |
Object & | set (const std::string &name, const T &value, const Args &... args) |
template<typename T , typename... Args> | |
Object & | getProperty (const std::string &name, T &value, Args &... args) |
Template for getting multiple properties. More... | |
std::vector< std::string > | listSignals (bool is_action) |
List all the supported signals from the object. More... | |
bool | connectSignal (const std::string &signal_name, SignalHandler &handler) |
Connect a signal handler to the object. More... | |
void | emitSignal (const std::string &signal_name, va_list args) |
Emit a signal. More... | |
Static Public Member Functions | |
static unsigned long | type () |
Return the type id assigned to signal handler. More... | |
Protected Member Functions | |
virtual void | set_ (const std::string &name, const Value &value) |
virtual void | set_ (const std::string &name, const YAML::Node &value) |
virtual Value | get_ (const std::string &name) |
Protected Attributes | |
std::unique_ptr< IDataProvider > | data_provider_ |
std::thread | worker_ |
std::mutex | mutex_ |
std::condition_variable | cv_data_ |
unsigned int | data_size_ |
bool | data_ready_ |
void * | appsrc_ |
bool | eos_ |
std::unique_ptr< IActionProvider > | provider_ |
std::string | param_spec_ |
property spec in YAML format More... | |
std::map< std::string, Object::Value > | properties_ |
property map More... | |
GstObject * | object_ |
deepstream::DataFeeder::DataFeeder | ( | const std::string & | name, |
IDataProvider * | provider | ||
) |
Constructor.
Create a data feeder with a user implemented data provider interface
[in] | name | name of the instance |
[in] | handler | implementation of the IDataProvider interface |
deepstream::DataFeeder::DataFeeder | ( | const std::string & | name, |
const char * | factory, | ||
IDataProvider * | provider | ||
) |
Constructor.
Create a data feeder with a user implemented data provider interface
[in] | name | name of the instance |
[in] | factory | name of the factory to create the instance |
[in] | handler | implementation of the IDataProvider interface |
|
virtual |
Destructor.
|
inherited |
Connect a signal handler to the object.
[in] | signal_name | name of the signal to be connected |
[in] | handler | handler for the signal |
bool deepstream::DataFeeder::doFeed | ( | void * | appsrc, |
unsigned int | size | ||
) |
Complete the feeding, called by the feeding thread.
|
inherited |
Emit a signal.
|
protectedvirtualinherited |
Reimplemented from deepstream::Object.
|
inherited |
Return the callback for a specific signal.
|
inlineinherited |
Return the opaque object pointer.
Definition at line 140 of file object.hpp.
References deepstream::Object::object_.
|
inherited |
Return the name assigned during the construction.
|
inlineinherited |
Template for getting multiple properties.
Definition at line 171 of file object.hpp.
References deepstream::Object::get_().
Referenced by deepstream::CountMarker::handleData(), deepstream::TensorMetaParser::handleData(), deepstream::MsgMetaGenerator::handleData(), deepstream::NvDsKittiDump::handleData(), deepstream::LiDARDataSource::initialize(), deepstream::SmartRecordingAction::onAttached(), and deepstream::FileDataSource::read().
|
inherited |
Give up the ownership and return the opaque pointer.
|
inherited |
List all the supported signals from the object.
|
inlineexplicitnoexceptinherited |
Check if the object is void.
Definition at line 131 of file object.hpp.
References deepstream::Object::object_.
|
inlinenoexceptinherited |
Check if the two objects are the same.
Definition at line 134 of file object.hpp.
References deepstream::Object::object_.
Seize a opaque object to prevent it from being destroyed somewhere.
|
inlineinherited |
Definition at line 161 of file object.hpp.
References deepstream::Object::set(), and deepstream::Object::set_().
Definition at line 154 of file object.hpp.
References deepstream::Object::set_().
|
inherited |
Set the properties from key/value pairs in the yaml format.
Referenced by deepstream::Pipeline::add(), and deepstream::Object::set().
|
protectedvirtualinherited |
Reimplemented from deepstream::Object.
|
protectedvirtualinherited |
Reimplemented from deepstream::Object.
void deepstream::DataFeeder::startFeed | ( | void * | appsrc, |
unsigned int | size | ||
) |
Start feeding, called by the pipeline.
void deepstream::DataFeeder::stopFeed | ( | ) |
Stop feeding, called by the pipeline.
Takes the ownership of a object through the opaque pointer.
|
staticinherited |
Return the type id assigned to signal handler.
|
protected |
Definition at line 102 of file data_feeder.hpp.
|
protected |
Definition at line 99 of file data_feeder.hpp.
|
protected |
Definition at line 96 of file data_feeder.hpp.
|
protected |
Definition at line 101 of file data_feeder.hpp.
|
protected |
Definition at line 100 of file data_feeder.hpp.
|
protected |
Definition at line 103 of file data_feeder.hpp.
|
protected |
Definition at line 98 of file data_feeder.hpp.
|
protectedinherited |
Definition at line 198 of file object.hpp.
Referenced by deepstream::Object::getGObject(), deepstream::Object::operator bool(), and deepstream::Object::operator==().
|
protectedinherited |
property spec in YAML format
Definition at line 51 of file custom_object.hpp.
|
protectedinherited |
property map
Definition at line 53 of file custom_object.hpp.
|
protectedinherited |
Definition at line 91 of file signal_handler.hpp.
|
protected |
Definition at line 97 of file data_feeder.hpp.