Media Controller
A GStreamer implementation using the VideoXpert SDK
MediaController::Rtsp::KeepAlive Class Reference

Manages the keep alive requests for a stream instance. More...

#include <RtspKeepAlive.h>

Classes

struct  ThreadInfo
 

Public Member Functions

 KeepAlive (Commands *commands)
 Constructor. More...
 
 ~KeepAlive ()
 Destructor. More...
 
void GetParamsLoop ()
 Make a GET_PARAMETERS method call to the associated stream. More...
 

Private Attributes

Commands_commands
 
std::unique_ptr< ThreadInfod_ptr
 

Detailed Description

Manages the keep alive requests for a stream instance.

Definition at line 12 of file RtspKeepAlive.h.

Constructor & Destructor Documentation

MediaController::Rtsp::KeepAlive::KeepAlive ( Commands commands)
explicit

Constructor.

Parameters
commandsThe Commands instance for the associated stream.

Definition at line 11 of file RtspKeepAlive.cpp.

11  : _commands(commands), d_ptr(new ThreadInfo()) {
12  d_ptr->_shutdownRequested = false;
13  d_ptr->_keepAliveThread = std::thread(&KeepAlive::GetParamsLoop, this);
14 }
std::unique_ptr< ThreadInfo > d_ptr
Definition: RtspKeepAlive.h:33
void GetParamsLoop()
Make a GET_PARAMETERS method call to the associated stream.
MediaController::Rtsp::KeepAlive::~KeepAlive ( )

Destructor.

Definition at line 16 of file RtspKeepAlive.cpp.

16  {
17  d_ptr->_shutdownRequested = true;
18  d_ptr->_keepAliveThread.join();
19 }
std::unique_ptr< ThreadInfo > d_ptr
Definition: RtspKeepAlive.h:33

Member Function Documentation

void MediaController::Rtsp::KeepAlive::GetParamsLoop ( )

Make a GET_PARAMETERS method call to the associated stream.

Definition at line 21 of file RtspKeepAlive.cpp.

21  {
22  int _count = 0;
23  while (!d_ptr->_shutdownRequested) {
24  if (_count < Constants::kKeepAliveRefreshSec) {
25  ++_count;
26  }
27  else {
29  _count = 0;
30  }
31  std::this_thread::sleep_for(std::chrono::seconds(1));
32  }
33 }
std::unique_ptr< ThreadInfo > d_ptr
Definition: RtspKeepAlive.h:33
bool GetParameter()
Send the GET_PARAMETER method and read the server response.
static const unsigned short kKeepAliveRefreshSec
Definition: Constants.h:13

Member Data Documentation

Commands* MediaController::Rtsp::KeepAlive::_commands
private

Definition at line 32 of file RtspKeepAlive.h.

std::unique_ptr<ThreadInfo> MediaController::Rtsp::KeepAlive::d_ptr
private

Definition at line 33 of file RtspKeepAlive.h.


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