Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 src/ethernet/ip_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,11 @@ void ip_device::inject_frames_loop(std::shared_ptr<rs_rtp_stream> rtp_stream)
rtp_stream.get()->is_enabled = true;

rtp_stream.get()->frame_data_buff.frame_number = 0;

/// FIXME: bbp and stride should be filled by m_rs_stream. but There are something wrong in m_rs_stream.
rtp_stream->frame_data_buff.bpp = librealsense::get_image_bpp(rtp_stream.get()->get_stream_profile().format()) / 8;
rtp_stream->frame_data_buff.stride = rtp_stream->frame_data_buff.bpp * rtp_stream->m_rs_stream.width;

int uid = rtp_stream.get()->m_rs_stream.uid;
rs2_stream type = rtp_stream.get()->m_rs_stream.type;
int sensor_id = stream_type_to_sensor_id(type);
Expand Down
1 change: 1 addition & 0 deletions tools/rs-server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ else()

include_directories(
../../common
../../src
../../src/ipDeviceCommon
../../include/librealsense2
../../third-party/tclap/include
Expand Down
12 changes: 6 additions & 6 deletions tools/rs-server/RsRTSPServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@

RsRTSPServer* RsRTSPServer::createNew(UsageEnvironment& t_env, std::shared_ptr<RsDevice> t_device, Port t_ourPort, UserAuthenticationDatabase* t_authDatabase, unsigned t_reclamationSeconds)
{
int ourSocket = setUpOurSocket(t_env, t_ourPort);
if(ourSocket == -1)
return NULL;
int ourSocketIPv4 = setUpOurSocket(t_env, t_ourPort, AF_INET);
int ourSocketIPv6 = setUpOurSocket(t_env, t_ourPort, AF_INET6);
if (ourSocketIPv4 < 0 && ourSocketIPv6 < 0) return NULL;

return new RsRTSPServer(t_env, t_device, ourSocket, t_ourPort, t_authDatabase, t_reclamationSeconds);
return new RsRTSPServer(t_env, t_device, ourSocketIPv4, ourSocketIPv6, t_ourPort, t_authDatabase, t_reclamationSeconds);
}

RsRTSPServer::RsRTSPServer(UsageEnvironment& t_env, std::shared_ptr<RsDevice> t_device, int t_ourSocket, Port t_ourPort, UserAuthenticationDatabase* t_authDatabase, unsigned t_reclamationSeconds)
: RTSPServer(t_env, t_ourSocket, t_ourPort, t_authDatabase, t_reclamationSeconds)
RsRTSPServer::RsRTSPServer(UsageEnvironment& t_env, std::shared_ptr<RsDevice> t_device, int t_ourSocketIPv4, int t_ourSocketIPv6, Port t_ourPort, UserAuthenticationDatabase* t_authDatabase, unsigned t_reclamationSeconds)
: RTSPServer(t_env, t_ourSocketIPv4, t_ourSocketIPv6, t_ourPort, t_authDatabase, t_reclamationSeconds)
, m_device(t_device)
{}

Expand Down
2 changes: 1 addition & 1 deletion tools/rs-server/RsRTSPServer.hh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public:
void setSupportedOptions(std::string t_key, std::vector<RsOption> t_supportedOptions);

protected:
RsRTSPServer(UsageEnvironment& t_env, std::shared_ptr<RsDevice> t_device, int t_ourSocket, Port t_ourPort, UserAuthenticationDatabase* t_authDatabase, unsigned t_reclamationSeconds);
RsRTSPServer(UsageEnvironment& t_env, std::shared_ptr<RsDevice> t_device, int t_ourSocketIPv4, int t_ourSocketIPv6, Port t_ourPort, UserAuthenticationDatabase* t_authDatabase, unsigned t_reclamationSeconds);
virtual ~RsRTSPServer();
char const* allowedCommandNames();

Expand Down
5 changes: 5 additions & 0 deletions tools/rs-server/RsSensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ std::vector<RsOption> RsSensor::getSupportedOptions()
RsOption option;
option.m_opt = opt;
option.m_range = m_sensor.get_option_range(opt);

/// FIXME: the default value for some option is invalid
if (option.m_range.def < option.m_range.min) option.m_range.def = option.m_range.min;
if (option.m_range.def > option.m_range.max) option.m_range.def = option.m_range.max;

returnedVector.push_back(option);
}
}
Expand Down
5 changes: 4 additions & 1 deletion wrappers/python/pyrs_net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@ PYBIND11_MODULE(NAME, m) {
m.doc() = "Wrapper for the librealsense ethernet device extension module";

py::class_<rs2::net_device> net_device(m, "net_device", device);
net_device.def(py::init<std::string>(), "address"_a);
net_device.def(py::init<std::string>(), "address"_a)
.def("add_to", &rs2::net_device::add_to, "Add net device to existing context.\n"
"Any future queries on the context will return this device.\n"
"This operation cannot be undone (except for destroying the context)", "ctx"_a);
}