[FFmpeg-devel] [PATCH 1/2] libavcodec: Add support for QSV screen capture plugin

Mark Thompson sw at jkqxz.net
Mon Aug 14 15:26:28 EEST 2017


On 11/08/17 10:10, Alexander Bilyak wrote:
> Intel QSV SDK provide screen capture plugin starting from API ver 1.17
> as runtime loadable plugin for QSV decoder.
> 
> * add API version selection while initialization of QSV context
> (default is still 1.1 for usual encoding/decoding)
> ---
>  configure                  |   2 +
>  libavcodec/Makefile        |   1 +
>  libavcodec/allcodecs.c     |   1 +
>  libavcodec/qsv.c           |   6 +-
>  libavcodec/qsv_internal.h  |   2 +-
>  libavcodec/qsvdec.c        |  12 ++-
>  libavcodec/qsvdec.h        |   5 +
>  libavcodec/qsvdec_screen.c | 250 +++++++++++++++++++++++++++++++++++++++++++++
>  libavcodec/qsvenc.c        |   3 +-
>  9 files changed, 272 insertions(+), 10 deletions(-)
>  create mode 100644 libavcodec/qsvdec_screen.c

I'm not convinced that adding this as a hacked-up pseudo-decoder is really the best approach.

It would, I think, be straightforward to put this in lavd completely standalone.  The common code you are actually using there is:
* Session initialisation - this should be trivial, since you have no device or external frames anyway.
* The actual decode function - this contains a lot of additional trickiness (packets, asynchronicity, queueing) which you don't want.  A simpler form which just fetches one frame would feel better.  This should also be able to avoid the second copy to the output packet.

Some other thoughts:
* If this is only available in a higher API version then you will need a configure test for those headers.
* Does this only support NV12 capture?  In many cases RGB is more useful (or at least some YUV 4:4:4 which doesn't do nasty things to thin coloured lines).
* Is having an externally-provided device (hw_device_ctx) ever useful?  The lavd implementation doesn't have any way to pass a device in (since lavf can't).
* Do you happen to know how it actually works?  (Presumably it's reading surfaces used for scanout on the GPU side somehow; who does the copy and colour conversion?)

Thanks,

- Mark


More information about the ffmpeg-devel mailing list