31 typedef std::function<void(std::shared_ptr<Frame> frame)>
FrameCallback;
41 sensor.impl_ =
nullptr;
50 sensor.impl_ =
nullptr;
85 return std::make_shared<StreamProfileList>(list);
99 std::vector<std::shared_ptr<Filter>> filters;
100 for(uint32_t i = 0; i < filter_count; i++) {
103 filters.push_back(std::make_shared<Filter>(filterImpl));
119 ob_sensor_start(
impl_,
const_cast<ob_stream_profile_t *
>(streamProfile->getImpl()), &Sensor::frameCallback,
this, &error);
144 static void frameCallback(
ob_frame *frame,
void *userData) {
145 auto sensor =
static_cast<Sensor *
>(userData);
146 sensor->
callback_(std::make_shared<Frame>(frame));
162 ob_sensor_list_t *impl_ =
nullptr;
204 std::shared_ptr<Sensor>
getSensor(uint32_t index)
const {
208 return std::make_shared<Sensor>(sensor);
221 return std::make_shared<Sensor>(sensor);
Device related types, including operations such as getting and creating a device, setting and obtaini...
This file defines the Error class, which describes abnormal errors within the SDK....
The processing unit of the SDK can perform point cloud generation, format conversion and other functi...
OB_EXPORT void ob_delete_filter_list(ob_filter_list *filter_list, ob_error **error)
Delete a list of ob_filter objects.
OB_EXPORT ob_filter * ob_filter_list_get_filter(const ob_filter_list *filter_list, uint32_t index, ob_error **error)
Get the filter by index.
OB_EXPORT uint32_t ob_filter_list_get_count(const ob_filter_list *filter_list, ob_error **error)
Get the number of filter in the list.
This file contains the Filter class, which is the processing unit of the SDK that can perform point c...
Frame related type, which is mainly used to obtain frame data and frame information.
struct ob_frame_t ob_frame
OBSensorType
Enumeration value describing the sensor type.
Defines types related to sensors, used for obtaining stream configurations, opening and closing strea...
OB_EXPORT ob_sensor * ob_sensor_list_get_sensor(const ob_sensor_list *sensor_list, uint32_t index, ob_error **error)
Get a sensor by index number.
OB_EXPORT void ob_delete_sensor_list(ob_sensor_list *sensor_list, ob_error **error)
Delete a list of sensor objects.
OB_EXPORT void ob_sensor_stop(ob_sensor *sensor, ob_error **error)
Stop the sensor stream.
OB_EXPORT void ob_sensor_switch_profile(ob_sensor *sensor, ob_stream_profile *profile, ob_error **error)
Switch resolutions.
OB_EXPORT ob_sensor_type ob_sensor_list_get_sensor_type(const ob_sensor_list *sensor_list, uint32_t index, ob_error **error)
Get the sensor type.
OB_EXPORT ob_sensor * ob_sensor_list_get_sensor_by_type(const ob_sensor_list *sensor_list, ob_sensor_type sensorType, ob_error **error)
Get a sensor by sensor type.
OB_EXPORT void ob_delete_sensor(ob_sensor *sensor, ob_error **error)
Delete a sensor object.
OB_EXPORT uint32_t ob_sensor_list_get_count(const ob_sensor_list *sensor_list, ob_error **error)
Get the number of sensors in the sensor list.
OB_EXPORT ob_sensor_type ob_sensor_get_type(const ob_sensor *sensor, ob_error **error)
Get the type of the sensor.
OB_EXPORT ob_stream_profile_list * ob_sensor_get_stream_profile_list(const ob_sensor *sensor, ob_error **error)
Get a list of all supported stream profiles.
OB_EXPORT ob_filter_list * ob_sensor_create_recommended_filter_list(const ob_sensor *sensor, ob_error **error)
Create a list of recommended filters for the specified sensor.
OB_EXPORT void ob_sensor_start(ob_sensor *sensor, const ob_stream_profile *profile, ob_frame_callback callback, void *user_data, ob_error **error)
Open the current sensor and set the callback data frame.
The stream profile related type is used to get information such as the width, height,...
static void handle(ob_error **error, bool throw_exception=true)
A static function to handle the ob_error and throw an exception if needed.
OBSensorType getType() const
Get the sensor type.
std::function< void(std::shared_ptr< Frame > frame)> FrameCallback
Callback function for frame data.
Sensor(ob_sensor_t *impl)
std::vector< std::shared_ptr< Filter > > createRecommendedFilters() const
Create a list of recommended filters for the sensor.
OBSensorType type() const
void start(std::shared_ptr< StreamProfile > streamProfile, FrameCallback callback)
Open a frame data stream and set up a callback.
std::shared_ptr< StreamProfileList > getStreamProfileList() const
Get the list of stream profiles.
Sensor & operator=(Sensor &&sensor) noexcept
virtual ~Sensor() noexcept
Sensor(Sensor &&sensor) noexcept
Sensor & operator=(const Sensor &sensor)=delete
void stop() const
Stop the stream.
Sensor(const Sensor &sensor)=delete
std::vector< std::shared_ptr< Filter > > getRecommendedFilters() const
void switchProfile(std::shared_ptr< StreamProfile > streamProfile)
Dynamically switch resolutions.
uint32_t getCount() const
Get the number of sensors.
std::shared_ptr< Sensor > getSensor(OBSensorType sensorType) const
Get a sensor by sensor type.
OBSensorType getSensorType(uint32_t index) const
Get the type of the specified sensor.
std::shared_ptr< Sensor > getSensor(uint32_t index) const
Get a sensor by index number.
OBSensorType type(uint32_t index) const
SensorList(ob_sensor_list_t *impl)
The error class exposed by the SDK, users can get detailed error information according to the error.