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

Manages the GStreamer instance. More...

#include <GstWrapper.h>

Public Member Functions

 GstWrapper ()
 Constructor. More...
 
 ~GstWrapper ()
 Destructor. More...
 
void SetWindowHandle (guintptr winhandle)
 Set the display window using the given window handle. More...
 
void SetLocation (std::string location)
 Set the stream location. More...
 
void SetPorts (int rtpPort, int rtcpPort)
 Set the receiver ports. More...
 
void SetCaps (std::string caps, bool isMjpeg=false)
 Set the stream capabilities. More...
 
void SetCookie (std::string cookie)
 Set the cookie for MJPEG streams. More...
 
void SetRtcpHostIP (std::string hostIp)
 Set the RTCP host IP. More...
 
void SetMulticastAddress (std::string multicastAddress)
 Set the multicast group address. More...
 
void SetTimestamp (unsigned int seekTime)
 Set the internal timestamp variable. More...
 
unsigned int GetLastTimestamp () const
 Get the last timestamp received from the stream. More...
 
void SetMode (Controller::Mode mode)
 Set the playback mode. More...
 
Controller::Mode GetMode () const
 Get the current playback mode. More...
 
float GetSpeed () const
 Get the current playback speed. More...
 
bool IsPipelineActive () const
 Get the status of the pipeline. More...
 
void AddObserver (TimestampEventCallback observer)
 Add a new subscriber to timestamp events. More...
 
void RemoveObserver (TimestampEventCallback observer)
 Remove an existing timestamp event subscriber. More...
 
void ClearObservers ()
 Remove all existing timestamp event subscribers. More...
 
void AddEventData (void *customData)
 Add custom data to be stored in here, which will be send back to caller inside TimestampEvent on TimestampEventCallback. More...
 
void CreateVideoRtspPipeline (std::string encoding)
 Create the pipeline for an RTSP video stream. More...
 
void CreateAudioRtspPipeline ()
 Create the pipeline for an RTSP audio stream. More...
 
void CreateMjpegPipeline ()
 Create the pipeline for an MJPEG stream. More...
 
void Play (float speed=1.0f)
 Set the pipeline state to playing and update the speed value for determining the framerate. More...
 
void Pause () const
 Set the pipeline state to paused. More...
 
void ClearPipeline ()
 Clear the pipeline and display window. More...
 

Private Member Functions

void CreatePipeline ()
 
void LinkBinElements ()
 

Static Private Member Functions

static void Init ()
 

Private Attributes

GstVars _gstVars
 

Detailed Description

Manages the GStreamer instance.

Definition at line 13 of file GstWrapper.h.

Constructor & Destructor Documentation

GstWrapper::GstWrapper ( )

Constructor.

Definition at line 257 of file GstWrapper.cpp.

257  {
259  Init();
260  _gstVars.isPipelineActive = false;
261 }
void SetMode(Controller::Mode mode)
Set the playback mode.
Definition: GstWrapper.cpp:319
The stream is stopped.
Definition: IStream.h:18
GstWrapper::~GstWrapper ( )

Destructor.

Definition at line 263 of file GstWrapper.cpp.

263 { }

Member Function Documentation

void GstWrapper::AddEventData ( void *  customData)

Add custom data to be stored in here, which will be send back to caller inside TimestampEvent on TimestampEventCallback.

Parameters
customDataCustom data pointer.

Definition at line 340 of file GstWrapper.cpp.

340  {
341  _gstVars.eventData = customData;
342 }
void * eventData
Store the custom data from caller and send back on event callback.
Definition: GstVars.h:62
void GstWrapper::AddObserver ( TimestampEventCallback  observer)

Add a new subscriber to timestamp events.

Parameters
observerThe TimestampEventCallback event handler.

Definition at line 328 of file GstWrapper.cpp.

328  {
329  _gstVars.observerList.push_back(observer);
330 }
std::vector< TimestampEventCallback > observerList
The list of timestamp event observers.
Definition: GstVars.h:32
void GstWrapper::ClearObservers ( )

Remove all existing timestamp event subscribers.

