st/va: reallocate the buffer if the layout isn't supported
So that it makes more clear for buffer reallocation based on buffers layout for both decoder and encoder. Signed-off-by: Leo Liu <leo.liu@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
This commit is contained in:
parent
78ec7400c5
commit
cadeb73f6b
|
@ -591,7 +591,7 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id)
|
||||||
vlVaSurface *surf;
|
vlVaSurface *surf;
|
||||||
void *feedback;
|
void *feedback;
|
||||||
struct pipe_screen *screen;
|
struct pipe_screen *screen;
|
||||||
bool interlaced;
|
bool supported;
|
||||||
bool realloc = false;
|
bool realloc = false;
|
||||||
enum pipe_format format;
|
enum pipe_format format;
|
||||||
|
|
||||||
|
@ -621,14 +621,17 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id)
|
||||||
context->mpeg4.frame_num++;
|
context->mpeg4.frame_num++;
|
||||||
|
|
||||||
screen = context->decoder->context->screen;
|
screen = context->decoder->context->screen;
|
||||||
interlaced = screen->get_video_param(screen, context->decoder->profile,
|
supported = screen->get_video_param(screen, context->decoder->profile,
|
||||||
context->decoder->entrypoint,
|
context->decoder->entrypoint,
|
||||||
PIPE_VIDEO_CAP_SUPPORTS_INTERLACED);
|
surf->buffer->interlaced ?
|
||||||
|
PIPE_VIDEO_CAP_SUPPORTS_INTERLACED :
|
||||||
|
PIPE_VIDEO_CAP_SUPPORTS_PROGRESSIVE);
|
||||||
|
|
||||||
if (surf->buffer->interlaced != interlaced) {
|
if (!supported) {
|
||||||
surf->templat.interlaced = screen->get_video_param(screen, context->decoder->profile,
|
surf->templat.interlaced = screen->get_video_param(screen,
|
||||||
PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
|
context->decoder->profile,
|
||||||
PIPE_VIDEO_CAP_PREFERS_INTERLACED);
|
context->decoder->entrypoint,
|
||||||
|
PIPE_VIDEO_CAP_PREFERS_INTERLACED);
|
||||||
realloc = true;
|
realloc = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue