@ -79,8 +79,12 @@ void CameraBuf::init(cl_device_id device_id, cl_context context, CameraState *s,
int nv12_height = VENUS_Y_SCANLINES ( COLOR_FMT_NV12 , rgb_height ) ;
int nv12_height = VENUS_Y_SCANLINES ( COLOR_FMT_NV12 , rgb_height ) ;
assert ( nv12_width = = VENUS_UV_STRIDE ( COLOR_FMT_NV12 , rgb_width ) ) ;
assert ( nv12_width = = VENUS_UV_STRIDE ( COLOR_FMT_NV12 , rgb_width ) ) ;
assert ( nv12_height / 2 = = VENUS_UV_SCANLINES ( COLOR_FMT_NV12 , rgb_height ) ) ;
assert ( nv12_height / 2 = = VENUS_UV_SCANLINES ( COLOR_FMT_NV12 , rgb_height ) ) ;
size_t nv12_size = 2346 * nv12_width ; // comes from v4l2_format.fmt.pix_mp.plane_fmt[0].sizeimage
size_t nv12_uv_offset = nv12_width * nv12_height ;
size_t nv12_uv_offset = nv12_width * nv12_height ;
// the encoder HW tells us the size it wants after setting it up.
// TODO: VENUS_BUFFER_SIZE should give the size, but it's too small. dependent on encoder settings?
size_t nv12_size = ( rgb_width > = 2688 ? 2900 : 2346 ) * nv12_width ;
vipc_server - > create_buffers_with_sizes ( stream_type , YUV_BUFFER_COUNT , false , rgb_width , rgb_height , nv12_size , nv12_width , nv12_uv_offset ) ;
vipc_server - > create_buffers_with_sizes ( stream_type , YUV_BUFFER_COUNT , false , rgb_width , rgb_height , nv12_size , nv12_width , nv12_uv_offset ) ;
LOGD ( " created %d YUV vipc buffers with size %dx%d " , YUV_BUFFER_COUNT , nv12_width , nv12_height ) ;
LOGD ( " created %d YUV vipc buffers with size %dx%d " , YUV_BUFFER_COUNT , nv12_width , nv12_height ) ;