saki4510t / UVCCamera

library and sample to access to UVC web camera on non-rooted Android device
2.99k stars 1.2k forks source link

Preview last frame when external camera is removed. #707

Open aaron23v opened 1 month ago

aaron23v commented 1 month ago

Just wanted to know, how can we implement this?

When the external camera is detached / removed, i want to preview the last frame and when it is attached back, it should start working as normal. Need some guidance

Clark-caipeiyuan commented 1 month ago

收到了,谢谢!

fbzhong commented 1 month ago

I would suggest you to use ImageReader & ImageWriter as a proxy between UVCCamera and Surface.

Set ImageReader as UVCCamera set preview display. And then enqueue to ImageWriter in onImageAvailable listener. Then you could always keep the last Image (into Bitmap)