Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rs-software-device example doesn't track bytes_per_pixel properly #1377

Closed
jjoachim opened this issue Mar 16, 2018 · 3 comments
Closed

rs-software-device example doesn't track bytes_per_pixel properly #1377

jjoachim opened this issue Mar 16, 2018 · 3 comments

Comments

@jjoachim
Copy link

Required Info
Camera Model D415
Firmware Version 05.08.15.00)
Operating System & Version Ubuntu 16
Kernel Version (Linux Only)
Platform PC
SDK Version 2.10.2

While debugging my own issues, I noticed that get_bytes_per_pixel() gives 0 for synthetic frames. In the rs-software-device example, I modified the code a bit to the following to reproduce the issue:

if (auto as_depth = depth.as<rs2::depth_frame>()) {
  std::cout << as_depth.get_bytes_per_pixel() << std::endl;
  points = pc.calculate(as_depth);
}

I noticed that in the function on_video_frame(), if you multiply the input BPP by 8 you get the correct answer (which is 2). It's as if the input was expecting bits_per_pixel. The rs2_software_video_frame struct, which is the input to on_video_frame, has a data member bpp. The example uses this as if it were bytes_per_pixel, but does it actually mean bits_per_pixel?

@zivsha
Copy link
Contributor

zivsha commented Mar 16, 2018

Hi @jjoachim ,
Looks like a bug in:

vid_frame->assign(vid_profile->get_width(), vid_profile->get_height(), software_frame.stride, software_frame.bpp);

Should be software_frame.bpp * 8 I think

@dorodnic
Copy link
Contributor

Thank you, @jjoachim
We will try to fix ASAP, feel free to open a pull-request if you would like.

ev-mp added a commit that referenced this issue Mar 21, 2018
Fixing an issue with bpp of software device. addressing #1377
@dorodnic
Copy link
Contributor

Should be resolved in v2.10.2, thank you for bringing-it up. Please feel free to open new issues if you still encounter any problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants