saki4510t / UVCCamera

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

Preview Delay #672

Open yangdefu168 opened 1 year ago

yangdefu168 commented 1 year ago

2592X1944 void UVCPreview::addPreviewFrame(uvc_frame_t *frame) {

pthread_mutex_lock(&preview_mutex);
if (isRunning() && (previewFrames.size() < MAX_FRAME)) {
    previewFrames.clear();//clear previewFrames
    previewFrames.put(frame);
    frame = NULL;
    pthread_cond_signal(&preview_sync);
}
pthread_mutex_unlock(&preview_mutex);
if (frame) {
    recycle_frame(frame);
}

}

add previewFrames.clear(); Preview Smooth。。 There are still 200 delays

How to preview normally

yangdefu168 commented 1 year ago

Please take a look. Thank you very much

zhouqunhuang commented 1 month ago

Hello! Have you solved it? If you have, could you please tell me how you fixed it?