提交 62438b7e 编写于 作者: Z Zhang Rui

ijksdl: YUV12 need convert U,V planar before convert

上级 dba73481
......@@ -185,10 +185,17 @@ int SDL_VoutFFmpeg_ConvertPicture(
SDL_VoutOverlay_Opaque *opaque = overlay->opaque;
AVPicture dest_pic = { { 0 } };
for (int i = 0; i < overlay->planes; ++i) {
dest_pic.data[i] = overlay->pixels[i];
dest_pic.linesize[i] = overlay->pitches[i];
}
enum AVPixelFormat dst_format = AV_PIX_FMT_NONE;
switch (overlay->format) {
case SDL_FCC_YV12:
dst_format = AV_PIX_FMT_YUV420P;
dest_pic.data[2] = overlay->pixels[1];
dest_pic.data[1] = overlay->pixels[2];
break;
case SDL_FCC_RV32:
// TODO: 9 android only
......@@ -204,11 +211,6 @@ int SDL_VoutFFmpeg_ConvertPicture(
return -1;
}
for (int i = 0; i < overlay->planes; ++i) {
dest_pic.data[i] = overlay->pixels[i];
dest_pic.linesize[i] = overlay->pitches[i];
}
if (ijk_image_convert(width, height,
dst_format, dest_pic.data, dest_pic.linesize,
src_format, src_data, src_linesize)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册