libswscale/options: Add parent_log_context_offset to AVClass

This allows to associate log messages from slice contexts to
the user-visible SwsContext.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
pull/369/head
Andreas Rheinhardt 3 years ago
parent d69332e688
commit a1255a350d
  1. 1
      libswscale/options.c
  2. 2
      libswscale/swscale_internal.h
  3. 2
      libswscale/utils.c

@ -91,6 +91,7 @@ const AVClass ff_sws_context_class = {
.class_name = "SWScaler",
.item_name = sws_context_to_name,
.option = swscale_options,
.parent_log_context_offset = OFFSET(parent),
.category = AV_CLASS_CATEGORY_SWSCALER,
.version = LIBAVUTIL_VERSION_INT,
};

@ -301,6 +301,8 @@ typedef struct SwsContext {
*/
const AVClass *av_class;
struct SwsContext *parent;
AVSliceThread *slicethread;
struct SwsContext **slice_ctx;
int *slice_err;

@ -1214,6 +1214,8 @@ static int context_init_threaded(SwsContext *c,
if (!c->slice_ctx[i])
return AVERROR(ENOMEM);
c->slice_ctx[i]->parent = c;
ret = av_opt_copy((void*)c->slice_ctx[i], (void*)c);
if (ret < 0)
return ret;

Loading…
Cancel
Save