Skip to content
Snippets Groups Projects
Commit 370f22af authored by Martin Pulec's avatar Martin Pulec
Browse files

UltraGrid plugin: implement stereo mode for GPU

parent c3f5712b
No related branches found
No related tags found
No related merge requests found
......@@ -373,8 +373,16 @@ bool copy_data(struct cesnet_shm *cesnet_shm,
char *out2_u = out2_y + width * height;
char *out2_v = out2_u + width * height / 4;
if (cesnet_shm->use_gpu) {
fprintf(stderr, "Stereo mode not yet implemented with the GPU version.\n");
return false;
# ifdef WITH_CLIENT_CUDA
CUDA_CHECK(cudaMemcpy2D(out1_y, width, y, 2 * width, width, height, cudaMemcpyHostToDevice));
CUDA_CHECK(cudaMemcpy2D(out2_y, width, y + width, 2 * width, width, height, cudaMemcpyHostToDevice));
CUDA_CHECK(cudaMemcpy2D(out1_u, width / 2, u, width, width / 2, height / 2, cudaMemcpyHostToDevice));
CUDA_CHECK(cudaMemcpy2D(out2_u, width / 2, u + width / 2, width, width / 2, height / 2, cudaMemcpyHostToDevice));
CUDA_CHECK(cudaMemcpy2D(out1_v, width / 2, v, width, width / 2, height / 2, cudaMemcpyHostToDevice));
CUDA_CHECK(cudaMemcpy2D(out2_v, width / 2, v + width / 2, width, width / 2, height / 2, cudaMemcpyHostToDevice));
CUDA_CHECK(cudaIpcCloseMemHandle(out));
# endif
} else {
// Y
for (int i = 0; i < height; ++i) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment