RsServerMediaSession.cpp
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2020 Intel Corporation. All Rights Reserved.
3 
4 #include "RsServerMediaSession.h"
5 
6 // ServerMediaSession
7 
8 RsServerMediaSession* RsServerMediaSession ::createNew(UsageEnvironment& t_env, RsSensor& t_sensor, char const* t_streamName, char const* t_info, char const* t_description, Boolean t_isSSM, char const* t_miscSDPLines)
9 {
10  return new RsServerMediaSession(t_env, t_sensor, t_streamName, t_info, t_description, t_isSSM, t_miscSDPLines);
11 }
12 
13 RsServerMediaSession::RsServerMediaSession(UsageEnvironment& t_env, RsSensor& t_sensor, char const* t_streamName, char const* t_info, char const* t_description, Boolean t_isSSM, char const* t_miscSDPLines)
14  : ServerMediaSession(t_env, t_streamName, t_info, t_description, t_isSSM, t_miscSDPLines)
15  , m_rsSensor(t_sensor)
16  , m_isActive(false)
17 {}
18 
20 
21 void RsServerMediaSession::openRsCamera(std::unordered_map<long long int, rs2::frame_queue>& t_streamProfiles)
22 {
23  if(m_isActive)
24  {
25  envir() << "sensor is already open, closing sensor and than open again...\n";
26  closeRsCamera();
27  }
28  m_rsSensor.open(t_streamProfiles);
29  m_rsSensor.start(t_streamProfiles);
30  m_isActive = true;
31 }
32 
34 {
35  if(m_isActive)
36  {
39  m_isActive = false;
40  }
41 }
42 
44 {
45  return m_rsSensor;
46 }
int open(std::unordered_map< long long int, rs2::frame_queue > &t_streamProfilesQueues)
Definition: RsSensor.cpp:31
void openRsCamera(std::unordered_map< long long int, rs2::frame_queue > &t_streamProfiles)
RsServerMediaSession(UsageEnvironment &t_env, RsSensor &t_sensor, char const *t_streamName, char const *t_info, char const *t_description, Boolean t_isSSM, char const *t_miscSDPLines)
rs2::sensor & getRsSensor()
Definition: RsSensor.hh:27
void close() const
Definition: rs_sensor.hpp:173
int start(std::unordered_map< long long int, rs2::frame_queue > &t_streamProfilesQueues)
Definition: RsSensor.cpp:69
static RsServerMediaSession * createNew(UsageEnvironment &t_env, RsSensor &t_sensor, char const *t_streamName=NULL, char const *t_info=NULL, char const *t_description=NULL, Boolean t_isSSM=False, char const *t_miscSDPLines=NULL)
void stop() const
Definition: rs_sensor.hpp:195


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:41