<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 19 October 2015 at 18:10, Emil Velikov <span dir="ltr"><<a href="mailto:emil.l.velikov@gmail.com" target="_blank">emil.l.velikov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">On 17 October 2015 at 00:14, Julien Isorce <<a href="mailto:julien.isorce@gmail.com">julien.isorce@gmail.com</a>> wrote:</span><span class=""></span><br><div><div class="h5">
> +<br>
> +   if (!(picture_width && picture_height) && !is_vpp)<br>
>        return VA_STATUS_ERROR_INVALID_IMAGE_FORMAT;<br>
><br>
>     drv = VL_VA_DRIVER(ctx);<br>
> @@ -163,38 +177,48 @@ vlVaCreateContext(VADriverContextP ctx, VAConfigID config_id, int picture_width,<br>
>     if (!context)<br>
>        return VA_STATUS_ERROR_ALLOCATION_FAILED;<br>
><br>
> -   templat.profile = config_id;<br>
> -   templat.entrypoint = PIPE_VIDEO_ENTRYPOINT_BITSTREAM;<br>
> -   templat.chroma_format = PIPE_VIDEO_CHROMA_FORMAT_420;<br>
> -   templat.width = picture_width;<br>
> -   templat.height = picture_height;<br>
> -   templat.max_references = num_render_targets;<br>
> -   templat.expect_chunked_decode = true;<br>
> -<br>
> -   if (u_reduce_video_profile(templat.profile) ==<br>
> -       PIPE_VIDEO_FORMAT_MPEG4_AVC)<br>
> -      templat.level = u_get_h264_level(templat.width, templat.height,<br>
> -                            &templat.max_references);<br>
> -<br>
> -   context->decoder = drv->pipe->create_video_codec(drv->pipe, &templat);<br>
> -   if (!context->decoder) {<br>
> -      FREE(context);<br>
> -      return VA_STATUS_ERROR_ALLOCATION_FAILED;<br>
> -   }<br>
> -<br>
> -   if (u_reduce_video_profile(context->decoder->profile) ==<br>
> -         PIPE_VIDEO_FORMAT_MPEG4_AVC) {<br>
> -      context->desc.h264.pps = CALLOC_STRUCT(pipe_h264_pps);<br>
> -      if (!context->desc.h264.pps) {<br>
> +   if (is_vpp) {<br>
> +      context->decoder = NULL;<br>
> +      if (!drv->compositor.upload) {<br>
>           FREE(context);<br>
> -         return VA_STATUS_ERROR_ALLOCATION_FAILED;<br>
> +         return VA_STATUS_ERROR_INVALID_CONTEXT;<br>
>        }<br>
> -      context->desc.h264.pps->sps = CALLOC_STRUCT(pipe_h264_sps);<br>
> -      if (!context->desc.h264.pps->sps) {<br>
> -         FREE(context->desc.h264.pps);<br>
> +   } else {<br>
> +      templat.profile = config_id;<br>
> +      templat.entrypoint = PIPE_VIDEO_ENTRYPOINT_BITSTREAM;<br>
> +      templat.chroma_format = PIPE_VIDEO_CHROMA_FORMAT_420;<br>
> +      templat.width = picture_width;<br>
> +      templat.height = picture_height;<br>
> +      templat.max_references = 2;<br>
> +      templat.expect_chunked_decode = true;<br>
> +<br>
> +      if (u_reduce_video_profile(templat.profile) ==<br>
> +        PIPE_VIDEO_FORMAT_MPEG4_AVC) {<br>
> +        templat.max_references = 16;<br>
> +        templat.level = u_get_h264_level(templat.width, templat.height,<br>
> +                             &templat.max_references);<br>
> +      }<br>
> +<br>
</div></div>Why the max_references changes ? Shouldn't those be a separate patch ?<br></blockquote><div><br></div><div>Ah thx, I think I messed up a rebase, this patch was originally on top of "[PATCH v4 4/6] <span class="">st</span>/<span class="">va</span>: <span class="">properly</span> <span class="">set</span> <span class="">max</span> <span class="">number</span> of <span class="">ref</span> <span class="">frames" already submited but not reviewed . And I forgot about it :)<br><br></span></div><div><span class="">I'll remove the dependency.<br></span></div><div> <br></div></div></div></div>