Definition at line 336 of file GstWrapper.cpp.

336  {
337  _gstVars.observerList.clear();
338 }
std::vector< TimestampEventCallback > observerList
The list of timestamp event observers.
Definition: GstVars.h:32
void GstWrapper::ClearPipeline ( )

Clear the pipeline and display window.

Definition at line 544 of file GstWrapper.cpp.

544  {
545  g_print("Stopping receiver pipeline.\n");
547  g_source_remove(_gstVars.busWatchId);
548  g_main_loop_unref(_gstVars.loop);
549  }
550 
551  gst_element_set_state(_gstVars.pipeline, GST_STATE_NULL);
552  gst_object_unref(_gstVars.pipeline);
553  _gstVars.isPipelineActive = false;
554  _gstVars.lastTimestamp = NULL;
555 }
GMainLoop * loop
Definition: GstVars.h:76
VxSdk::VxStreamProtocol::Value protocol
Definition: GstVars.h:77
uint32_t lastTimestamp
The last timestamp received from the stream.
Definition: GstVars.h:42
GstElement * pipeline
Definition: GstVars.h:13
void GstWrapper::CreateAudioRtspPipeline ( )

Create the pipeline for an RTSP audio stream.

Definition at line 458 of file GstWrapper.cpp.

458  {
459  // Create the pipeline.
460  CreatePipeline();
461 
462  // Create the depayloader, decoder and audio sink.
463  _gstVars.audioDepay = gst_element_factory_make(Constants::kRtpAudioDepay, "audioDepay");
464  g_assert(_gstVars.audioDepay);
465  _gstVars.audioDec = gst_element_factory_make(Constants::kRtpAudioDec, "audioDec");
466  g_assert(_gstVars.audioDec);
467  _gstVars.audioSink = gst_element_factory_make(Constants::kAudioSink, "audioSink");
468  g_assert(_gstVars.audioSink);
469 
470  // Add elements to the pipeline and link.
471  gst_bin_add_many(GST_BIN(_gstVars.pipeline), _gstVars.audioDepay, _gstVars.audioDec, _gstVars.audioSink, NULL);
472  gst_element_link_many(_gstVars.audioDepay, _gstVars.audioDec, _gstVars.audioSink, NULL);
473 
474  // Create the bin element and start linking
475  LinkBinElements();
476 
477  // The RTP pad that connects to the depayloader will be created dynamically.
478  // So connect to the pad-added signal and pass the depayloader to link to it.
479  g_signal_connect(_gstVars.bin, "pad-added", G_CALLBACK(OnPadAdded), _gstVars.audioDepay);
480 
482  g_print("Starting RTP audio receiver pipeline.\n");
483 }
GstElement * audioDepay
Definition: GstVars.h:21
static const char * kRtpAudioDec
Definition: Constants.h:101
static const char * kRtpAudioDepay
Definition: Constants.h:100
static const char * kAudioSink
Definition: Constants.h:104
VxSdk::VxStreamProtocol::Value protocol
Definition: GstVars.h:77
static void OnPadAdded(GstElement *rtpbin, GstPad *new_pad, GstElement *depay)
Definition: GstWrapper.cpp:242
GstElement * audioSink
Definition: GstVars.h:23
GstElement * audioDec
Definition: GstVars.h:22
GstElement * bin
Definition: GstVars.h:14
GstElement * pipeline
Definition: GstVars.h:13
void GstWrapper::CreateMjpegPipeline ( )

Create the pipeline for an MJPEG stream.

Definition at line 485 of file GstWrapper.cpp.

