Skip to content

Commit

Permalink
Fix Y8 (GRAY8) format string error. (I'm not sure if it's a bug or no…
Browse files Browse the repository at this point in the history
…t, but my camera sends 'Y8 ' instead of 'Y800' which is defined in the original libuvc code.
  • Loading branch information
seiya0412 committed Apr 25, 2018
1 parent 77b43d6 commit e1e950a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ struct format_table_entry *_get_format_entry(enum uvc_frame_format format) {
FMT(UVC_FRAME_FORMAT_UYVY,
{'U', 'Y', 'V', 'Y', 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71})
FMT(UVC_FRAME_FORMAT_GRAY8,
{'Y', '8', '0', '0', 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71})
{'Y', '8', ' ', ' ', 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71})
FMT(UVC_FRAME_FORMAT_GRAY16,
{'Y', '1', '6', ' ', 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71})
FMT(UVC_FRAME_FORMAT_BY8,
Expand Down Expand Up @@ -140,6 +140,9 @@ static uint8_t _uvc_frame_format_matches_guid(enum uvc_frame_format fmt, uint8_t
struct format_table_entry *format;
int child_idx;

UVC_DEBUG("uvc_frame_format: %d, guid: %c%c%c%c 0x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", fmt,
guid[0],guid[1],guid[2],guid[3],guid[4],guid[5],guid[6],guid[7],guid[8],guid[9],guid[10],guid[11],guid[12],guid[13],guid[14],guid[15]);

format = _get_format_entry(fmt);
if (!format)
return 0;
Expand Down Expand Up @@ -375,6 +378,7 @@ uvc_error_t uvc_get_stream_ctrl_format_size(
continue;

DL_FOREACH(format->frame_descs, frame) {
UVC_DEBUG("frame->wWidth=%d, width=%d, frame->wHeight=%d, height=%d", frame->wWidth, width, frame->wHeight, height);
if (frame->wWidth != width || frame->wHeight != height)
continue;

Expand Down

0 comments on commit e1e950a

Please sign in to comment.