Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mobile_robotics
ADC
external
libuvc_ros
Commits
7508a09f
Commit
7508a09f
authored
Jan 25, 2016
by
Josh Villbrandt
Browse files
Enable mjpeg support despite uvs_any2bgr shortcoming
parent
b4486d97
Changes
1
Hide whitespace changes
Inline
Side-by-side
libuvc_camera/src/camera_driver.cpp
View file @
7508a09f
...
...
@@ -188,6 +188,15 @@ void CameraDriver::ImageCallback(uvc_frame_t *frame) {
}
image
->
encoding
=
"bgr8"
;
memcpy
(
&
(
image
->
data
[
0
]),
rgb_frame_
->
data
,
rgb_frame_
->
data_bytes
);
}
else
if
(
frame
->
frame_format
==
UVC_FRAME_FORMAT_MJPEG
)
{
// FIXME: uvc_any2bgr does not work on "mjpeg" format, so use uvc_mjpeg2rgb directly.
uvc_error_t
conv_ret
=
uvc_mjpeg2rgb
(
frame
,
rgb_frame_
);
if
(
conv_ret
!=
UVC_SUCCESS
)
{
uvc_perror
(
conv_ret
,
"Couldn't convert frame to RGB"
);
return
;
}
image
->
encoding
=
"rgb8"
;
memcpy
(
&
(
image
->
data
[
0
]),
rgb_frame_
->
data
,
rgb_frame_
->
data_bytes
);
}
else
{
uvc_error_t
conv_ret
=
uvc_any2bgr
(
frame
,
rgb_frame_
);
if
(
conv_ret
!=
UVC_SUCCESS
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment