imx6 更新纹理-私有接口 glTexDirectVIVMap glTexDirectInvalidateVIV

imx6 viv GPU 更新纹理私有接口

 

 1 void mapFrame2Texture(GLvoid *pvAddr, const GLuint * pAddr)
 2 {
 3     DEBUG_LOG(" mapFrame2Texture  - vaddr %p ", pvAddr);
 4     QOpenGLContext *glcontext = QOpenGLContext::currentContext();
 5     if (glcontext == 0) {
 6         qWarning() << Q_FUNC_INFO << "no QOpenGLContext::currentContext() => return 0";
 7         return ;
 8     }
 9 
10     static PFNGLTEXDIRECTVIVMAPPROC glTexDirectVIVMap_LOCAL = 0;
11 
12     if (glTexDirectVIVMap_LOCAL == 0 ) {
13         glTexDirectVIVMap_LOCAL = reinterpret_cast<PFNGLTEXDIRECTVIVMAPPROC>(glcontext->getProcAddress("glTexDirectVIVMap"));
14     }
15     if (glTexDirectVIVMap_LOCAL == 0 ) {
16         qWarning() << Q_FUNC_INFO << "couldn't find \"glTexDirectVIVMap\" and/or \"glTexDirectInvalidateVIV\" => do nothing and return";
17         return ;
18     }
19 
20     static PFNGLTEXDIRECTINVALIDATEVIVPROC glTexDirectInvalidateVIV_LOCAL = 0;
21 
22     if ( glTexDirectInvalidateVIV_LOCAL == 0) {
23          glTexDirectInvalidateVIV_LOCAL = reinterpret_cast<PFNGLTEXDIRECTINVALIDATEVIVPROC>(glcontext->getProcAddress("glTexDirectInvalidateVIV"));
24     }
25     if ( glTexDirectInvalidateVIV_LOCAL == 0) {
26         qWarning() << Q_FUNC_INFO << "couldn't find \"glTexDirectVIVMap\" and/or \"glTexDirectInvalidateVIV\" => do nothing and return";
27         return ;
28     }
29 
30     /////////////////////////////////////////////////////////////////////////
31     glTexDirectVIVMap_LOCAL(GL_TEXTURE_2D, SRC_V4L2_FRAME_WIDTH,
32          SRC_V4L2_FRAME_HEIGHT, GPUPAINT_FMT,
33           &pvAddr,
34           pAddr
35       );
36 
37     glTexDirectInvalidateVIV_LOCAL(GL_TEXTURE_2D);
38 
39 }

 

posted @ 2022-02-12 19:29  张志伟122  阅读(289)  评论(1编辑  收藏  举报