Other Parts Discussed in Thread: TDA2
Hello:
Environment
VisionSDK 3.05
As you known, the OpenGL on visonSDK only support the NV12 input, thus when we bind the texture, have to use
glGenTextures(1, outTexIndex); System_eglCheckGlError("glGenTextures"); printf("outTexIndex 0x%x \n",*outTexIndex); glBindTexture(GL_TEXTURE_EXTERNAL_OES, *outTexIndex); System_eglCheckGlError("glBindTexture"); glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, GL_LINEAR); System_eglCheckGlError("glTexParameteri"); glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, (GLeglImageOES)textImg); System_eglCheckGlError("glEGLImageTargetTexture2DOES");
and if we want to use the FBO(framebufferobject), like:
glBindTexture(GL_TEXTURE_2D, m_stage_texture[i]); #if GLOBAL_RUN_ENV_DESKTOP == 0 && defined APP_RUN_ON_IMX6 // map addr to opengl viv (*g_pFNglTexDirectVIVMap)(GL_TEXTURE_2D, width, height, fbo_format, (void **)&(m_stage_fbo_vaddr[i]), (const GLuint *)(&m_stage_fbo_paddr[i])); #else glTexImage2D(GL_TEXTURE_2D, 0, fbo_format, width, height, 0, fbo_format, GL_UNSIGNED_BYTE, NULL); #endif glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); // bind renderbuffer and create a 16-bit depth buffer // width and height of renderbuffer = width and height of // the texture glBindRenderbuffer(GL_RENDERBUFFER, m_stage_depth_render_buffer[i]); glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, width, height); // bind the framebuffer glBindFramebuffer(GL_FRAMEBUFFER, m_stage_fbo[i]); // specify texture as color attachment glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_stage_texture[i], 0); eglCheckGlError("glFramebufferTexture2D"); printf("andy debug test glFramebufferTexture2D \n"); // specify depth_renderbufer as depth attachment glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, m_stage_depth_render_buffer[i]); // check for framebuffer complete GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
for above code, how we can use the FBO with NV12?
per discussed before, the FBO only support the RGB, that means we can't use FBO with NV12?