diff --git a/src/ethernet/CMakeLists.txt b/src/ethernet/CMakeLists.txt index 4134caa104..348f580472 100644 --- a/src/ethernet/CMakeLists.txt +++ b/src/ethernet/CMakeLists.txt @@ -16,6 +16,7 @@ set(LIVE third-party/live555) "*.h" "*.cpp" "rtsp_client/*.cpp" + "common/*.hh" ${LIVE}/groupsock/*.c* ${LIVE}/liveMedia/*.c* ${LIVE}/UsageEnvironment/*.c* diff --git a/src/ethernet/common/stream_profile.hh b/src/ethernet/common/stream_profile.hh new file mode 100644 index 0000000000..62664d1c9a --- /dev/null +++ b/src/ethernet/common/stream_profile.hh @@ -0,0 +1,35 @@ + +typedef enum stream_type_id +{ + STREAM_DEPTH, + STREAM_COLOR, +}; + +typedef struct stream_resolution +{ + int width; + int hight; +}; + +class stream_profile +{ + public: + stream_profile(stream_type_id id, stream_resolution res, int fps) + :m_stream_type(id), + m_stream_res(res), + m_stream_fps(fps){} + + //in case we want to have self-contained sdp parser + stream_profile(char* sdp_line); + + int width(){ return m_stream_res.width; } + int hight(){ return m_stream_res.hight; } + int fps(){ return m_stream_fps; } + stream_type_id stream_type(){ return m_stream_type; } + + private: + stream_type_id m_stream_type; + stream_resolution m_stream_res; + int m_stream_fps; + +}; \ No newline at end of file diff --git a/src/ethernet/ethernet-device.cpp b/src/ethernet/ethernet-device.cpp index 7a408f4af3..3d30569a87 100644 --- a/src/ethernet/ethernet-device.cpp +++ b/src/ethernet/ethernet-device.cpp @@ -1,4 +1,5 @@ #include "ethernet-device.h" +#include "common/stream_profile.hh" int frame_number = 0; std::chrono::high_resolution_clock::time_point last; @@ -42,6 +43,13 @@ rs2::ethernet_device::~ethernet_device() std::vector rs2::ethernet_device::ethernet_device::query_sensors() const { std::cout << "Mock ethernet device querry"; + + /* + TODO: use rtsp client + std::vector rtsp_profiles = rtsp_client.query_streams(); + std::vector ethernet_devie_streams = rtsp_stream_to_rs_video_stream(rtsp_profiles); + */ + std::vector sensors; //TODO: get device sensors via network rs2::sensor mock_sensor; @@ -90,6 +98,17 @@ void rs2::ethernet_device::add_frame_to_queue(int type, Frame* raw_frame) void rs2::ethernet_device::inject_frames_to_sw_device() { + + /* + TODO: replace the pre-loop code with tream generation according to profile_list + something like: + + for each stream in streams_list: + rs2_video_stream new_video_stream = { stream.stream_id, 0, 1, stream.W,stream.H, stream.fps, BPP, RS2_FORMAT_YUYV/Z16, stream.intrinsics }; + new_sw_sensor = rs2_software_device_add_sensor(dev, stream.desciption + "(remote)", NULL); + rs2_software_sensor_add_video_stream(new_sensor, st2, NULL); + */ + rs2_intrinsics depth_intrinsics = get_intrinsics(); depth_sensor = rs2_software_device_add_sensor(dev, "Depth (Remote)", NULL);