|
TobiiGlasses2SDK
|
Streamer handles the video streaming input. More...
#include <Streamer.h>
Public Member Functions | |
| Streamer () | |
| Streamer constructor. | |
| ~Streamer () | |
| Streamer destructor. | |
| void | init (int argc, char **argv) |
| Streamer init. | |
| int | setupPipeline (const std::string &pipeline) |
| setupPipeline | |
| void | configureSrcSockFD (int sockfd) |
| configureSrcSockFD | |
| void | setVideoCallback (std::function< void(cv::Mat &, const int64_t) >) |
| setVideoCallback | |
| void | setOnFrameArrived (std::function< void(const int64_t, cv::Mat &) > func) |
| setOnFrameArrived | |
| void | run () |
| run | |
| void | runCV () |
| runCV | |
| void | stop () |
| stop | |
| bool | isRunning () |
| isRunning | |
Streamer handles the video streaming input.
It is working with GStreamer and OpenCV. GStreamer will take data information from the pipeline. And call the video callback with the information filled. The pipeline must finish with appsink sink. improve class data, can we remove the struct and use the class instead ?
| void Streamer::configureSrcSockFD | ( | int | sockfd | ) |
configureSrcSockFD
Will set the udp socket file descriptor to the udpsrc from the GStreamer pipeline.
| sockfd | : socket file descriptor to use |
| void Streamer::init | ( | int | argc, |
| char ** | argv | ||
| ) |
Streamer init.
init will setup gstreamer and the class instance. argc and argv are used by GStreamer for initialisation.
| argc | : number of program arguments |
| argv | : pointer to the program arguments |
| bool Streamer::isRunning | ( | ) |
| void Streamer::run | ( | ) |
run
run is the method that will handle the GStreamer main loop. Call it if you want to see the streaming in a screen window.
| void Streamer::runCV | ( | ) |
runCV
runCV is the method that will handle the GStreamer main loop. Call it if you want to use the frames in the buffer. Only this method will invoke the video callback.
| void Streamer::setOnFrameArrived | ( | std::function< void(const int64_t, cv::Mat &) > | func | ) |
setOnFrameArrived
Will set another video callback.
| func | : the function that will be called once the video frames are received. |
| int Streamer::setupPipeline | ( | const std::string & | pipeline | ) |
setupPipeline
Will set the pipeline passed as argument and launch the GStreamer parsing.
| pipeline | : GStreamer pipeline |
| void Streamer::setVideoCallback | ( | std::function< void(cv::Mat &, const int64_t) > | func | ) |
setVideoCallback
Will set the video callback.
| func | : the function that will be called once the video frames are received. |
| void Streamer::stop | ( | ) |
stop
Will stop the GStreamer main_loop.
1.7.6.1