jiangdongguo / AndroidUSBCamera

🔥🔥🔥Flexible and useful UVC camera engine on Android platform, supporting multi-road cameras!

Home Page:https://juejin.cn/post/7115229806844706847

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Black Screen After Format Change

RobbieElias opened this issue · comments

Hello,

The app works great when first booted. But if I switch the video format (e.g. 1080p 30FPS YUV to 720p 30FPS YUV), then the preview turns black and no more frames come in. I have to unplug device to make it work again.

I am using a capture card based on the ms2130 chip. I have tested using the USB camera app on the Play Store and it works fine on there.

Appreciate any help!

Finally was able to figure it out. I think this could be helpful to some. Change the following lines in the stream.c file:

case LIBUSB_TRANSFER_ERROR:
	UVC_DEBUG("not retrying transfer, status = %d", transfer->status);
//	MARK("not retrying transfer, status = %d", transfer->status);
//	_uvc_delete_transfer(transfer);
	resubmit = 0;
	break;

To:

case LIBUSB_TRANSFER_ERROR:
	libusb_clear_halt(strmh->devh->usb_devh, strmh->stream_if->bEndpointAddress);
	UVC_DEBUG("not retrying transfer, status = %d", transfer->status);
//	MARK("not retrying transfer, status = %d", transfer->status);
//	_uvc_delete_transfer(transfer);
	resubmit = 0;
	break;