485  {
486  // Create the pipeline.
487  _gstVars.pipeline = gst_pipeline_new(nullptr);
488  g_assert(_gstVars.pipeline);
489  _gstVars.isPipelineActive = true;
490  GstBus *bus = gst_pipeline_get_bus(GST_PIPELINE(_gstVars.pipeline));
491  _gstVars.busWatchId = gst_bus_add_watch(bus, GstBusFunc(OnBusMessage), &_gstVars);
492  gst_object_unref(bus);
493 
494  // Create the souphttpsrc.
495  _gstVars.src = gst_element_factory_make(Constants::kHttpSrc, "httpSrc");
496  g_assert(_gstVars.src);
497  g_object_set(_gstVars.src, Constants::kRetries, 5, NULL);
498  g_object_set(_gstVars.src, Constants::kKeepAlive, TRUE, NULL);
499  g_object_set(_gstVars.src, Constants::kLocation, _gstVars.location.c_str(), NULL);
500  g_object_set(_gstVars.src, Constants::kHttpLogLevel, SOUP_LOGGER_LOG_HEADERS, NULL);
501  g_object_set(_gstVars.src, Constants::kSslStrict, FALSE, NULL);
502  static const char *cookie[] = { _gstVars.cookie.c_str(), NULL };
503  g_object_set(_gstVars.src, Constants::kCookies, cookie, NULL);
504 
505  // Create the decoder and video sink.
506  _gstVars.videoDec = gst_element_factory_make(Constants::kJpegDec, "videoDec");
507  g_assert(_gstVars.videoDec);
508  _gstVars.videoSink = gst_element_factory_make(Constants::kVideoSink, "videoSink");
509  g_assert(_gstVars.videoSink);
510 
511  // Add elements to the pipeline and link.
512  gst_bin_add_many(GST_BIN(_gstVars.pipeline), _gstVars.src, _gstVars.videoDec, _gstVars.videoSink, NULL);
513  gst_element_link_many(_gstVars.src, _gstVars.videoDec, _gstVars.videoSink, NULL);
514 
515  // Add a probe to souphttpsrc.
516  GstPad *httpsrcpad = gst_element_get_static_pad(_gstVars.src, Constants::kSrc);
517  gst_pad_add_probe(httpsrcpad, GST_PAD_PROBE_TYPE_EVENT_BOTH, GstPadProbeCallback(OnJpegPacketReceived), &_gstVars, nullptr);
518  gst_object_unref(httpsrcpad);
519 
520  // Set the window handle for the video sink.
521  gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(_gstVars.videoSink), _gstVars.windowHandle);
522 
523  // Start the loop to receive bus messages.
524  _gstVars.loop = g_main_loop_new(nullptr, FALSE);
525  boost::thread _workerThread(g_main_loop_run, _gstVars.loop);
526 
528  g_print("Starting MJPEG receiver pipeline.\n");
529 }
static const char * kCookies
Definition: Constants.h:85
void OnBusMessage(GstBus *bus, GstMessage *msg, GstVars *vars)
Definition: GstWrapper.cpp:209
GstElement * src
Definition: GstVars.h:15
GstElement * videoSink
Definition: GstVars.h:20
std::string location
Definition: GstVars.h:70
static const char * kKeepAlive
Definition: Constants.h:81
static const char * kHttpSrc
Definition: Constants.h:97
static const char * kVideoSink
Definition: Constants.h:103
static const char * kRetries
Definition: Constants.h:80
static const char * kHttpLogLevel
Definition: Constants.h:83
static const char * kJpegDec
Definition: Constants.h:98
static const char * kSrc
Definition: Constants.h:72
static const char * kLocation
Definition: Constants.h:82
GMainLoop * loop
Definition: GstVars.h:76
static const char * kSslStrict
Definition: Constants.h:84
VxSdk::VxStreamProtocol::Value protocol
Definition: GstVars.h:77
GstElement * videoDec
Definition: GstVars.h:19
GstPadProbeReturn OnJpegPacketReceived(GstPad *localPad, GstPadProbeInfo *info, GstVars *vars)
Definition: GstWrapper.cpp:136
GstElement * pipeline
Definition: GstVars.h:13
std::string cookie
Definition: GstVars.h:67
void GstWrapper::CreatePipeline ( )
private

Definition at line 344 of file GstWrapper.cpp.

