Create the video buffers in the format the driver preffers.
This temporary creates problems with decoder less VDPAU video playback.
Signed-off-by: Christian König <deathsimple@vodafone.de>
case PIPE_VIDEO_CAP_MAX_WIDTH:
case PIPE_VIDEO_CAP_MAX_HEIGHT:
return vl_video_buffer_max_size(pscreen);
+ case PIPE_VIDEO_CAP_PREFERED_FORMAT:
+ return PIPE_FORMAT_NV12;
default:
debug_printf("unknown video param: %d\n", param);
return 0;
case PIPE_VIDEO_CAP_MAX_WIDTH:
case PIPE_VIDEO_CAP_MAX_HEIGHT:
return vl_video_buffer_max_size(screen);
+ case PIPE_VIDEO_CAP_PREFERED_FORMAT:
+ return PIPE_FORMAT_NV12;
default:
return 0;
}
case PIPE_VIDEO_CAP_MAX_WIDTH:
case PIPE_VIDEO_CAP_MAX_HEIGHT:
return vl_video_buffer_max_size(screen);
+ case PIPE_VIDEO_CAP_PREFERED_FORMAT:
+ return PIPE_FORMAT_NV12;
default:
return 0;
}
case PIPE_VIDEO_CAP_MAX_WIDTH:
case PIPE_VIDEO_CAP_MAX_HEIGHT:
return vl_video_buffer_max_size(screen);
+ case PIPE_VIDEO_CAP_PREFERED_FORMAT:
+ return PIPE_FORMAT_NV12;
default:
return 0;
}
case PIPE_VIDEO_CAP_MAX_WIDTH:
case PIPE_VIDEO_CAP_MAX_HEIGHT:
return vl_video_buffer_max_size(screen);
+ case PIPE_VIDEO_CAP_PREFERED_FORMAT:
+ return PIPE_FORMAT_NV12;
default:
return 0;
}
PIPE_VIDEO_CAP_SUPPORTED = 0,
PIPE_VIDEO_CAP_NPOT_TEXTURES = 1,
PIPE_VIDEO_CAP_MAX_WIDTH = 2,
- PIPE_VIDEO_CAP_MAX_HEIGHT = 3
+ PIPE_VIDEO_CAP_MAX_HEIGHT = 3,
+ PIPE_VIDEO_CAP_PREFERED_FORMAT = 4
};
enum pipe_video_codec
p_surf->device = dev;
memset(&tmpl, 0, sizeof(tmpl));
- tmpl.buffer_format = PIPE_FORMAT_YV12;
+ tmpl.buffer_format = dev->context->pipe->screen->get_video_param
+ (
+ dev->context->pipe->screen,
+ PIPE_VIDEO_PROFILE_UNKNOWN,
+ PIPE_VIDEO_CAP_PREFERED_FORMAT
+ );
tmpl.chroma_format = ChromaToPipe(chroma_type);
tmpl.width = width;
tmpl.height = height;
return BadAlloc;
memset(&tmpl, 0, sizeof(tmpl));
- tmpl.buffer_format = PIPE_FORMAT_NV12;
+ tmpl.buffer_format = pipe->screen->get_video_param
+ (
+ pipe->screen,
+ PIPE_VIDEO_PROFILE_MPEG2_MAIN,
+ PIPE_VIDEO_CAP_PREFERED_FORMAT
+ );
tmpl.chroma_format = context_priv->decoder->chroma_format;
tmpl.width = context_priv->decoder->width;
tmpl.height = context_priv->decoder->height;