diff --git a/tools/rs-server/RsCamera.cpp b/tools/rs-server/RsDevice.cpp similarity index 60% rename from tools/rs-server/RsCamera.cpp rename to tools/rs-server/RsDevice.cpp index a6f60cc29a..3b6d6fbe85 100644 --- a/tools/rs-server/RsCamera.cpp +++ b/tools/rs-server/RsDevice.cpp @@ -1,9 +1,9 @@ #include -#include "RsCamera.hh" +#include "RsDevice.hh" -RsCamera::RsCamera() +RsDevice::RsDevice() { - //get RS device + //get LRS device std::cerr << "RsCamera constructor" << std::endl; // The context represents the current platform with respect to connected devices rs2::context ctx; @@ -13,21 +13,21 @@ RsCamera::RsCamera() { std::cerr << "No device connected, please connect a RealSense device" << std::endl; rs2::device_hub device_hub(ctx); - m_dev = device_hub.wait_for_device(); + m_device = device_hub.wait_for_device(); //todo: check wait_for_device } else { - m_dev = devices[0]; // Only one device is supported + m_device = devices[0]; // Only one device is supported } //get RS sensors - for (auto &sensor : m_dev.query_sensors()) + for (auto &sensor : m_device.query_sensors()) { m_sensors.push_back(RsSensor(sensor)); } } -RsCamera::~RsCamera() +RsDevice::~RsDevice() { - std::cerr << "RsCamera destructor" << std::endl; + std::cerr << "RsDevice destructor" << std::endl; } diff --git a/tools/rs-server/RsCamera.hh b/tools/rs-server/RsDevice.hh similarity index 77% rename from tools/rs-server/RsCamera.hh rename to tools/rs-server/RsDevice.hh index 2032ef179a..bcf9760ba8 100644 --- a/tools/rs-server/RsCamera.hh +++ b/tools/rs-server/RsDevice.hh @@ -5,15 +5,15 @@ #include "RsSensor.hh" -class RsCamera +class RsDevice { public: - RsCamera(); - ~RsCamera(); + RsDevice(); + ~RsDevice(); std::vector &getSensors() { return m_sensors; } private: - rs2::device m_dev; + rs2::device m_device; std::vector m_sensors; }; diff --git a/tools/rs-server/RsMediaSubsession.cpp b/tools/rs-server/RsMediaSubsession.cpp index aba49697ac..7fc8a86858 100644 --- a/tools/rs-server/RsMediaSubsession.cpp +++ b/tools/rs-server/RsMediaSubsession.cpp @@ -19,7 +19,6 @@ along with this library; if not, write to the Free Software Foundation, Inc., // on demand, from a file. // Implementation #include "RsMediaSubsession.h" -#include "RsMediaSubsession.h" #include "RsRawVideoRTPSink.h" //#include diff --git a/tools/rs-server/RsRTSPServer.hh b/tools/rs-server/RsRTSPServer.hh index c5368e292e..7344cf2f74 100644 --- a/tools/rs-server/RsRTSPServer.hh +++ b/tools/rs-server/RsRTSPServer.hh @@ -25,7 +25,7 @@ along with this library; if not, write to the Free Software Foundation, Inc., #include "RsRTSPServer.hh" #endif -#include "RsCamera.hh" +#include "RsDevice.hh" #include class RsRTSPServer: public RTSPServer { diff --git a/tools/rs-server/RsSensor.cpp b/tools/rs-server/RsSensor.cpp index 1953a03f0e..6da223c3ec 100644 --- a/tools/rs-server/RsSensor.cpp +++ b/tools/rs-server/RsSensor.cpp @@ -1,8 +1,6 @@ #include -//#include -//#include #include -#include "RsCamera.hh" +#include "RsDevice.hh" RsSensor::RsSensor(rs2::sensor sensor) { @@ -19,16 +17,16 @@ RsSensor::RsSensor(rs2::sensor sensor) int RsSensor::open(std::unordered_map &stream_profiles_queues) { - std::vector stream_profiles; + std::vector requested_stream_profiles; for (auto stream_profile : stream_profiles_queues) { //make a vector of all requested stream profiles long long int stream_profile_key = stream_profile.first; - stream_profiles.push_back(m_stream_profiles.at(stream_profile_key)); + requested_stream_profiles.push_back(m_stream_profiles.at(stream_profile_key)); } try { - m_sensor.open(stream_profiles); + m_sensor.open(requested_stream_profiles); } catch (...) { diff --git a/tools/rs-server/RsServerMediaSession.h b/tools/rs-server/RsServerMediaSession.h index 020246e29d..0dbea5a811 100644 --- a/tools/rs-server/RsServerMediaSession.h +++ b/tools/rs-server/RsServerMediaSession.h @@ -25,7 +25,7 @@ along with this library; if not, write to the Free Software Foundation, Inc., #define _RS_SERVER_MEDIA_SESSION_HH #include "ServerMediaSession.hh" -#include "RsCamera.hh" +#include "RsDevice.hh" class RsServerMediaSession: public ServerMediaSession { public: diff --git a/tools/rs-server/rs-server.cpp b/tools/rs-server/rs-server.cpp index a5454e75ff..1ec9847b98 100644 --- a/tools/rs-server/rs-server.cpp +++ b/tools/rs-server/rs-server.cpp @@ -33,7 +33,7 @@ along with this library; if not, write to the Free Software Foundation, Inc., #include #include "RsSource.hh" #include "RsMediaSubsession.h" -#include "RsCamera.hh" +#include "RsDevice.hh" #include "RsRTSPServer.hh" #include "RsServerMediaSession.h" @@ -48,7 +48,7 @@ RsDeviceSource *devSource2; RawVideoRTPSink *videoSink1; RawVideoRTPSink *videoSink2; RTSPServer *rtspServer; -RsCamera cam; +RsDevice device; std::vector sensors; void play(); // forward @@ -69,7 +69,7 @@ int main(int argc, char **argv) exit(1); } - sensors = cam.getSensors(); + sensors = device.getSensors(); int sensorIndex =0;//TODO::to remove for (auto sensor:sensors) {