344  {
345  // Create the pipeline.
346  _gstVars.pipeline = gst_pipeline_new(nullptr);
347  g_assert(_gstVars.pipeline);
348  _gstVars.isPipelineActive = true;
349 
350  // Create the udpsrc.
351  _gstVars.src = gst_element_factory_make(Constants::kUdpSrc, "rtpSrc");
352  g_assert(_gstVars.src);
353  g_object_set(_gstVars.src, Constants::kPort, _gstVars.rtpPort, NULL);
354  if (!_gstVars.multicastAddress.empty())
355  g_object_set(_gstVars.src, Constants::kAddress, _gstVars.multicastAddress.c_str(), NULL);
356 
357  // Set the caps on udpsrc.
358  _gstVars.caps = gst_caps_from_string(_gstVars.rtpCaps.c_str());
359  g_object_set(_gstVars.src, Constants::kCaps, _gstVars.caps, NULL);
360  gst_caps_unref(_gstVars.caps);
361 
362  // Create the udpsrc for RTCP.
363  _gstVars.rtcpSrc = gst_element_factory_make(Constants::kUdpSrc, "rtcpSrc");
364  g_assert(_gstVars.rtcpSrc);
365  g_object_set(_gstVars.rtcpSrc, Constants::kPort, _gstVars.rtcpPort, NULL);
366 
367  // Create the udpsink for RTCP.
368  _gstVars.rtcpSink = gst_element_factory_make(Constants::kUdpSink, "rtcpSink");
369  g_assert(_gstVars.rtcpSink);
371  g_object_set(_gstVars.rtcpSink, Constants::kAsync, FALSE, Constants::kSync, FALSE, NULL);
372 
373  // Add the elements to the pipeline.
374  gst_bin_add_many(GST_BIN(_gstVars.pipeline), _gstVars.src, _gstVars.rtcpSrc, _gstVars.rtcpSink, NULL);
375 }
static const char * kUdpSink
Definition: Constants.h:91
static const char * kPort
Definition: Constants.h:74
GstElement * src
Definition: GstVars.h:15
std::string multicastAddress
Definition: GstVars.h:69
GstElement * rtcpSrc
Definition: GstVars.h:16
static const char * kSync
Definition: Constants.h:78
GstElement * rtcpSink
Definition: GstVars.h:17
std::string rtpCaps
Definition: GstVars.h:66
static const char * kHost
Definition: Constants.h:77
static const char * kCaps
Definition: Constants.h:76
static const char * kAddress
Definition: Constants.h:75
GstElement * pipeline
Definition: GstVars.h:13
static const char * kUdpSrc
Definition: Constants.h:90
static const char * kAsync
Definition: Constants.h:79
std::string hostIp
Definition: GstVars.h:68
void GstWrapper::CreateVideoRtspPipeline ( std::string  encoding)

Create the pipeline for an RTSP video stream.

Parameters
encodingThe video encoding type.

Definition at line 412 of file GstWrapper.cpp.

