-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Android error handling fix #4032
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -938,19 +938,27 @@ void stream_thread(usbhost_uvc_stream_context *strctx) { | |
} | ||
}); | ||
LOG_DEBUG("Transfer thread started for endpoint address: " << strctx->endpoint); | ||
bool disconnect = false; | ||
do { | ||
auto i = strctx->stream->stream_if->interface; | ||
uint32_t transferred = 0; | ||
auto sts = messenger->bulk_transfer(read_ep, strctx->stream->outbuf, LIBUVC_XFER_BUF_SIZE, transferred, 1000); | ||
if(sts != librealsense::platform::RS2_USB_STATUS_SUCCESS) | ||
switch(sts) | ||
{ | ||
if(sts == librealsense::platform::RS2_USB_STATUS_NO_DEVICE) | ||
case librealsense::platform::RS2_USB_STATUS_NO_DEVICE: | ||
disconnect = true; | ||
break; | ||
case librealsense::platform::RS2_USB_STATUS_OVERFLOW: | ||
messenger->reset_endpoint(read_ep, reset_ep_timeout); | ||
break; | ||
case librealsense::platform::RS2_USB_STATUS_SUCCESS: | ||
strctx->stream->got_bytes = transferred; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is the name in all of our UVC implementations, we can change it when moving to rsuvc There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am using libuvc under Android, how can I handle the error? |
||
usbhost_uvc_process_payload(strctx->stream, &archive, &queue); | ||
break; | ||
default: | ||
break; | ||
continue; | ||
} | ||
strctx->stream->got_bytes = transferred; | ||
usbhost_uvc_process_payload(strctx->stream, &archive, &queue); | ||
} while (strctx->stream->running); | ||
} while (!disconnect && strctx->stream->running); | ||
|
||
int ep = strctx->endpoint; | ||
messenger->reset_endpoint(read_ep, reset_ep_timeout); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you use hard-coded timeouts ? (1000, 50)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will create a define, it is not accessible to the app level