Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RealSense Device over Network #6136

Merged
merged 159 commits into from
Mar 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
159 commits
Select commit Hold shift + click to select a range
e059ba6
Integration: base for LRS network extentions.
apuzhevi Mar 9, 2020
7842d76
add new net-device includes
nhershko Mar 9, 2020
386f041
return realsense errors
nhershko Mar 10, 2020
857674f
Merge pull request #142 from IntelRealSense/server_error_handling_aft…
nhershko Mar 10, 2020
4910930
mchanan_fix_pr_check_error
mchanan Mar 10, 2020
57aa0ea
Merge pull request #143 from IntelRealSense/mchanan_fix_pr_check_error
mchanan Mar 10, 2020
a930aa6
add script to setup network queues
mchanan Mar 10, 2020
aa58fb2
Merge pull request #144 from IntelRealSense/mchanan_script_queues
mchanan Mar 10, 2020
7618f3a
get extrinsics map + add it to streams
nhershko Mar 11, 2020
2690509
release sw device ptr from active object after creation
nhershko Mar 11, 2020
6687506
add header and cleanup
nhershko Mar 11, 2020
5446e4c
remove old ip_device generator
nhershko Mar 11, 2020
7870a11
generate minimal map
nhershko Mar 11, 2020
6f2e77a
Merge pull request #145 from IntelRealSense/nhershko_net_device
nhershko Mar 11, 2020
6127ef5
Removed lz4, libjpeg-turbo and zlib from dource tree. Downloading fro…
apuzhevi Mar 12, 2020
84b1809
Linux static compilation fixed. (#147)
apuzhevi Mar 12, 2020
ee2c0d3
create map at client side
nhershko Mar 12, 2020
23c813a
Merge branch 'master' into nhershko_create_extrinsics_map
nhershko Mar 12, 2020
ea3198e
bug fix
mchanan Mar 15, 2020
81d9469
use rs_sensor for device data container
nhershko Mar 15, 2020
387f337
change to stream type
mchanan Mar 15, 2020
889fb17
Merge pull request #150 from IntelRealSense/mchanan_stream
mchanan Mar 15, 2020
adf3925
review fixes
nhershko Mar 15, 2020
9f2589b
handle NaN extrinsics
nhershko Mar 15, 2020
5c8658a
Do not download live555 if exists
apuzhevi Mar 15, 2020
0a22968
Merge branch 'master' into nhershko_create_extrinsics_map
nhershko Mar 15, 2020
658f873
Merge pull request #148 from IntelRealSense/nhershko_create_extrinsic…
nhershko Mar 15, 2020
7c9f20e
Windows compilation fixed. (#152)
apuzhevi Mar 16, 2020
b2af009
return sdp fix
nhershko Mar 16, 2020
b0f3874
Merge pull request #154 from IntelRealSense/nhershko_return_miri_sdp_fix
nhershko Mar 16, 2020
c33d23c
support controls before setup (#156)
cspungin Mar 16, 2020
fb2ab86
cspungin_fix_segmentation_fault
cspungin Mar 17, 2020
550b8d4
merge Sergey's changes
cspungin Mar 17, 2020
a9dd059
add Atomic to Cmake and remove RTSP Client recover on download
cspungin Mar 17, 2020
5682560
remove tabs
cspungin Mar 18, 2020
e136a8e
fix comment
cspungin Mar 18, 2020
ace3a73
do TEARDOWN on PLAY failure
cspungin Mar 18, 2020
222f3e5
Merge pull request #157 from IntelRealSense/cspungin_sergey_changes
cspungin Mar 18, 2020
a3cafba
increase client timeout
tbentzur Mar 18, 2020
0ba448c
Merge pull request #161 from IntelRealSense/tami_change_timout
tbentzur Mar 18, 2020
8d1de95
fix metadata + uyvy
mchanan Mar 18, 2020
356cd70
Merge pull request #163 from IntelRealSense/mchanan_bug_fix
mchanan Mar 18, 2020
7965aa8
parse option as float + delete ip_sensors + try once to start sensors…
nhershko Mar 18, 2020
e9e2e8d
throw exception at start/stop failure
nhershko Mar 19, 2020
353f5bb
Merge pull request #164 from IntelRealSense/nhershko_readonly_controls
nhershko Mar 19, 2020
40e3131
set notification on start/stop error
nhershko Mar 19, 2020
44ec262
Merge branch 'master' into nhershko_readonly_controls
nhershko Mar 19, 2020
c1358d8
change notification values
nhershko Mar 19, 2020
68b5d82
Merge pull request #165 from IntelRealSense/nhershko_readonly_controls
nhershko Mar 19, 2020
3046273
Merge branch 'master' into cspungin_segmentation_fault_fix
cspungin Mar 19, 2020
ae7e364
Merge pull request #166 from IntelRealSense/cspungin_segmentation_fau…
cspungin Mar 19, 2020
d62da87
pause stream on plat after play
cspungin Mar 20, 2020
21bc8d3
support rad only option
cspungin Mar 21, 2020
cc94e87
Merge pull request #168 from IntelRealSense/cspungin_pause_on_play_af…
cspungin Mar 22, 2020
7f16b1c
Merge branch 'master' into cspungin_read_only_option
cspungin Mar 22, 2020
3e34392
Merge pull request #167 from IntelRealSense/cspungin_read_only_option
cspungin Mar 22, 2020
69f5017
fix warnning
mchanan Mar 22, 2020
caf285c
Merge pull request #169 from IntelRealSense/mchanan_fix_warnning
mchanan Mar 22, 2020
622bc17
client warning fix
nhershko Mar 23, 2020
5c93165
Merge branch 'master' into nhershko_warning_cleanup
nhershko Mar 23, 2020
a48f6b8
Merge pull request #170 from IntelRealSense/nhershko_warning_cleanup
nhershko Mar 23, 2020
b95ba61
delete todo and comments
mchanan Mar 23, 2020
e4001bf
cleanup code
cspungin Mar 23, 2020
4c4cab8
Merge branch 'master' into mchanan_todo_and_comments
mchanan Mar 23, 2020
4dd3bc1
Merge pull request #171 from IntelRealSense/mchanan_todo_and_comments
mchanan Mar 23, 2020
5f8e20f
Merge branch 'master' into cspungin_code_cleanup
cspungin Mar 23, 2020
43c96ab
fix_compilation
cspungin Mar 23, 2020
1903bbc
Merge branch 'cspungin_code_cleanup' of https://github.com/IntelRealS…
cspungin Mar 23, 2020
afeeeca
Logging subsystem. (#160)
apuzhevi Mar 23, 2020
36a6a8d
TODOs cleanup
cspungin Mar 23, 2020
a9ef411
Merge branch 'master' into cspungin_code_cleanup
cspungin Mar 23, 2020
3118073
use new logger
cspungin Mar 23, 2020
7fb3d99
Windows compiles. Static/shared compilation check pending. (#173)
apuzhevi Mar 23, 2020
a49bd11
dont free buffer
cspungin Mar 23, 2020
0f851a3
compression fixes
mchanan Mar 23, 2020
979c680
Merge pull request #175 from IntelRealSense/cspungin_logger_fix
cspungin Mar 23, 2020
d5e5929
Merge branch 'master' into pr_fixes
mchanan Mar 23, 2020
9794706
review fixes
nhershko Mar 23, 2020
0ce89dc
Merge branch 'master' into nhershko_merge_review_fixes
nhershko Mar 23, 2020
a2d998f
Merge pull request #176 from IntelRealSense/pr_fixes
mchanan Mar 23, 2020
f831125
Merge branch 'master' into nhershko_merge_review_fixes
nhershko Mar 23, 2020
4de3a07
Merge pull request #177 from IntelRealSense/nhershko_merge_review_fixes
nhershko Mar 23, 2020
4a9d2b6
code review fixes
cspungin Mar 23, 2020
264bbf9
Merge branch 'master' into cspungin_code_cleanup
cspungin Mar 23, 2020
9434c84
Merge pull request #172 from IntelRealSense/cspungin_code_cleanup
cspungin Mar 23, 2020
4b3964d
cleanup
cspungin Mar 23, 2020
9495cd0
Merge branch 'cspungin_code_cleanup' of https://github.com/IntelRealS…
cspungin Mar 23, 2020
ae45b7a
Windows compilation fix.
apuzhevi Mar 23, 2020
dc98abe
Merge branch 'master' into cspungin_code_cleanup
cspungin Mar 23, 2020
43e1147
Windows compiles again. (#179)
apuzhevi Mar 23, 2020
c3b34f4
code review fixes
cspungin Mar 23, 2020
83a9aad
Merge branch 'cspungin_code_cleanup' of https://github.com/IntelRealS…
cspungin Mar 23, 2020
35b3474
Windows release build.
apuzhevi Mar 23, 2020
1c82112
Merge branch 'master' into cspungin_code_cleanup
cspungin Mar 23, 2020
bc81cc4
Merge branch 'master' into cspungin_code_cleanup
cspungin Mar 23, 2020
cc6c578
pick default profile per stream type
nhershko Mar 23, 2020
ad368cd
Merge pull request #178 from IntelRealSense/cspungin_code_cleanup
cspungin Mar 23, 2020
eb033c2
Merge branch 'master' into nhershko_default_profiles
nhershko Mar 23, 2020
9fc085f
CMake option name and state changed. Unused options removed. Stats re…
apuzhevi Mar 23, 2020
72c353b
Merge branch 'master' into nhershko_default_profiles
nhershko Mar 23, 2020
b758ae7
add try catch to dtor section
nhershko Mar 23, 2020
58ae051
Merge remote-tracking branch 'origin-lrsj/nhershko_default_profiles' …
nhershko Mar 23, 2020
9f013ce
(c) 2017 => (c) 2020
apuzhevi Mar 23, 2020
b829226
Merge branch 'master' into nhershko_default_profiles
nhershko Mar 23, 2020
ea34719
Uniform indentation. #pragma once everywhere.
apuzhevi Mar 24, 2020
a40564e
add default color format
nhershko Mar 24, 2020
dc1ad3f
Merge remote-tracking branch 'origin-lrsj/nhershko_default_profiles' …
nhershko Mar 24, 2020
deccbf8
merge with latest master
nhershko Mar 24, 2020
3c9e878
fix variable initialization
mchanan Mar 24, 2020
8783593
Merge pull request #181 from IntelRealSense/nhershko_default_profiles
nhershko Mar 24, 2020
c817641
Merge branch 'master' into mchanan_Variable_initialization
mchanan Mar 24, 2020
014f38a
Merge pull request #184 from IntelRealSense/mchanan_Variable_initiali…
mchanan Mar 24, 2020
c0c85c9
client todo's cleanup
nhershko Mar 24, 2020
14ac8c5
Merge branch 'master' into nhershko_todo_cleanup
nhershko Mar 24, 2020
f3af281
add error handling. ignore irelevant connection sequence number
nhershko Mar 24, 2020
df1cccd
Merge remote-tracking branch 'origin-lrsj/nhershko_todo_cleanup' into…
nhershko Mar 24, 2020
ead293c
Static binaries support. (#186)
apuzhevi Mar 24, 2020
883db6c
Merge branch 'master' into nhershko_todo_cleanup
nhershko Mar 24, 2020
dc10b30
fix server memory leak
cspungin Mar 24, 2020
f1c76e4
No log on stdout. (#189)
apuzhevi Mar 24, 2020
501f6a8
Merge branch 'master' into cspungin_fix_memorry_leak
cspungin Mar 24, 2020
5f4165b
Merge pull request #188 from IntelRealSense/cspungin_fix_memorry_leak
cspungin Mar 24, 2020
2e71d71
Using LZ4 of LRS. (#190)
apuzhevi Mar 24, 2020
16ec96f
lrs/development => lrsj/master
apuzhevi Mar 24, 2020
f700460
all non void function return value + clean non required scopes
nhershko Mar 24, 2020
e970339
Merge remote-tracking branch 'origin-lrsj/nhershko_todo_cleanup' into…
nhershko Mar 24, 2020
4b348b4
LZ4 on Windows fix.
apuzhevi Mar 25, 2020
efefc08
cleaning
nhershko Mar 25, 2020
99d2503
Merge branch 'master' into nhershko_todo_cleanup
nhershko Mar 25, 2020
fd94f77
16-bit alligment
cspungin Mar 25, 2020
0d79b54
change headers size
cspungin Mar 25, 2020
25728c2
update default resolution
nhershko Mar 25, 2020
d1377ec
Merge remote-tracking branch 'origin-lrsj/nhershko_todo_cleanup' into…
nhershko Mar 25, 2020
c68ff74
remove prints
cspungin Mar 25, 2020
b767b00
add commemt
cspungin Mar 25, 2020
ab5c06e
change bach logger configuration
cspungin Mar 25, 2020
7ea0607
Merge pull request #185 from IntelRealSense/nhershko_todo_cleanup
nhershko Mar 25, 2020
fadab66
delete objects
mchanan Mar 25, 2020
58a8671
use union
cspungin Mar 25, 2020
80dc2ed
Merge branch 'master' into cspungin_aligment
cspungin Mar 25, 2020
645de72
fix merge
cspungin Mar 25, 2020
d15a016
Log fix.
apuzhevi Mar 25, 2020
0069523
Merge branch 'master' into cspungin_aligment
apuzhevi Mar 25, 2020
7867b3c
change to nullptr
mchanan Mar 25, 2020
8a4c48f
Merge branch 'master' into mchnan_delete_objects
mchanan Mar 25, 2020
3078527
Merge pull request #191 from IntelRealSense/cspungin_aligment
cspungin Mar 25, 2020
c1396e5
Merge branch 'master' into mchnan_delete_objects
mchanan Mar 25, 2020
1055fc0
Merge pull request #193 from IntelRealSense/mchnan_delete_objects
mchanan Mar 25, 2020
192b7b3
remove_alligned_aloc
cspungin Mar 25, 2020
82ba924
Merge branch 'cspungin_aligment' of https://github.com/IntelRealSense…
cspungin Mar 25, 2020
135b6b6
remove include
cspungin Mar 25, 2020
74007ce
Merge branch 'master' into cspungin_aligment
cspungin Mar 25, 2020
bfd02ea
Merge pull request #195 from IntelRealSense/cspungin_aligment
cspungin Mar 25, 2020
c1a73df
ev_mp changes (#194)
apuzhevi Mar 26, 2020
9426f24
zlib leftovers
apuzhevi Mar 26, 2020
9c25ae8
Disable add network device when not available
dorodnic Mar 25, 2020
43294e9
Disable global time on RPi
dorodnic Mar 26, 2020
2aee7cc
Restoring unit-tests
dorodnic Mar 26, 2020
58d11a2
Merge remote-tracking branch 'origin/development' into ethernet
dorodnic Mar 26, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMake/global_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ macro(global_set_flags)
include(libusb_config)
endif()

if(BUILD_NETWORK_DEVICE)
add_definitions(-DNET_DEVICE)
set(LRS_NET_TARGET realsense2-net)
endif()

add_definitions(-D${BACKEND} -DUNICODE)
endmacro()

Expand Down
1 change: 1 addition & 0 deletions CMake/lrs_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ option(BUILD_OPENNI2_BINDINGS "Build OpenNI bindings" OFF)
option(IMPORT_DEPTH_CAM_FW "Download the latest firmware for the depth cameras" ON)
option(BUILD_CV_KINFU_EXAMPLE "Build OpenCV KinectFusion example" OFF)
option(FORCE_RSUSB_BACKEND "Use RS USB backend, mandatory for Win7/MacOS/Android, optional for Linux" OFF)
option(BUILD_NETWORK_DEVICE "Build Network Device support" OFF)
option(FORCE_LIBUVC "Explicitly turn-on libuvc backend - deprecated, use FORCE_RSUSB_BACKEND instead" OFF)
option(FORCE_WINUSB_UVC "Explicitly turn-on winusb_uvc (for win7) backend - deprecated, use FORCE_RSUSB_BACKEND instead" OFF)
option(ANDROID_USB_HOST_UVC "Build UVC backend for Android - deprecated, use FORCE_RSUSB_BACKEND instead" OFF)
12 changes: 12 additions & 0 deletions CMake/realsense2-netConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@PACKAGE_INIT@

set(realsense2-net_VERSION_MAJOR "@REALSENSE_VERSION_MAJOR@")
set(realsense2-net_VERSION_MINOR "@REALSENSE_VERSION_MINOR@")
set(realsense2-net_VERSION_PATCH "@REALSENSE_VERSION_PATCH@")

set(realsense2-net_VERSION ${realsense2-net_VERSION_MAJOR}.${realsense2-net_VERSION_MINOR}.${realsense2-gl_VERSION_PATCH})

set_and_check(realsense2-net_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")

include("${CMAKE_CURRENT_LIST_DIR}/realsense2-netTargets.cmake")
set(realsense2-net_LIBRARY realsense2-net::realsense2-net)
1 change: 1 addition & 0 deletions CMake/unix_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ macro(os_set_flags)
if(${MACHINE} MATCHES "arm-linux-gnueabihf")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpu=neon -mfloat-abi=hard -ftree-vectorize -latomic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon -mfloat-abi=hard -ftree-vectorize -latomic")
add_definitions(-DRASPBERRY_PI)
elseif(${MACHINE} MATCHES "aarch64-linux-gnu")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mstrict-align -ftree-vectorize")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mstrict-align -ftree-vectorize")
Expand Down
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ if(BUILD_UNIT_TESTS)
add_subdirectory(unit-tests)
endif()

if(BUILD_NETWORK_DEVICE)
add_subdirectory(src/ethernet)
add_subdirectory(src/compression)
endif()

if(BUILD_WITH_TM2)
add_tm2()
endif()
Expand Down
48 changes: 30 additions & 18 deletions common/model-views.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5339,8 +5339,9 @@ namespace rs2
// draw device header
////////////////////////////////////////
const bool is_playback_device = dev.is<playback>();
bool is_ip_device = dev.supports(RS2_CAMERA_INFO_IP_ADDRESS);
auto header_h = panel_height;
if (is_playback_device) header_h += 15;
if (is_playback_device || is_ip_device) header_h += 15;

ImColor device_header_background_color = title_color;
const float left_space = 3.f;
Expand Down Expand Up @@ -5372,28 +5373,39 @@ namespace rs2
std::stringstream ss;
if(dev.supports(RS2_CAMERA_INFO_NAME))
ss << dev.get_info(RS2_CAMERA_INFO_NAME);
ImGui::Text(" %s", ss.str().c_str());
if (dev.supports(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR))
if(is_ip_device)
{
std::string desc = dev.get_info(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR);
ss.str("");
ss << " " << textual_icons::usb_type << " " << desc;
ImGui::SameLine();
if (!starts_with(desc, "3.")) ImGui::PushStyleColor(ImGuiCol_Text, yellow);
else ImGui::PushStyleColor(ImGuiCol_Text, light_grey);
ImGui::Text(" %s", ss.str().c_str());
ImGui::PopStyleColor();
ss.str("");
ss << "The camera was detected by the OS as connected to a USB " << desc << " port";
ImGui::Text(" %s", ss.str().substr(0, ss.str().find("\n IP Device")).c_str());

ImGui::PushFont(window.get_font());
ImGui::PushStyleColor(ImGuiCol_Text, light_grey);
if (ImGui::IsItemHovered())
ImGui::SetTooltip(" %s", ss.str().c_str());
ImGui::PopStyleColor();
ImGui::Text("\tNetwork Device at %s", dev.get_info(RS2_CAMERA_INFO_IP_ADDRESS));
ImGui::PopFont();
}
else
{
ImGui::Text(" %s", ss.str().c_str());


if (dev.supports(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR))
{
std::string desc = dev.get_info(RS2_CAMERA_INFO_USB_TYPE_DESCRIPTOR);
ss.str("");
ss << " " << textual_icons::usb_type << " " << desc;
ImGui::SameLine();
if (!starts_with(desc, "3.")) ImGui::PushStyleColor(ImGuiCol_Text, yellow);
else ImGui::PushStyleColor(ImGuiCol_Text, light_grey);
ImGui::Text(" %s", ss.str().c_str());
ImGui::PopStyleColor();
ss.str("");
ss << "The camera was detected by the OS as connected to a USB " << desc << " port";
ImGui::PushFont(window.get_font());
ImGui::PushStyleColor(ImGuiCol_Text, light_grey);
if (ImGui::IsItemHovered())
ImGui::SetTooltip(" %s", ss.str().c_str());
ImGui::PopStyleColor();
ImGui::PopFont();
}
}

//ImGui::Text(" %s", dev.get_info(RS2_CAMERA_INFO_NAME));
ImGui::PopFont();

Expand Down
2 changes: 2 additions & 0 deletions common/model-views.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ namespace rs2
static const char* show_map_ruler { "viewer_model.show_map_ruler" };
static const char* show_stream_details { "viewer_model.show_stream_details" };
static const char* metric_system { "viewer_model.metric_system" };

static const char* last_ip { "viewer_model.last_ip" };
}
namespace window
{
Expand Down
17 changes: 17 additions & 0 deletions config/librealsense-net.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
includedir=${prefix}/include
#TODO: libdir=${exec_prefix}/lib@MULTI_ARCH_SUFFIX@
libdir= ${prefix}/lib/x86_64-linux-gnu

Name: realsense2-gl
Description: Intel(R) RealSense(tm) Network Device Extension Module
Version: @REALSENSE-NET_VERSION_STRING@
URL: https://github.com/IntelRealSense/librealsense
Requires.private: @LRS_LIB_NAME@
Libs: -L${libdir} -l@LRS_LIB_NAME@
Libs.private: @LRS_PKG_LIBS@
Cflags: -I${includedir}

#TODO check -Wl -Bdynamic
#Libs: -L${libdir} -Wl,-Bdynamic -lrealsense
29 changes: 29 additions & 0 deletions include/librealsense2-net/rs_net.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/* License: Apache 2.0. See LICENSE file in root directory.
Copyright(c) 2020 Intel Corporation. All Rights Reserved. */

/** \file rs_net.h
* \
* Exposes RealSense network device functionality for C compilers
*/

#ifndef LIBREALSENSE_RS2_NET_H
#define LIBREALSENSE_RS2_NET_H

#ifdef __cplusplus
extern "C" {
#endif

#include "librealsense2/rs.h"

/**
* Net device is a rs2_device that can be stream and be contolled remotely over network
* \param[in] api_version Users are expected to pass their version of \c RS2_API_VERSION to make sure they are running the correct librealsense version.
* \param[in] address remote devce ip address. should be the address of the hosting device
* \param[out] error if non-null, receives any error that occurs during this call, otherwise, errors are ignored
*/
rs2_device* rs2_create_net_device(int api_version, const char* address, rs2_error** error);

#ifdef __cplusplus
}
#endif
#endif
47 changes: 47 additions & 0 deletions include/librealsense2-net/rs_net.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// License: Apache 2.0. See LICENSE file in root directory.
// Copyright(c) 2020 Intel Corporation. All Rights Reserved.

#ifndef LIBREALSENSE_RS2_NET_HPP
#define LIBREALSENSE_RS2_NET_HPP

#include <librealsense2/rs.hpp>
#include "rs_net.h"

#include <memory>

namespace rs2
{
class net_device : public rs2::device
{
public:
net_device(const std::string& address) : rs2::device(init(address)) { }

/**
* Add network device to existing context.
* Any future queries on the context will return this device.
* This operation cannot be undone (except for destroying the context)
*
* \param[in] ctx context to add the device to
*/
void add_to(context& ctx)
{
rs2_error* e = nullptr;
rs2_context_add_software_device(((std::shared_ptr<rs2_context>)ctx).get(), _dev.get(), &e);
error::handle(e);
}


private:
std::shared_ptr<rs2_device> init(const std::string& address)
{
rs2_error* e = nullptr;
auto dev = std::shared_ptr<rs2_device>(
rs2_create_net_device(RS2_API_VERSION, address.c_str(), &e),
rs2_delete_device);
error::handle(e);

return dev;
}
};
}
#endif // LIBREALSENSE_RS2_NET_HPP
1 change: 1 addition & 0 deletions include/librealsense2/h/rs_sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ typedef enum rs2_camera_info {
RS2_CAMERA_INFO_PRODUCT_LINE , /**< Device product line D400/SR300/L500/T200 */
RS2_CAMERA_INFO_ASIC_SERIAL_NUMBER , /**< ASIC serial number */
RS2_CAMERA_INFO_FIRMWARE_UPDATE_ID , /**< Firmware update ID */
RS2_CAMERA_INFO_IP_ADDRESS , /**< IP address for remote camera. */
RS2_CAMERA_INFO_COUNT /**< Number of enumeration values. Not a valid input: intended to be used in for-loops. */
} rs2_camera_info;
const char* rs2_camera_info_to_string(rs2_camera_info info);
Expand Down
14 changes: 8 additions & 6 deletions include/librealsense2/hpp/rs_internal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,23 +259,25 @@ namespace rs2

class software_device : public device
{
std::shared_ptr<rs2_device> create_device_ptr()
std::shared_ptr<rs2_device> create_device_ptr(std::function<void(rs2_device*)> deleter)
{
rs2_error* e = nullptr;
std::shared_ptr<rs2_device> dev(
rs2_create_software_device(&e),
rs2_delete_device);
deleter);
error::handle(e);
return dev;
}

public:
software_device()
: device(create_device_ptr())
{}
software_device(std::function<void(rs2_device*)> deleter = &rs2_delete_device)
: device(create_device_ptr(deleter))
{
this->set_destruction_callback([]{});
}

software_device(std::string name)
: device(create_device_ptr())
: device(create_device_ptr(&rs2_delete_device))
{
update_info(RS2_CAMERA_INFO_NAME, name);
}
Expand Down
6 changes: 6 additions & 0 deletions scripts/setup_network_queues.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash -e

echo 8388608 > /proc/sys/net/core/wmem_default
echo 8388608 > /proc/sys/net/core/rmem_default

echo "Setting-up network queues successfully changed"
65 changes: 65 additions & 0 deletions src/compression/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# License: Apache 2.0. See LICENSE file in root directory.
# Copyright(c) 2019 Intel Corporation. All Rights Reserved.
cmake_minimum_required(VERSION 3.1.0)

project(realsense2-compression VERSION 1.0.0 LANGUAGES CXX C)

# Save the command line compile commands in the build output
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)

set(DEPENDENCIES ${DEPENDENCIES} realsense2)

file(GLOB COMPRESSION_SOURCES
"*.h"
"*.cpp"
"../ipDeviceCommon/*.h"
)

set(COMPRESSION_SOURCES ${COMPRESSION_SOURCES} ${LZ4_DIR}/lz4.h ${LZ4_DIR}/lz4.c)

add_library(${PROJECT_NAME} STATIC ${COMPRESSION_SOURCES})

include_directories(${PROJECT_NAME}
../../common
../ipDeviceCommon
../../third-party/easyloggingpp/src
)

target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)
#set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11)

add_dependencies(${PROJECT_NAME}
libjpeg-turbo
)

include_directories(${PROJECT_NAME}
${CMAKE_BINARY_DIR}/libjpeg-turbo/include
${LZ4_DIR}
)

if(WIN32)
target_link_libraries(${PROJECT_NAME}
PRIVATE ${DEPENDENCIES}
PRIVATE ${CMAKE_BINARY_DIR}/libjpeg-turbo/lib/turbojpeg-static.lib
)
else()
target_link_libraries(${PROJECT_NAME}
PRIVATE ${DEPENDENCIES}
PRIVATE ${CMAKE_BINARY_DIR}/libjpeg-turbo/lib/libturbojpeg.a
)
endif()

set_target_properties (${PROJECT_NAME} PROPERTIES FOLDER "Library")

set(CMAKECONFIG_COMPRESS_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
install(TARGETS ${PROJECT_NAME}
EXPORT realsense2-compressTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

install(EXPORT realsense2-compressTargets
FILE realsense2-compressTargets.cmake
NAMESPACE ${PROJECT_NAME}::
DESTINATION ${CMAKECONFIG_COMPRESS_INSTALL_DIR}
)
Loading