Pipeline class definition.
Pipelie class provide the high level interface for most of the functionalities. It is recommended to use Pipeline API for creating applications unless there is some specific features that are only supported in lower level APIs from Element, Object, etc.
Definition at line 46 of file pipeline.hpp.
Data Structures | |
class | DynamicSourceMessage |
Pipeline message on source add/remove. More... | |
class | EOSMessage |
Pipeline message on EOS. More... | |
class | Message |
base class for pipeline message More... | |
class | StateTransitionMessage |
Pipeline message on state transition. More... | |
Public Types | |
enum | State { INVALID, EMPTY, READY, PAUSED, PLAYING } |
Public Member Functions | |
Pipeline (const char *name) | |
Pipeline (const char *name, const std::string &config_file) | |
Constructor with name and a description file. More... | |
virtual | ~Pipeline () |
Destructor. More... | |
template<typename... Args> | |
Pipeline & | add (const std::string &element_type, const std::string &element_name, const Args &... args) |
Template function for creating and adding element with properties. More... | |
Pipeline & | add (Element element) |
Add a given element to the pipeline. More... | |
Element * | find (const ::std::string &name) |
Find an element within the pipeline by name. More... | |
Element & | operator[] (const std::string &name) |
Operator for accessing elements in a pipeline. More... | |
Pipeline & | link (std::pair< std::string, std::string > route, std::pair< std::string, std::string > tips) |
Link two elements within the pipeline. More... | |
template<typename... Args> | |
Pipeline & | link (const std::string &arg1, const std::string arg2, const Args &...args) |
Template function for linking elements in the simplest way. More... | |
Pipeline & | attach (const std::string &elmenent_name, CustomObject *object, const std::string tip="") |
Attach a custom object to an element within the pipeline. More... | |
Pipeline & | attach (const std::string &element_name, const std::string &plugin_name, const std::string &object_name, const std::string tip="") |
Create and attach a custom object to an element within the pipeline. More... | |
template<typename... Args> | |
Pipeline & | attach (const std::string &element_name, const std::string &plugin_name, const std::string &object_name, const std::string tip, const Args &... args) |
Template function for creating and attaching custom object with properties. More... | |
Pipeline & | install (std::function< void(Pipeline &, int key)> keyboard_listener) |
install a callback to capture keyboard events More... | |
int | prepare () |
Intialize the pipeline. More... | |
int | prepare (std::function< void(Pipeline &, const Message &)> listener) |
Intialize the pipeline with a callback to capture the messages. More... | |
Pipeline & | start () |
Start the pipeline. More... | |
Pipeline & | start (std::function< void(Pipeline &, const Message &)> listener) |
Start the pipeline with a callback to capture the messages. More... | |
Pipeline & | activate () |
Start the pipeline after it is already intialized. More... | |
Pipeline & | wait () |
Wait until the pipeline ends. More... | |
Pipeline & | stop () |
Stop the pipeline. More... | |
bool | isRunning () const |
Pipeline & | pause () |
Pause the pipeline. More... | |
Pipeline & | resume () |
Resume the pipeline. More... | |
Pipeline & | seek (uint64_t timestamp) |
Seek to a specified position for processing data within the pipeline. More... | |
uint32_t | startRTSP (uint16_t rtsp_port, uint16_t udp_port, uint32_t buffer_size=0) |
Start an RTSP server. More... | |
void | handleKey (int key) |
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 object's type id. More... | |
Protected Member Functions | |
int | run () |
int | run_after_prepare () |
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 | |
void * | loop_ = NULL |
uint | bus_watch_id_ = 0 |
void * | bus_data_ = NULL |
std::function< void(Pipeline &, int key)> | keyboard_listener_ |
std::thread | thread_ |
std::map< std::string, Element > | elements_ |
std::map< std::string, std::unique_ptr< SignalEmitter > > | action_owners_ |
uint64_t | start_pts_ = 0 |
GstObject * | object_ |
Enumerator | |
---|---|
INVALID | |
EMPTY | |
READY | |
PAUSED | |
PLAYING |
Definition at line 49 of file pipeline.hpp.
deepstream::Pipeline::Pipeline | ( | const char * | name | ) |
deepstream::Pipeline::Pipeline | ( | const char * | name, |
const std::string & | config_file | ||
) |
Constructor with name and a description file.
|
virtual |
Destructor.
Pipeline& deepstream::Pipeline::activate | ( | ) |
Start the pipeline after it is already intialized.
|
inline |
Template function for creating and adding element with properties.
Definition at line 129 of file pipeline.hpp.
References deepstream::Object::Element, and deepstream::Object::set().
|
inline |
Template function for creating and attaching custom object with properties.
Definition at line 206 of file pipeline.hpp.
References attach().
Pipeline& deepstream::Pipeline::attach | ( | const std::string & | element_name, |
const std::string & | plugin_name, | ||
const std::string & | object_name, | ||
const std::string | tip = "" |
||
) |
Create and attach a custom object to an element within the pipeline.
Supported custom objects can be buffer probes, signal handlers The custom object will be created through factory
[in] | element_name | name of the elment to which the object attaches |
[in] | plugin_name | name of the plugin where the custom object factory is defined |
[in] | object_name | name of the new custome object |
[in] | tips | extra information. pad name for buffer probes, signal name for signal handlers |
Pipeline& deepstream::Pipeline::attach | ( | const std::string & | elmenent_name, |
CustomObject * | object, | ||
const std::string | tip = "" |
||
) |
Attach a custom object to an element within the pipeline.
Supported custom objects can be buffer probes, signal handlers Once the object is attached, the element takes the ownership of it
[in] | element_name | name of the elment to which the object attaches |
[in] | object | pointer to a custom object |
[in] | tips | extra information. pad name for buffer probes, signal name for signal handlers |
Referenced by attach().
|
inherited |
Connect a signal handler to the object.
[in] | signal_name | name of the signal to be connected |
[in] | handler | handler for the signal |
|
inherited |
Emit a signal.
Element* deepstream::Pipeline::find | ( | const ::std::string & | name | ) |
Find an element within the pipeline by name.
Referenced by operator[]().
|
protectedvirtualinherited |
Reimplemented in deepstream::CustomObject.
Referenced by deepstream::Object::getProperty().
|
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.
void deepstream::Pipeline::handleKey | ( | int | key | ) |
|
inline |
install a callback to capture keyboard events
Definition at line 225 of file pipeline.hpp.
References keyboard_listener_.
bool deepstream::Pipeline::isRunning | ( | ) | const |
|
inline |
Template function for linking elements in the simplest way.
Definition at line 165 of file pipeline.hpp.
References link().
Pipeline& deepstream::Pipeline::link | ( | std::pair< std::string, std::string > | route, |
std::pair< std::string, std::string > | tips | ||
) |
Link two elements within the pipeline.
[in] | route | a pair with source element name and target element name |
[in] | tips | extra pair with source pad name and target pad name |
Referenced by link().
|
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_.
|
inline |
Operator for accessing elements in a pipeline.
Definition at line 144 of file pipeline.hpp.
References find().
Pipeline& deepstream::Pipeline::pause | ( | ) |
Pause the pipeline.
int deepstream::Pipeline::prepare | ( | ) |
Intialize the pipeline.
Intialize the pipeline with a callback to capture the messages.
Pipeline& deepstream::Pipeline::resume | ( | ) |
Resume the pipeline.
|
protected |
|
protected |
Pipeline& deepstream::Pipeline::seek | ( | uint64_t | timestamp | ) |
Seek to a specified position for processing data within the pipeline.
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 add(), and deepstream::Object::set().
|
protectedvirtualinherited |
Reimplemented in deepstream::CustomObject.
Referenced by deepstream::Object::set().
|
protectedvirtualinherited |
Reimplemented in deepstream::CustomObject.
Pipeline& deepstream::Pipeline::start | ( | ) |
Start the pipeline.
Start the pipeline with a callback to capture the messages.
uint32_t deepstream::Pipeline::startRTSP | ( | uint16_t | rtsp_port, |
uint16_t | udp_port, | ||
uint32_t | buffer_size = 0 |
||
) |
Start an RTSP server.
Pipeline& deepstream::Pipeline::stop | ( | ) |
Stop the pipeline.
Takes the ownership of a object through the opaque pointer.
|
staticinherited |
Return the object's type id.
Pipeline& deepstream::Pipeline::wait | ( | ) |
Wait until the pipeline ends.
|
protected |
Definition at line 278 of file pipeline.hpp.
|
protected |
Definition at line 270 of file pipeline.hpp.
|
protected |
Definition at line 268 of file pipeline.hpp.
|
protected |
Definition at line 276 of file pipeline.hpp.
|
protected |
Definition at line 271 of file pipeline.hpp.
Referenced by install().
|
protected |
Definition at line 266 of file pipeline.hpp.
|
protectedinherited |
Definition at line 198 of file object.hpp.
Referenced by deepstream::Object::getGObject(), deepstream::Object::operator bool(), and deepstream::Object::operator==().
|
protected |
Definition at line 280 of file pipeline.hpp.
|
protected |
Definition at line 274 of file pipeline.hpp.