diff options
author | Christian König <[email protected]> | 2012-02-01 23:50:34 +0100 |
---|---|---|
committer | Christian König <[email protected]> | 2012-02-06 10:35:58 +0100 |
commit | 8f54929c5d9a07a999cb0a55c406062fd8cdfb74 (patch) | |
tree | 183ca22945b26edcefde6f0f0e247e340c53f811 /src/gallium/state_trackers/vdpau/decode.c | |
parent | 8bfadc802f6c3c85de4c429b2a87d0bdb1705028 (diff) |
st/vdpau: use interlacing capabilities
Recreate video buffer if need arises.
Signed-off-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/vdpau/decode.c')
-rw-r--r-- | src/gallium/state_trackers/vdpau/decode.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/vdpau/decode.c b/src/gallium/state_trackers/vdpau/decode.c index 00232ad9826..de9835f5847 100644 --- a/src/gallium/state_trackers/vdpau/decode.c +++ b/src/gallium/state_trackers/vdpau/decode.c @@ -393,6 +393,7 @@ vlVdpDecoderRender(VdpDecoder decoder, VdpStatus ret; struct pipe_screen *screen; struct pipe_video_decoder *dec; + bool buffer_support[2]; unsigned i; union { struct pipe_picture_desc base; @@ -424,8 +425,12 @@ vlVdpDecoderRender(VdpDecoder decoder, // 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) @@ -434,6 +439,9 @@ vlVdpDecoderRender(VdpDecoder decoder, /* 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); |