大佬教程收集整理的这篇文章主要介绍了c – SDL2.0替代SDL_Overlay,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
但是,当我尝试使用gcc编译时,我得到以下输出:
root:/Users/mbrodeur/Downloads/HACKATHON CONTENT/Tutorials-> gcc -o tutorial02 tutorial02.c -lavutil -lavformat -lavcodec -lz -lavutil -lm -lswscale -D_THREAD_SAFE -lSDL2 tutorial02.c: In function ‘main’: tutorial02.c:41: error: ‘SDL_Overlay’ undeclared (first use in this function) tutorial02.c:41: error: (Each undeclared identifier is reported only once tutorial02.c:41: error: for each function it appears in.) tutorial02.c:41: error: ‘bmp’ undeclared (first use in this function) tutorial02.c:98: warning: assignment makes pointer from integer without a cast tutorial02.c:110: error: ‘SDL_YV12_OVERLAY’ undeclared (first use in this function)
现在,我读到SDL_Overlay不再在SDL2中使用,所以在这里是问题.我一直在戳,但似乎找不到任何帮助.是否替代SDL_Overlay?有必要吗?
SDL_Overlay用于以下上下文:
SDL_Overlay *bmp; bmp = SDL_CreateYUVOverlay(pCodecCtx->width,pCodecCtx->height,SDL_YV12_OVERLAY,screen);
SDL_CreateTexture()
.
或者使用libswscale将ffmpeg的YUV缓冲区转换为RGB.
编辑:SDL2> = 2.0.1具有更新平面YUV纹理的SDL_UpdateYUVTexture()
,因此您不必再手动合并libav的缓冲区.
以上是大佬教程为你收集整理的c – SDL2.0替代SDL_Overlay全部内容,希望文章能够帮你解决c – SDL2.0替代SDL_Overlay所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。