For example, file “cap.cpp” contains implementation for
bool VideoCapture::read(OutputArray image)
it seems to be possible to make some tweaks to this method to get exact latest frame from capture buffer. But how to compile it for further usage in projects?