creating surfaces for I420 with VA_SURFACE_ATTRIB_MEM_TYPE_USER_PTR
- Dominant language
- C
- Stars
- 784
- Forks
- 314
- PR merge metrics
- No merged PRs in 30d
Description
I am trying to use vaCreateSurfaces to create an I420 surface with VA_SURFACE_ATTRIB_MEM_TYPE_USER_PTR memory type. However it looks like any multi plane surface is not supported. I am filling VASurfaceAttribExternalBuffers like so
GstVideoInfo video_info;
VASurfaceAttribExternalBuffers extern_buf;
memset(&extern_buf, 0, sizeof(VASurfaceAttribExternalBuffers));
extern_buf.buffers = new unsigned long[1];
extern_buf.buffers[0] = reinterpret_cast(i420_data);
extern_buf.num_buffers = 1;
extern_buf.width =width;
extern_buf.height = height;
extern_buf.num_planes =video_info.n_planes;
extern_buf.data_size = video_info.size;
for (int i = 0; i < 4; i++) {
extern_buf.pitches[i] = video_info.stride[i];
extern_buf.offsets[i] = video_info.offset[i];
}
extern_buf.pixel_format = pixel_format;
calling vaCreateSurfaces() will result in "resource allocation failure". It has to do with the extern_buf.data_size. If if set the data size to width * height, the call is successful. but then only the first plane is valid. I am using the iHD driver.
Any idea what am I doing wrong ?
Contributor guide
Assessment
This issue has not been assessed yet.