[FFmpeg-devel] [PATCH] libavfilter/vaapi: enable vaapi rotation feature via call Intel iHD driver

Zhou, Zachary zachary.zhou at intel.com
Thu Oct 25 09:55:20 EEST 2018



> -----Original Message-----
> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] On Behalf Of
> Zhou, Zachary
> Sent: Thursday, October 25, 2018 12:34 PM
> To: FFmpeg development discussions and patches <ffmpeg-devel at ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH] libavfilter/vaapi: enable vaapi rotation
> feature via call Intel iHD driver
> 
> 
> 
> > -----Original Message-----
> > From: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] On Behalf
> > Of Mark Thompson
> > Sent: Thursday, October 25, 2018 7:08 AM
> > To: ffmpeg-devel at ffmpeg.org
> > Subject: Re: [FFmpeg-devel] [PATCH] libavfilter/vaapi: enable vaapi
> > rotation feature via call Intel iHD driver
> >
> > On 23/10/18 22:05, Eoff, Ullysses A wrote:
> > >
> > >> -----Original Message-----
> > >> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] On
> > >> Behalf Of Eoff, Ullysses A
> > >> Sent: Tuesday, October 23, 2018 1:50 PM
> > >> To: FFmpeg development discussions and patches
> > >> <ffmpeg-devel at ffmpeg.org>
> > >> Subject: Re: [FFmpeg-devel] [PATCH] libavfilter/vaapi: enable vaapi
> > >> rotation feature via call Intel iHD driver
> > >>
> > >>> -----Original Message-----
> > >>> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] On
> > >>> Behalf Of Michael Niedermayer
> > >>> Sent: Tuesday, October 23, 2018 10:06 AM
> > >>> To: FFmpeg development discussions and patches
> > >>> <ffmpeg-devel at ffmpeg.org>
> > >>> Subject: Re: [FFmpeg-devel] [PATCH] libavfilter/vaapi: enable
> > >>> vaapi rotation feature via call Intel iHD driver
> > >>>
> > >>> On Tue, Oct 23, 2018 at 03:52:40PM +0800, Zachary Zhou wrote:
> > >>>> It supports clockwise rotation by 0/90/180/270 degrees defined in
> > >>>> va/va_vpp.h, tested following command line on SKL platform
> > >>>>
> > >>>> ffmpeg -hwaccel vaapi -vaapi_device /dev/dri/renderD128
> > >>>> -hwaccel_output_format vaapi -i input.264 -vf
> > "rotation_vaapi=angle=90"
> > >>>> -c:v h264_vaapi output.h264
> > >>>> ---
> > >>>>  libavfilter/Makefile        |   1 +
> > >>>>  libavfilter/allfilters.c    |   1 +
> > >>>>  libavfilter/vaapi_vpp.h     |   1 +
> > >>>>  libavfilter/vf_misc_vaapi.c | 122
> > >>>> ++++++++++++++++++++++++++++++++++++
> > >>>>  4 files changed, 125 insertions(+)
> > >>>
> > >>> breaks build
> > >>> make distclean ; ./configure && make -j12 ...
> > >>> libavfilter/vf_misc_vaapi.c: In function
> > ‘rotation_vaapi_build_filter_params’:
> > >>> libavfilter/vf_misc_vaapi.c:165:23: error: ‘VAProcPipelineCaps’
> > >>> has no
> > member named ‘rotation_flags’
> > >>>      if (!pipeline_caps.rotation_flags) {
> > >>>                        ^
> > >>> libavfilter/vf_misc_vaapi.c:191:33: error: ‘VAProcPipelineCaps’
> > >>> has no
> > member named ‘rotation_flags’
> > >>>      support_flag = pipeline_caps.rotation_flags &
> > >>>                                  ^
> > >>> libavfilter/vf_misc_vaapi.c: In function ‘misc_vaapi_filter_frame’:
> > >>> libavfilter/vf_misc_vaapi.c:248:15: error:
> ‘VAProcPipelineParameterBuffer’
> > has no member named ‘rotation_state’
> > >>>          params.rotation_state = vpp_ctx->rotation_state;
> > >>>                ^
> > >>> make: *** [libavfilter/vf_misc_vaapi.o] Error 1
> > >>> make: *** Waiting for unfinished jobs....
> > >>>
> > >>>
> > >>
> > >> Looks like VPP rotation caps weren't introduced until libva 2.1.0
> > >> (in commit
> > cff70165e08ab).
> > >> Perhaps, compilation of this feature should be guarded by
> > VA_CHECK_VERSION macro?
> > >>
> > >
> > > That is, VA-API 1.1.0... VA_CHECK_VERSION(1, 1, 0)
> >
> > I think this wants to be a configure option, because the filter will
> > be enabled or not based on it - maybe look for the rotation_state
> > field in VAProcPipelineParameterBuffer with check_struct?
> 
> Good idea to use check_struct, I am ramping up the build script configure.
> Is that possible for following steps -
> 1. use check_struct for rotation_state in configure file.
> 2. push !CONFIG_ROTATION_VAAPI_FILTER=yes to config.mak 3. separate
> rotation from denoise and sharpness from vf_misc_vaapi.c in a new c source
> file.
> 
> if anyone can give a hint for step 2 will save me a little time.

In patch v2 add following in configure file

+    if ! check_struct "va/va.h" "struct _VAProcPipelineCaps" rotation_flags; then
+        disable rotation_vaapi_filter
+    fi

> 
> >
> > - Mark
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel at ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list