Skip to content

Commit

Permalink
Define metadata constructs for kernels prior to 4.16
Browse files Browse the repository at this point in the history
Handle d4xx metadata activation
Remove debug messages

Change-Id: I415fab80f46c761603a84a63e4a1675c843830b9
  • Loading branch information
ev-mp committed Aug 26, 2018
1 parent 5fce77c commit f700dc0
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 223 deletions.
21 changes: 9 additions & 12 deletions examples/capture/rs-capture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// capture depth and color video streams and render them to the screen
int main(int argc, char * argv[]) try
{
rs2::log_to_console(RS2_LOG_SEVERITY_INFO);
rs2::log_to_console(RS2_LOG_SEVERITY_ERROR);
// Create a simple OpenGL window for rendering:
window app(1280, 720, "RealSense Capture Example");
// Declare two textures on the GPU, one for color and one for depth
Expand All @@ -19,23 +19,23 @@ int main(int argc, char * argv[]) try

// Declare RealSense pipeline, encapsulating the actual device and sensors
rs2::pipeline pipe;

rs2::config cfg;

cfg.enable_stream(RS2_STREAM_DEPTH, 640, 480, RS2_FORMAT_Z16, 30);
// Start streaming with default recommended configuration
pipe.start(cfg);
pipe.start();

while(app) // Application still alive?
{
rs2::frameset data = pipe.wait_for_frames(0xfffffff); // Wait for next set of frames from the camera
rs2::frameset data = pipe.wait_for_frames(); // Wait for next set of frames from the camera

rs2::frame depth = color_map.process(data.get_depth_frame()); // Find and colorize the depth data
//rs2::frame color = data.get_color_frame(); // Find the color data
rs2::frame color = data.get_color_frame(); // Find the color data

// For cameras that don't have RGB sensor, we'll render infrared frames instead of color
if (!color)
color = data.get_infrared_frame();

// Render depth on to the first half of the screen and color on to the second
depth_image.render(depth, { 0, 0, app.width() / 2, app.height() });
//color_image.render(color, { app.width() / 2, 0, app.width() / 2, app.height() });
color_image.render(color, { app.width() / 2, 0, app.width() / 2, app.height() });
}

return EXIT_SUCCESS;
Expand All @@ -50,6 +50,3 @@ catch (const std::exception& e)
std::cerr << e.what() << std::endl;
return EXIT_FAILURE;
}



9 changes: 0 additions & 9 deletions src/backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,6 @@ namespace librealsense
uint32_t timestamp;
uint8_t source_clock[6];
};

// struct uvc_metadata_buf
// {
// uint64_t pts;
// uint16_t sof;
// uint8_t length;
// uint8_t flags;
// uint8_t* buf;
// };
#pragma pack(pop)

constexpr uint8_t uvc_header_size = sizeof(uvc_header);
Expand Down
Loading

0 comments on commit f700dc0

Please sign in to comment.