c – SDL2.0替代SDL_Overlay

c – SDL2.0替代SDL_Overlay,第1张

概述所以我一直在尝试通过以下关于ffmpeg: http://dranger.com/ffmpeg/tutorial02.html的教程 但是,当我尝试使用gcc编译时,我得到以下输出: root:/Users/mbrodeur/Downloads/HACKATHON CONTENT/Tutorials-> gcc -o tutorial02 tutorial02.c -lavutil -lavfor 所以我一直在尝试通过以下关于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 -lSDL2tutorial02.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 oncetutorial02.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 casttutorial02.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所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/1233013.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-06-06
下一篇2022-06-06

发表评论

登录后才能评论

评论列表(0条)

    保存