From 95ef103fe6f271eeb6ba25f8d497cb8532581ba8 Mon Sep 17 00:00:00 2001 From: kallaballa Date: Mon, 14 Nov 2022 12:45:23 +0100 Subject: [PATCH] minor improvements to comments and order of exec --- src/nanovg/nanovg-demo.cpp | 2 +- src/tetra/tetra-demo.cpp | 4 ++-- src/video/video-demo.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/nanovg/nanovg-demo.cpp b/src/nanovg/nanovg-demo.cpp index 4865cbda5..5c52f1eb4 100644 --- a/src/nanovg/nanovg-demo.cpp +++ b/src/nanovg/nanovg-demo.cpp @@ -248,7 +248,7 @@ int main(int argc, char **argv) { //Activate the OpenCL context for VAAPI va::bind(); - //The frameBuffer is upside-down. Flip videoFrame. (OpenCL) + //The videoFrame is upside-down. Flip. (OpenCL) cv::flip(videoFrame, videoFrame, 0); //Encode the frame using VAAPI on the GPU. writer.write(videoFrame); diff --git a/src/tetra/tetra-demo.cpp b/src/tetra/tetra-demo.cpp index 451699060..e3590ce70 100644 --- a/src/tetra/tetra-demo.cpp +++ b/src/tetra/tetra-demo.cpp @@ -125,8 +125,6 @@ int main(int argc, char **argv) { glow_effect(frameBuffer); //Color-conversion from BGRA to RGB. OpenCV/OpenCL. cv::cvtColor(frameBuffer, videoFrame, cv::COLOR_BGRA2RGB); - //Video frame is upside down -> flip it (OpenCL) - cv::flip(videoFrame, videoFrame, 0); //Release the frame buffer for use by OpenGL gl::release_to_gl(frameBuffer); @@ -144,6 +142,8 @@ int main(int argc, char **argv) { //Activate the OpenCL context for VAAPI va::bind(); + //Video frame is upside down because the frameBuffer is. -> flip it (OpenCL) + cv::flip(videoFrame, videoFrame, 0); //Encode the frame using VAAPI on the GPU. encoder.write(videoFrame); diff --git a/src/video/video-demo.cpp b/src/video/video-demo.cpp index de6b7e2c5..faec77fa5 100644 --- a/src/video/video-demo.cpp +++ b/src/video/video-demo.cpp @@ -168,8 +168,6 @@ int main(int argc, char **argv) { glow_effect(frameBuffer); //Color-conversion from BGRA to RGB. (OpenCL) cv::cvtColor(frameBuffer, videoFrame, cv::COLOR_BGRA2RGB); - //Video frame is upside down -> flip it (OpenCL) - cv::flip(videoFrame, videoFrame, 0); //Release the frame buffer for use by OpenGL gl::release_to_gl(frameBuffer); @@ -187,6 +185,8 @@ int main(int argc, char **argv) { //Activate the OpenCL context for VAAPI va::bind(); + //Video frame is upside down -> flip it (OpenCL) + cv::flip(videoFrame, videoFrame, 0); //Encode the frame using VAAPI on the GPU. writer.write(videoFrame);