加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c – SDL2.0替代SDL_Overlay

发布时间:2020-12-16 07:51:52 所属栏目:百科 来源:网络整理
导读:所以我一直在尝试通过以下关于ffmpeg: http://dranger.com/ffmpeg/tutorial02.html的教程 但是,当我尝试使用gcc编译时,我得到以下输出: root:/Users/mbrodeur/Downloads/HACKATHON CONTENT/Tutorials- gcc -o tutorial02 tutorial02.c -lavutil -lavformat
所以我一直在尝试通过以下关于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的缓冲区.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读