I implement the cobalt spherical feature. It work correctly for 1080p video, but if I play another resolution video such as 480p, the video is reversed.The test video is from https://ytlr-cert.appspot.com/2019/main.html the format is YUVNV12.
I attach source core, could any one help to point out which caused it?
Thanks.
The reversed video:
My Source:
GL_CALL(glBindTexture(GL_TEXTURE_2D, out_info->planes[0].texture));
GL_CALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR));
GL_CALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR));
GL_CALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE));
GL_CALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE));
GL_CALL(glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA,
decode_target->videoframe_info.Stride,
decode_target->videoframe_info.imageHeight, 0, GL_ALPHA,
GL_UNSIGNED_BYTE, decode_target->buffer_y));
out_info->planes[0].gl_texture_format = GL_ALPHA;
out_info->planes[0].width = decode_target->videoframe_info.Stride;
out_info->planes[0].height = decode_target->videoframe_info.imageHeight;
out_info->planes[0].content_region.right = decode_target->videoframe_info.imageWidth;
out_info->planes[0].content_region.bottom = decode_target->videoframe_info.imageHeight;
GL_CALL(glBindTexture(GL_TEXTURE_2D, 0));
GL_CALL(glBindTexture(GL_TEXTURE_2D, out_info->planes[1].texture));
GL_CALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR));
GL_CALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR));
GL_CALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE));
GL_CALL(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE));
GL_CALL(glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE_ALPHA,
decode_target->videoframe_info.Stride / 2,
decode_target->videoframe_info.imageHeight / 2, 0,
GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE,
decode_target->buffer_uv));
GL_CALL(glBindTexture(GL_TEXTURE_2D, 0));
out_info->planes[1].gl_texture_format = GL_LUMINANCE_ALPHA;
out_info->planes[1].width = decode_target->videoframe_info.Stride / 2;
out_info->planes[1].height = decode_target->videoframe_info.imageHeight / 2;
out_info->planes[1].content_region.right = decode_target->videoframe_info.imageWidth / 2;
out_info->planes[1].content_region.bottom = decode_target->videoframe_info.imageHeight / 2;
out_info->width = decode_target->videoframe_info.imageWidth;
out_info->height = decode_target->videoframe_info.imageHeight;
out_info->format = kSbDecodeTargetFormat2PlaneYUVNV12;