|
|
|
@ -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); |
|
|
|
|
|
|
|
|
|