At least in openCV 4.8, you can flip in place (with both cv::Mat and cv::UMat).
A possible sample code:
// buffer is a pointer to data, for example:
// uint8_t* buffer = new uint8_t[w*h*4]
// CV_8UC4 means unsigned byte, 4 channel image (for example RGBA)
// UMat allows to use GPU acceleration, it may be useful or not depending
// on the scenario, or you can simply just use cv::Mat.
cv::UMat m = cv::Mat(h , w, CV_8UC4, buffer).getUMat(cv::ACCESS_READ);
// flip accepts a flag that can be 0, <0 or >0
// here I put zero cause if the image is taken in landscape mode, although // looks like it needs vertical mirroring, it is actually horizontal. So you // may want to try the various options if 1 doesn't work as expected
flip(m, m, 0);