[Mesa-dev] [PATCH v3] st/va: delay decoder creation until max_references is known

Emil Velikov emil.l.velikov at gmail.com
Mon Nov 30 04:03:40 PST 2015


On 26 November 2015 at 08:45, Julien Isorce <julien.isorce at gmail.com> wrote:

> --- a/src/gallium/state_trackers/va/picture.c
> +++ b/src/gallium/state_trackers/va/picture.c

> @@ -113,12 +118,37 @@ handlePictureParameterBuffer(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *
>     default:
>        break;
>     }
> +
> +   /* Create the decoder once max_references is known. */
> +   if (!context->decoder) {
> +      if (!context->target)
> +         return VA_STATUS_ERROR_INVALID_CONTEXT;
> +
> +      if (context->templat.max_references == 0)
> +         return VA_STATUS_ERROR_INVALID_BUFFER;
> +
> +      if (u_reduce_video_profile(context->templat.profile) !=
> +          PIPE_VIDEO_FORMAT_MPEG4_AVC)
> +         context->templat.level = u_get_h264_level(context->templat.width,
> +            context->templat.height, &context->templat.max_references);

Erm shouldn't this one be "if profile == h264 { get_h264_level(...) }" ?

With the above fixed
Reviewed-by: Emil Velikov <emil.l.velikov at gmail.com>

-Emil


More information about the mesa-dev mailing list