Changing image format of a Directx acquired surface in opencl

218 Views Asked by At

I am working in opencl gets a Media surface from Directx

  /* Working on NV12 surfaces, associate the shared buffer with the kernel object*/
  p->memobj[0] = clCreateFromDX9MediaSurfaceINTEL(p->context, CL_MEM_READ_ONLY, input_D3D_surf, input_D3D_surf_hdl, 0, &error);
  p->memobj[1] = clCreateFromDX9MediaSurfaceINTEL(p->context, CL_MEM_READ_ONLY, input_D3D_surf, input_D3D_surf_hdl, 1, &error);
  p->memobj[2] = clCreateFromDX9MediaSurfaceINTEL(p->context, CL_MEM_READ_ONLY, input_D3D_surf, input_D3D_surf_hdl, 0, &error);
  p->memobj[3] = clCreateFromDX9MediaSurfaceINTEL(p->context, CL_MEM_READ_ONLY, input_D3D_surf, input_D3D_surf_hdl, 1, &error);
  cl_mem surfaces[4];
  surfaces[0] = p->memobj[0];
  surfaces[1] = p->memobj[1];
  surfaces[2] = p->memobj[2];
  surfaces[3] = p->memobj[3];

  error = clEnqueueAcquireDX9ObjectsINTEL(p->command_queue, 4, surfaces, 0, NULL, NULL);

The media surface has NV12 format as specified below and here

MAKEFOURCC(?N?,?V?,?1?,?2?),Plane0    CL_R         CL_UNORM_INT8
MAKEFOURCC(?N?,?V?,?1?,?2?),Plane1    CL_RG        CL_UNORM_INT8

I want to change the image format of plane 0 (means surface[0] and surface[2])of opencl object to CL_RGBA.Is there any way I can do this?

1

There are 1 best solutions below

0
sMiLo On