9 #include <BasicUsageEnvironment.hh> 31 int RsSensor::open(std::unordered_map<long long int, rs2::frame_queue>& t_streamProfilesQueues)
33 std::vector<rs2::stream_profile> requestedStreamProfiles;
34 for(
auto streamProfile : t_streamProfilesQueues)
37 long long int streamProfileKey = streamProfile.first;
43 if(compressPtr !=
nullptr)
45 m_iCompress.insert(std::pair<
long long int, std::shared_ptr<ICompression>>(streamProfileKey, compressPtr));
50 *
env <<
"unsupported compression format or compression is disabled, continue without compression\n";
69 int RsSensor::start(std::unordered_map<long long int, rs2::frame_queue>& t_streamProfilesQueues)
74 if(t_streamProfilesQueues.find(profileKey) != t_streamProfilesQueues.end())
77 std::chrono::duration<double> timeSpan = std::chrono::duration_cast<std::chrono::duration<double>>(curSample -
m_prevSample[profileKey]);
81 int frameSize =
m_iCompress.at(profileKey)->compressBuffer((
unsigned char*)frame.get_data(), frame.get_data_size(), buff);
87 memcpy((
unsigned char*)frame.get_data(), buff, frameSize);
91 t_streamProfilesQueues[profileKey].enqueue(frame);
106 key += videoStreamProfile.
width() * pow(10, 4) + videoStreamProfile.
height();
125 return "Unknown Sensor";
131 std::vector<RsOption> returnedVector;
136 for(
auto opt : options)
144 returnedVector.push_back(option);
147 catch(
const std::exception&
e)
149 *
env << e.what() <<
"\n";
151 return returnedVector;
GLsizei const GLchar *const * string
std::vector< rs2_option > get_supported_options()
void returnMem(unsigned char *t_mem)
const std::string STEREO_SENSOR_NAME("Stereo Module")
static bool isCompressionSupported(rs2_format t_format, rs2_stream t_streamType)
const std::string L500_SENSOR_NAME("L500 Depth Sensor")
bool supports(rs2_camera_info info) const
static std::shared_ptr< ICompression > getObject(int t_width, int t_height, rs2_format t_format, rs2_stream t_streamType, int t_bpp)
rs2_format format() const
int getStreamProfileBpp(rs2_format t_format)
void open(const stream_profile &profile) const
option_range get_option_range(rs2_option option) const
const char * get_info(rs2_camera_info info) const
unsigned char * getNextMem()
std::vector< stream_profile > get_stream_profiles() const
rs2_stream stream_type() const
void start(T callback) const
rs2::option_range m_range