comments and renaming

pull/3471/head
kallaballa 3 years ago
parent 82e87fe641
commit a1ef1e4798
  1. 12
      src/camera/camera-demo.cpp

@ -124,18 +124,16 @@ int main(int argc, char **argv) {
cv::UMat frameBuffer; cv::UMat frameBuffer;
cv::UMat videoFrame; cv::UMat videoFrame;
cv::UMat videoOutFrame;
cv::UMat videoFrameRGBA; cv::UMat videoFrameRGBA;
render();
uint64_t cnt = 1; uint64_t cnt = 1;
int64 start = cv::getTickCount(); int64 start = cv::getTickCount();
double tickFreq = cv::getTickFrequency(); double tickFreq = cv::getTickFrequency();
while (true) { while (true) {
//Activate the OpenCL context for OpenGL
GL_CONTEXT.bind(); GL_CONTEXT.bind();
//Initially get the framebuffer so we can write the video frame to it
gl::fetch_frame_buffer(frameBuffer); gl::fetch_frame_buffer(frameBuffer);
//Activate the OpenCL context for VAAPI //Activate the OpenCL context for VAAPI
@ -165,13 +163,13 @@ int main(int argc, char **argv) {
glow(frameBuffer); glow(frameBuffer);
//Color-conversion from BGRA to RGB. (OpenCL) //Color-conversion from BGRA to RGB. (OpenCL)
cv::cvtColor(frameBuffer, videoOutFrame, cv::COLOR_BGRA2RGB); cv::cvtColor(frameBuffer, videoFrame, cv::COLOR_BGRA2RGB);
cv::flip(videoOutFrame, videoOutFrame, 0); cv::flip(videoFrame, videoFrame, 0);
//Activate the OpenCL context for VAAPI //Activate the OpenCL context for VAAPI
VA_CONTEXT.bind(); VA_CONTEXT.bind();
//Encode the frame using VAAPI on the GPU. //Encode the frame using VAAPI on the GPU.
video.write(videoOutFrame); video.write(videoFrame);
if(x11::is_initialized()) { if(x11::is_initialized()) {
//Yet again activate the OpenCL context for OpenGL //Yet again activate the OpenCL context for OpenGL

Loading…
Cancel
Save