C&C++   发布时间:2022-04-03  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了c – SDL2.0替代SDL_Overlay大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
所以我一直在尝试通过以下关于ffmpeg: http://dranger.com/ffmpeg/tutorial02.html的教程

但是,当我尝试使用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);

解决方法

尝试使用符合解码帧布局和平面度的YUV像素格式的 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,请注明来意。
标签: