]> git.sesse.net Git - ffmpeg/commitdiff
pthread_frame: introduce a codec callback to update the user-facing context
authorHendrik Leppkes <h.leppkes@gmail.com>
Mon, 6 Jul 2020 00:29:59 +0000 (02:29 +0200)
committerJames Almer <jamrial@gmail.com>
Wed, 14 Apr 2021 23:05:16 +0000 (20:05 -0300)
libavcodec/codec.h
libavcodec/pthread_frame.c

index 50a22f6e3cb0a5d068c6a2cea07de4fdebe9123a..de050b2815ffb2aa650cc9769d7d4835dc1ee024 100644 (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.
      */
     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);
     /** @} */
 
     /**
index 9176027f15f9855500f3a10cc77bfae9a6ea5503..ae5b000d97fead4de4a917d9397e06948b037add 100644 (file)
@@ -326,6 +326,8 @@ FF_DISABLE_DEPRECATION_WARNINGS
         dst->coded_frame = src->coded_frame;
 FF_ENABLE_DEPRECATION_WARNINGS
 #endif
+        if (dst->codec->update_thread_context_for_user)
+            err = dst->codec->update_thread_context_for_user(dst, src);
     } else {
         if (dst->codec->update_thread_context)
             err = dst->codec->update_thread_context(dst, src);