Browse Source

pthread_frame: introduce a codec callback to update the user-facing context

master
Hendrik Leppkes James Almer 5 years ago
parent
commit
82ebe0c796
2 changed files with 7 additions and 0 deletions
  1. +5
    -0
      libavcodec/codec.h
  2. +2
    -0
      libavcodec/pthread_frame.c

+ 5
- 0
libavcodec/codec.h View File

@@ -258,6 +258,11 @@ typedef struct AVCodec {
* dst and src will (rarely) point to the same context, in which case memcpy should be skipped. * dst and src will (rarely) point to the same context, in which case memcpy should be skipped.
*/ */
int (*update_thread_context)(struct AVCodecContext *dst, const struct AVCodecContext *src); int (*update_thread_context)(struct AVCodecContext *dst, const struct AVCodecContext *src);

/**
* Copy variables back to the user-facing context
*/
int (*update_thread_context_for_user)(struct AVCodecContext *dst, const struct AVCodecContext *src);
/** @} */ /** @} */


/** /**


+ 2
- 0
libavcodec/pthread_frame.c View File

@@ -326,6 +326,8 @@ FF_DISABLE_DEPRECATION_WARNINGS
dst->coded_frame = src->coded_frame; dst->coded_frame = src->coded_frame;
FF_ENABLE_DEPRECATION_WARNINGS FF_ENABLE_DEPRECATION_WARNINGS
#endif #endif
if (dst->codec->update_thread_context_for_user)
err = dst->codec->update_thread_context_for_user(dst, src);
} else { } else {
if (dst->codec->update_thread_context) if (dst->codec->update_thread_context)
err = dst->codec->update_thread_context(dst, src); err = dst->codec->update_thread_context(dst, src);


Loading…
Cancel
Save