Skip to content

pr-ffstaging-25/softworkz/derive_devices-v3

…h directions

This is an updated version of: [PATCH v4 1/1] avutils/hwcontext: When
deriving a hwdevice, search for existing device in both directions

There has been an objection that the earlier patchset would change API
behavior, and that this change should be limited to ffmpeg cli.

To achieve this, the API behavior is left unchanged now and a new function
av_hwdevice_ctx_get_or_create_derived() is added and used by the hwupload
and hwmap filters.

v2: Implemented concept for "weak references" to avoid circular reference
lockup.

v3: rebased due to conflicts

softworkz (4):
  avutil/buffer: add av_ref_from_buffer() function
  avutils/hwcontext: add derive-device function which searches for
    existing devices in both directions
  lavu: bump minor version and add doc/APIchanges entry for
    av_hwdevice_ctx_get_or_create_derived()
  avfilter/hwmap,hwupload: use new av_hwdevice_ctx_get_or_create_derived
    method

 doc/APIchanges                 |   6 ++
 libavfilter/vf_hwmap.c         |   4 +-
 libavfilter/vf_hwupload.c      |   2 +-
 libavutil/buffer.c             |  16 ++++
 libavutil/buffer.h             |   8 ++
 libavutil/hwcontext.c          | 167 +++++++++++++++++++++++++++++++--
 libavutil/hwcontext.h          |  20 ++++
 libavutil/hwcontext_internal.h |  11 +++
 libavutil/hwcontext_qsv.c      |  11 ++-
 libavutil/version.h            |   2 +-
 10 files changed, 233 insertions(+), 14 deletions(-)

base-commit: f7d510b33ff33d2f5cb096017ee1c00f624cc138

Submitted-As: https://master.gitmailbox.com/ffmpegdev/pull.25.v3.ffstaging.FFmpeg.1658446783.ffmpegagent@gmail.com
In-Reply-To: https://master.gitmailbox.com/ffmpegdev/pull.25.ffstaging.FFmpeg.1651349262.ffmpegagent@gmail.com
In-Reply-To: https://master.gitmailbox.com/ffmpegdev/pull.25.v2.ffstaging.FFmpeg.1653142062.ffmpegagent@gmail.com
Assets 2