412  {
413  // Create the pipeline.
414  CreatePipeline();
415 
416  // Determine which depayloader and decoder to use based on the encoding type.
417  const char* videoDepay;
418  const char* videoDec;
419  if (encoding == Constants::kEncodingJpeg) {
420  videoDepay = Constants::kRtpJpegDepay;
421  videoDec = Constants::kJpegDec;
422  }
423  else if (encoding == Constants::kEncodingMpeg) {
424  videoDepay = Constants::kRtpMp4vDepay;
425  videoDec = Constants::kRtpMp4vDec;
426  }
427  else {
428  videoDepay = Constants::kRtpH264Depay;
429  videoDec = Constants::kRtpH264Dec;
430  }
431 
432  // Create the depayloader, decoder and video sink.
433  _gstVars.videoDepay = gst_element_factory_make(videoDepay, "videoDepay");
434  g_assert(_gstVars.videoDepay);
435  _gstVars.videoDec = gst_element_factory_make(videoDec, "videoDec");
436  g_assert(_gstVars.videoDec);
437  _gstVars.videoSink = gst_element_factory_make(Constants::kVideoSink, "videoSink");
438  g_assert(_gstVars.videoSink);
439 
440  // Add elements to the pipeline and link.
441  gst_bin_add_many(GST_BIN(_gstVars.pipeline), _gstVars.videoDepay, _gstVars.videoDec, _gstVars.videoSink, NULL);
442  gst_element_link_many(_gstVars.videoDepay, _gstVars.videoDec, _gstVars.videoSink, NULL);
443 
444  // Create the bin element and start linking
445  LinkBinElements();
446 
447  // The RTP pad that connects to the depayloader will be created dynamically.
448  // So connect to the pad-added signal and pass the depayloader to link to it.
449  g_signal_connect(_gstVars.bin, "pad-added", G_CALLBACK(OnPadAdded), _gstVars.videoDepay);
450 
451  // Set the window handle for the video sink.
452  gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(_gstVars.videoSink), _gstVars.windowHandle);
453 
455  g_print("Starting RTP video receiver pipeline.\n");
456 }
static const char * kRtpMp4vDec
Definition: Constants.h:95
static const char * kEncodingJpeg
Definition: Constants.h:86
static const char * kRtpJpegDepay
Definition: Constants.h:99
GstElement * videoSink
Definition: GstVars.h:20
GstElement * videoDepay
Definition: GstVars.h:18
static const char * kVideoSink
Definition: Constants.h:103
static const char * kEncodingMpeg
Definition: Constants.h:87
static const char * kJpegDec
Definition: Constants.h:98
static const char * kRtpMp4vDepay
Definition: Constants.h:94
VxSdk::VxStreamProtocol::Value protocol
Definition: GstVars.h:77
static const char * kRtpH264Dec
Definition: Constants.h:93
GstElement * videoDec
Definition: GstVars.h:19
static void OnPadAdded(GstElement *rtpbin, GstPad *new_pad, GstElement *depay)
Definition: GstWrapper.cpp:242
static const char * kRtpH264Depay
Definition: Constants.h:92
GstElement * bin
Definition: GstVars.h:14
GstElement * pipeline
Definition: GstVars.h:13
unsigned int GstWrapper::GetLastTimestamp ( ) const

Get the last timestamp received from the stream.

Returns
The unix timestamp.

Definition at line 306 of file GstWrapper.cpp.

306  {
307  // If the protocol is MjpegPull do not convert the timestamp.
309  return _gstVars.currentTimestamp;
310  }
311  // If the current mode is playback do not convert the timestamp.
313  return _gstVars.currentTimestamp;
314  }
315 
316  return static_cast<unsigned int>(_gstVars.rtcpTimestamp / Constants::kMillisecondsInt);
317 }
unsigned long currentTimestamp
The current timestamp of the stream.
Definition: GstVars.h:37
static const unsigned short kMillisecondsInt
Definition: Constants.h:16
uint64_t rtcpTimestamp
The latest timestamp received from an RTCP packet.
Definition: GstVars.h:47
The stream is playing recorded video.
Definition: IStream.h:24
VxSdk::VxStreamProtocol::Value protocol
Definition: GstVars.h:77
Controller::Mode mode
The current Controller::Mode of the stream.
Definition: GstVars.h:52
Controller::Mode MediaController::GstWrapper::GetMode ( ) const
inline

Get the current playback mode.

Returns
The current stream Controller::Mode.

Definition at line 90 of file GstWrapper.h.

90 { return _gstVars.mode; }
Controller::Mode mode
The current Controller::Mode of the stream.
Definition: GstVars.h:52
float MediaController::GstWrapper::GetSpeed ( ) const
inline

Get the current playback speed.

Returns
The current stream speed.

Definition at line 96 of file GstWrapper.h.

96 { return _gstVars.speed; }
float speed
The current speed of the stream.
Definition: GstVars.h:57
void GstWrapper::Init ( )
staticprivate

Definition at line 265 of file GstWrapper.cpp.

265  {
266  if (!gst_is_initialized())
267  gst_init(nullptr, nullptr);
268 }
bool GstWrapper::IsPipelineActive ( ) const

Get the status of the pipeline.

Returns
True if pipeline is active, otherwise false.

Definition at line 324 of file GstWrapper.cpp.

324  {
325  return _gstVars.isPipelineActive;
326 }
void GstWrapper::LinkBinElements ( )
private

Definition at line 377 of file GstWrapper.cpp.

