Commit 8af98817 by ziyue

修复低版本sdl,test_player编译问题

parent fec1307a
...@@ -172,14 +172,17 @@ public: ...@@ -172,14 +172,17 @@ public:
} }
} }
if (_texture) { if (_texture) {
#if (SDL_PATCHLEVEL >= 16 || SDL_MINOR_VERSION > 0)
//需要更新sdl到最新(>=2.0.16) //需要更新sdl到最新(>=2.0.16)
if (pFrame->format == AV_PIX_FMT_NV12) { if (pFrame->format == AV_PIX_FMT_NV12) {
SDL_UpdateNVTexture( SDL_UpdateNVTexture(
_texture, nullptr, pFrame->data[0], pFrame->linesize[0], pFrame->data[1], pFrame->linesize[1]); _texture, nullptr, pFrame->data[0], pFrame->linesize[0], pFrame->data[1], pFrame->linesize[1]);
} else { } else
#endif
{
SDL_UpdateYUVTexture( SDL_UpdateYUVTexture(
_texture, nullptr, pFrame->data[0], pFrame->linesize[0], pFrame->data[1], pFrame->linesize[1], _texture, nullptr, pFrame->data[0], pFrame->linesize[0], pFrame->data[1], pFrame->linesize[1],
pFrame->data[2], pFrame->linesize[2]); pFrame->data[2], pFrame->linesize[2]);
} }
//SDL_UpdateTexture(_texture, nullptr, pFrame->data[0], pFrame->linesize[0]); //SDL_UpdateTexture(_texture, nullptr, pFrame->data[0], pFrame->linesize[0]);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论