glTexDirectVIVMap leads GL_INVALID_ENUM if malloc is used

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

glTexDirectVIVMap leads GL_INVALID_ENUM if malloc is used

1,204 次查看
valkov
Contributor I

Hi, could somebody explain why glTexDirectVIVMap always leads GL_INVALID_ENUM error in following case?

Tried different formats, sizes, etc.

GLuint physical = ~0U;

void *bits = malloc(vF.width() * vF.height());

glBindTexture(GL_TEXTURE_2D, tmpTexId);

glTexDirectVIVMap(GL_TEXTURE_2D,vF.width(),vF.height(), GL_VIV_YV12, (GLvoid **)&bits, &physical); ASSERT(glGetError() != GL_INVALID_ENUM);

Originally the problem with GL_INVALID_ENUM happened when tried to play video/x-theora video using following pipeline:

filesrc ! oggdemux !  theoradec  !  qtvideorenderersink

Where qtvideorenderersink takes GstBuffer, maps it using gst_video_frame_map, takes data and use glTexDirectVIVMap to map data to texture. 

This pipeline produces GL_INVALID_ENUM and no video playback.

In case if format is video/x-h264,   following pipeline is used:

filesrc ! qtdemux ! h264parse ! imxvpudec ! qtvideorenderersink

Everything works, video is successfully played.

 

So if I change original x-theora pipeline to:

filesrc ! oggdemux ! theoradec ! imxipuvideotransformqtvideorenderersink

glTexDirectVIVMap works correctly without any error and video/x-theora content is shown.

So adding imxipuvideotransform makes some magic.

Does it work because it uses imxipuallocator ?

Or glTexDirectVIVMap does not allow to use CPU (not configured?) memory at all on some circumstances ?

imx6 nitrogen board on yocto.

Thanks

标签 (1)
标记 (3)
0 项奖励
回复
2 回复数

973 次查看
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello Val,

It is difficult to provide a response about the such error with the complete code, do you think you can provide the init function and the headers that you add, and maybe an screen shot of such error.  what version of BSP are you using?, which device are you handling?

You can check attached document Chapter GPU Memory Introduction for more GPU memory usage.

In theory there is no maximum limitation for GPU memory, but you need leave enough system memory for other apps.

Regards

0 项奖励
回复

973 次查看
valkov
Contributor I

Hi, thanks for reply.
Updated the post.

And en sample with malloc and glTexDirectVIVMap I took from i.MX_Graphics_User's_Guide.pdf

0 项奖励
回复