diff options
author | Leo Liu <[email protected]> | 2017-08-21 14:03:40 -0400 |
---|---|---|
committer | Leo Liu <[email protected]> | 2017-08-22 15:13:42 -0400 |
commit | 2b025a11be1be82b482b7d61a1c0a8cf4de5570f (patch) | |
tree | 45a89dc0c6631f31c424c6c980a3f27f6d49f3b0 /src | |
parent | 398a299f7beae8d0e3973929b42ddbd250794453 (diff) |
st/va: enable P016 format i.e. reallocate buffer if format changed
Signed-off-by: Leo Liu <[email protected]>
Reviewed-by: Christian König <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/state_trackers/va/picture.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/va/picture.c b/src/gallium/state_trackers/va/picture.c index e0287d30f2c..b2be7af8c46 100644 --- a/src/gallium/state_trackers/va/picture.c +++ b/src/gallium/state_trackers/va/picture.c @@ -593,6 +593,7 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id) struct pipe_screen *screen; bool interlaced; bool realloc = false; + enum pipe_format format; if (!ctx) return VA_STATUS_ERROR_INVALID_CONTEXT; @@ -631,6 +632,17 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id) realloc = true; } + format = screen->get_video_param(screen, context->decoder->profile, + PIPE_VIDEO_ENTRYPOINT_BITSTREAM, + PIPE_VIDEO_CAP_PREFERED_FORMAT); + + if (surf->buffer->buffer_format != format && + surf->buffer->buffer_format == PIPE_FORMAT_NV12) { + /* check originally as NV12 only */ + surf->templat.buffer_format = format; + realloc = true; + } + if (u_reduce_video_profile(context->templat.profile) == PIPE_VIDEO_FORMAT_JPEG && surf->buffer->buffer_format == PIPE_FORMAT_NV12) { if (context->mjpeg.sampling_factor == 0x211111 || |