cv::VideoCapture::read() empty frames

Hello OpenCV Community

On Android C++ I’m getting empty frames from cv::VideoCapture:read() basically im doing this:

VideoCapture camera;
camera.open(index, mode);

if (camera.isOpened())//it's ok here
    return 0.0;
    
cv::Mat frame;
bool ret = camera.read(frame);//return true

//buff_img it's my buffer that I send to surface, but on android it's empty
std::memcpy(buff_img, frame_.data, frame_.total()*4);

This code works perfectly on Windows, iOS, MacOS and I need make it work on Android

Exactly same issue was experimented by someone else in this post: How to open camera with cv::VideoCapture in Android Native C++ - Stack Overflow

First the problem was build the custom framework and get video features and now are that frames are empty.

(I can see that the camera it’s opened, due a light that appear when the camera it’s on use)

Any idea of how handle it?

Regards

@berak Can you take a look? (sorry for the tag)

Well, after a some research I succeed it avoiding read() and working on the JAVA side based in this file: opencv/modules/java/generator/android-24/java/org/opencv/android/NativeCameraView.java at 3aefd4862c5ee92918e15d96e9973cbfde48e5c2 · opencv/opencv · GitHub