TobiiGlasses2SDK
Public Member Functions
Streamer Class Reference

Streamer handles the video streaming input. More...

#include <Streamer.h>

List of all members.

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

Detailed Description

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 ?


Member Function Documentation

void Streamer::configureSrcSockFD ( int  sockfd)

configureSrcSockFD

Will set the udp socket file descriptor to the udpsrc from the GStreamer pipeline.

Parameters:
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.

Parameters:
argc: number of program arguments
argv: pointer to the program arguments

isRunning

check if Streamer is running.

Returns:
true if Streamer is running, false if not
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.

Parameters:
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.

Parameters:
pipeline: GStreamer pipeline
Returns:
1 if success, 0 if not
void Streamer::setVideoCallback ( std::function< void(cv::Mat &, const int64_t) >  func)

setVideoCallback

Will set the video callback.

Parameters:
func: the function that will be called once the video frames are received.
void Streamer::stop ( )

stop

Will stop the GStreamer main_loop.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables