VdpStatus ret;
struct pipe_screen *screen;
struct pipe_video_decoder *dec;
+ bool buffer_support[2];
unsigned i;
union {
struct pipe_picture_desc base;
// TODO: Recreate decoder with correct chroma
return VDP_STATUS_INVALID_CHROMA_TYPE;
+ buffer_support[0] = screen->get_video_param(screen, dec->profile, PIPE_VIDEO_CAP_SUPPORTS_PROGRESSIVE);
+ buffer_support[1] = screen->get_video_param(screen, dec->profile, PIPE_VIDEO_CAP_SUPPORTS_INTERLACED);
+
if (vlsurf->video_buffer == NULL ||
- !screen->is_video_format_supported(screen, vlsurf->video_buffer->buffer_format, dec->profile)) {
+ !screen->is_video_format_supported(screen, vlsurf->video_buffer->buffer_format, dec->profile) ||
+ buffer_support[vlsurf->video_buffer->interlaced]) {
/* destroy the old one */
if (vlsurf->video_buffer)
/* set the buffer format to the prefered one */
vlsurf->templat.buffer_format = screen->get_video_param(screen, dec->profile, PIPE_VIDEO_CAP_PREFERED_FORMAT);
+ /* also set interlacing to decoders preferences */
+ vlsurf->templat.interlaced = screen->get_video_param(screen, dec->profile, PIPE_VIDEO_CAP_PREFERS_INTERLACED);
+
/* and recreate the video buffer */
vlsurf->video_buffer = dec->context->create_video_buffer(dec->context, &vlsurf->templat);
p_surf->templat.chroma_format = ChromaToPipe(chroma_type);
p_surf->templat.width = width;
p_surf->templat.height = height;
+ p_surf->templat.interlaced = pipe->screen->get_video_param
+ (
+ pipe->screen,
+ PIPE_VIDEO_PROFILE_UNKNOWN,
+ PIPE_VIDEO_CAP_PREFERS_INTERLACED
+ );
p_surf->video_buffer = pipe->create_video_buffer(pipe, &p_surf->templat);
*surface = vlAddDataHTAB(p_surf);