377  {
378  // Create the bin element.
379  _gstVars.bin = gst_element_factory_make(Constants::kRtpBin, "rtpBin");
380  g_assert(_gstVars.bin);
381 
382  // Add the bin element to the pipeline.
383  gst_bin_add(GST_BIN(_gstVars.pipeline), _gstVars.bin);
384 
385  // Start linking elements to the bin, beginning with the RTP sinkPad for session 0.
386  _gstVars.srcPad = gst_element_get_static_pad(_gstVars.src, Constants::kSrc);
387  gst_pad_add_probe(_gstVars.srcPad, GST_PAD_PROBE_TYPE_BUFFER, GstPadProbeCallback(OnRtpPacketReceived), &_gstVars, nullptr);
388  _gstVars.sinkPad = gst_element_get_request_pad(_gstVars.bin, "recv_rtp_sink_0");
390  g_assert(_gstVars.linkReturn == GST_PAD_LINK_OK);
391  gst_object_unref(_gstVars.srcPad);
392  gst_object_unref(_gstVars.sinkPad);
393 
394  // Link the RTCP sinkPad for session 0.
395  _gstVars.srcPad = gst_element_get_static_pad(_gstVars.rtcpSrc, Constants::kSrc);
396  gst_pad_add_probe(_gstVars.srcPad, GST_PAD_PROBE_TYPE_BUFFER, GstPadProbeCallback(OnRtcpPacketReceived), &_gstVars, nullptr);
397  _gstVars.sinkPad = gst_element_get_request_pad(_gstVars.bin, "recv_rtcp_sink_0");
399  g_assert(_gstVars.linkReturn == GST_PAD_LINK_OK);
400  gst_object_unref(_gstVars.srcPad);
401  gst_object_unref(_gstVars.sinkPad);
402 
403  // Link the RTCP srcPad for session 0.
404  _gstVars.srcPad = gst_element_get_request_pad(_gstVars.bin, "send_rtcp_src_0");
405  _gstVars.sinkPad = gst_element_get_static_pad(_gstVars.rtcpSink, Constants::kSink);
407  g_assert(_gstVars.linkReturn == GST_PAD_LINK_OK);
408  gst_object_unref(_gstVars.srcPad);
409  gst_object_unref(_gstVars.sinkPad);
410 }
GstElement * src
Definition: GstVars.h:15
static const char * kRtpBin
Definition: Constants.h:96
GstPadLinkReturn linkReturn
Definition: GstVars.h:25
static const char * kSink
Definition: Constants.h:73
GstPadProbeReturn OnRtpPacketReceived(GstPad *localPad, GstPadProbeInfo *info, GstVars *vars)
Definition: GstWrapper.cpp:48
static const char * kSrc
Definition: Constants.h:72
GstElement * rtcpSrc
Definition: GstVars.h:16
GstElement * rtcpSink
Definition: GstVars.h:17
GstPadProbeReturn OnRtcpPacketReceived(GstPad *localPad, GstPadProbeInfo *info, GstVars *vars)
Definition: GstWrapper.cpp:21
GstElement * bin
Definition: GstVars.h:14
GstElement * pipeline
Definition: GstVars.h:13
void GstWrapper::Pause ( ) const

Set the pipeline state to paused.

Definition at line 540 of file GstWrapper.cpp.

540  {
541  gst_element_set_state(_gstVars.pipeline, GST_STATE_PAUSED);
542 }
GstElement * pipeline
Definition: GstVars.h:13
void GstWrapper::Play ( float  speed = 1.0f)

Set the pipeline state to playing and update the speed value for determining the framerate.

Definition at line 531 of file GstWrapper.cpp.

531  {
533  _gstVars.speed = speed;
534 
535  if (_gstVars.pipeline) {
536  gst_element_set_state(_gstVars.pipeline, GST_STATE_PLAYING);
537  }
538 }
uint64_t rtcpTimestamp
The latest timestamp received from an RTCP packet.
Definition: GstVars.h:47
float speed
The current speed of the stream.
Definition: GstVars.h:57
GstElement * pipeline
Definition: GstVars.h:13
void GstWrapper::RemoveObserver ( TimestampEventCallback  observer)

