18 #define STREAM RS2_STREAM_COLOR // rs2_stream is a types of data provided by RealSense device // 19 #define FORMAT RS2_FORMAT_RGB8 // rs2_format identifies how binary data is encoded within a frame // 20 #define WIDTH 640 // Defines the number of columns for each frame // 21 #define HEIGHT 480 // Defines the number of lines for each frame // 22 #define FPS 30 // Defines the rate of frames per second // 23 #define STREAM_INDEX 0 // Defines the stream index, used for multiple streams of the same type // 43 printf(
"There are %d connected RealSense devices.\n", dev_count);
73 printf(
"The connected device doesn't support color streaming!\n");
90 for (i = 0; i < num_of_frames; ++
i)
113 printf(
"RGB frame arrived.\n");
114 printf(
"First 10 bytes: ");
116 for(i=0; i < 10; ++
i)
117 printf(
"%02x ", rgb_frame_data[i]);
119 printf(
"\nFrame No: %llu\n", frame_number);
120 printf(
"Timestamp: %f\n", frame_timestamp);
121 printf(
"Timestamp domain: %s\n", frame_timestamp_domain_str);
122 printf(
"Time of arrival: %lld\n\n", frame_metadata_time_of_arrival);
void rs2_config_enable_stream(rs2_config *config, rs2_stream stream, int index, int width, int height, rs2_format format, int framerate, rs2_error **error)
void print_device_info(rs2_device *dev)
Exposes RealSense processing-block functionality for C compilers.
rs2_device_list * rs2_query_devices(const rs2_context *context, rs2_error **error)
const char * rs2_timestamp_domain_to_string(rs2_timestamp_domain info)
void rs2_delete_device(rs2_device *device)
rs2_context * rs2_create_context(int api_version, rs2_error **error)
Creates RealSense context that is required for the rest of the API.
rs2_config * rs2_create_config(rs2_error **error)
void rs2_delete_context(rs2_context *context)
Frees the relevant context object.
rs2_pipeline * rs2_create_pipeline(rs2_context *ctx, rs2_error **error)
rs2_device * rs2_create_device(const rs2_device_list *info_list, int index, rs2_error **error)
rs2_time_t rs2_get_frame_timestamp(const rs2_frame *frame, rs2_error **error)
void check_error(rs2_error *e)
Exposes librealsense functionality for C compilers.
rs2_frame * rs2_pipeline_wait_for_frames(rs2_pipeline *pipe, unsigned int timeout_ms, rs2_error **error)
Exposes RealSense frame functionality for C compilers.
int rs2_embedded_frames_count(rs2_frame *composite, rs2_error **error)
rs2_timestamp_domain rs2_get_frame_timestamp_domain(const rs2_frame *frameset, rs2_error **error)
#define RS2_DEFAULT_TIMEOUT
unsigned long long rs2_get_frame_number(const rs2_frame *frame, rs2_error **error)
static const textual_icon exit
rs2_pipeline_profile * rs2_pipeline_start_with_config(rs2_pipeline *pipe, rs2_config *config, rs2_error **error)
long long rs2_metadata_type
void rs2_pipeline_stop(rs2_pipeline *pipe, rs2_error **error)
void rs2_delete_config(rs2_config *config)
void rs2_release_frame(rs2_frame *frame)
rs2_frame * rs2_extract_frame(rs2_frame *composite, int index, rs2_error **error)
rs2_metadata_type rs2_get_frame_metadata(const rs2_frame *frame, rs2_frame_metadata_value frame_metadata, rs2_error **error)
void rs2_delete_device_list(rs2_device_list *info_list)
void rs2_delete_pipeline_profile(rs2_pipeline_profile *profile)
int rs2_get_device_count(const rs2_device_list *info_list, rs2_error **error)
void rs2_delete_pipeline(rs2_pipeline *pipe)
struct rs2_frame rs2_frame
const void * rs2_get_frame_data(const rs2_frame *frame, rs2_error **error)
rs2_timestamp_domain
Specifies the clock in relation to which the frame timestamp was measured.