[Libva] [PATCH libva-intel-driver master 2/2] Return error when trying to decoding an interlaced VC-1 video

Xiang, Haihao haihao.xiang at intel.com
Wed May 14 19:53:03 PDT 2014


On Fri, 2014-05-09 at 12:20 +0200, Gwenole Beauchesne wrote: 
> Hi,
> 
> 2014-05-05 7:00 GMT+02:00 Xiang, Haihao <haihao.xiang at intel.com>:
> > From: "Xiang, Haihao" <haihao.xiang at intel.com>
> >
> > https://bugs.freedesktop.org/show_bug.cgi?id=77386
> >
> > Signed-off-by: Xiang, Haihao <haihao.xiang at intel.com>
> > ---
> >  src/i965_decoder_utils.c | 7 ++++++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/i965_decoder_utils.c b/src/i965_decoder_utils.c
> > index 2533381..617bc15 100644
> > --- a/src/i965_decoder_utils.c
> > +++ b/src/i965_decoder_utils.c
> > @@ -654,7 +654,12 @@ intel_decoder_check_vc1_parameter(VADriverContextP ctx,
> >      VAPictureParameterBufferVC1 *pic_param = (VAPictureParameterBufferVC1 *)decode_state->pic_param->buffer;
> >      struct object_surface *obj_surface;
> >      int i = 0;
> > -
> > +
> > +    if (pic_param->sequence_fields.bits.interlace == 1 &&
> > +        pic_param->picture_fields.bits.frame_coding_mode != 0) { /* frame-interlace or field-interlace */
> > +        return VA_STATUS_ERROR_DECODING_ERROR;
> > +    }
> > +
> >      if (pic_param->picture_fields.bits.picture_type == 0 ||
> >          pic_param->picture_fields.bits.picture_type == 3) {
> >      } else if (pic_param->picture_fields.bits.picture_type == 1 ||
> > --
> 
> In general, returning VA_STATUS_ERROR_DECODING_ERROR means returning a
> valid error for vaQuerySurfaceError() as a next step. If you want to
> return this type of error, you have to support this interface as well.

It is my fault, I didn't go through va.h for
VA_STATUS_ERROR_DECODING_ERROR semantics when I tried to find an
appropriate error code.  

> 
> Maybe FLAG_NOT_SUPPORTED would be a more appropriate error, or at
> least the catchall Unknown one?

I also considered VA_STATUS_ERROR_FLAG_NOT_SUPPORTED or
VA_STATUS_ERROR_UNKNOWN. I think FLAG_NOT_SUPPORTED means driver doesn't
support a pre-defined flag in VAAPI which is inappropriate for this
error. I will replace the returned error with VA_STATUS_ERROR_UNKNOWN.
Another option is we may define some new error codes for those
unsupported features in {pic, slice} parameters. 

Thanks
Haihao


> i.e. return something else, unless you
> implement vaQuerySurfaceError() interface, which also means extending
> the API to notify that some of the supplied {pic, slice} param fields
> are not supported.


> 
> Thanks,
> Gwenole.




More information about the Libva mailing list