Remove an existing timestamp event subscriber.

Parameters
observerThe TimestampEventCallback event handler.

Definition at line 332 of file GstWrapper.cpp.

332  {
333  _gstVars.observerList.erase(remove(_gstVars.observerList.begin(), _gstVars.observerList.end(), observer), _gstVars.observerList.end());
334 }
std::vector< TimestampEventCallback > observerList
The list of timestamp event observers.
Definition: GstVars.h:32
void GstWrapper::SetCaps ( std::string  caps,
bool  isMjpeg = false 
)

Set the stream capabilities.

Parameters
capsThe stream capabilities.

Definition at line 284 of file GstWrapper.cpp.

284  {
285  _gstVars.rtpCaps = "application/x-rtp,media=(string)" + caps;
286  _gstVars.isMjpeg = isMjpeg;
287 }
std::string rtpCaps
Definition: GstVars.h:66
void GstWrapper::SetCookie ( std::string  cookie)

Set the cookie for MJPEG streams.

Parameters
cookieThe cookie value.

Definition at line 289 of file GstWrapper.cpp.

289  {
290  _gstVars.cookie = cookie;
291 }
std::string cookie
Definition: GstVars.h:67
void GstWrapper::SetLocation ( std::string  location)

Set the stream location.

Parameters
locationThe URI of the new stream location.

Definition at line 274 of file GstWrapper.cpp.

274  {
275  _gstVars.location = location;
276 }
std::string location
Definition: GstVars.h:70
void GstWrapper::SetMode ( Controller::Mode  mode)

Set the playback mode.

Parameters
modeThe stream Controller::Mode to set.

Definition at line 319 of file GstWrapper.cpp.

319  {
321  _gstVars.mode = mode;
322 }
uint64_t rtcpTimestamp
The latest timestamp received from an RTCP packet.
Definition: GstVars.h:47
Controller::Mode mode
The current Controller::Mode of the stream.
Definition: GstVars.h:52
void GstWrapper::SetMulticastAddress ( std::string  multicastAddress)

Set the multicast group address.

Parameters
multicastAddressThe multicast group address.

Definition at line 297 of file GstWrapper.cpp.

297  {
298  _gstVars.multicastAddress = multicastAddress;
299 }
std::string multicastAddress
Definition: GstVars.h:69
void GstWrapper::SetPorts ( int  rtpPort,
int  rtcpPort 
)

Set the receiver ports.

Parameters
rtpPortThe port to receive RTP data.
rtcpPortThe port to receive RTCP data.

Definition at line 278 of file GstWrapper.cpp.

278  {
279  _gstVars.rtpPort = port;
280  _gstVars.rtcpPort = port2;
281  _gstVars.rtcpSinkPort = port2 + 4;
282 }
void GstWrapper::SetRtcpHostIP ( std::string  hostIp)

Set the RTCP host IP.

Parameters
hostIpThe IP of the RTCP host.

Definition at line 293 of file GstWrapper.cpp.

293  {
294  _gstVars.hostIp = hostIp;
295 }
std::string hostIp
Definition: GstVars.h:68
void GstWrapper::SetTimestamp ( unsigned int  seekTime)

Set the internal timestamp variable.

Parameters
seekTimeA unix timestamp.

Definition at line 301 of file GstWrapper.cpp.

301  {
302  _gstVars.currentTimestamp = seekTime;
303  _gstVars.lastTimestamp = NULL;
304 }
unsigned long currentTimestamp
The current timestamp of the stream.
Definition: GstVars.h:37
uint32_t lastTimestamp
The last timestamp received from the stream.
Definition: GstVars.h:42
void GstWrapper::SetWindowHandle ( guintptr  winhandle)

Set the display window using the given window handle.

Parameters
winhandleThe window handle of the display.

Definition at line 270 of file GstWrapper.cpp.

270  {
271  _gstVars.windowHandle = winhandle;
272 }

Member Data Documentation

GstVars MediaController::GstWrapper::_gstVars
private

Definition at line 161 of file GstWrapper.h.


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