diff mbox series

[FFmpeg-devel] lavc: clarify thread_safe_callbacks doxy

Message ID 20210302091025.8633-1-anton@khirnov.net
State Accepted
Commit 54e5d21acabb452e5680de5db3bf7567d351d68e
Headers show
Series [FFmpeg-devel] lavc: clarify thread_safe_callbacks doxy | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Anton Khirnov March 2, 2021, 9:10 a.m. UTC
State explicitly when this field will be removed and how to access it in
a forward compatible way.
---
 libavcodec/avcodec.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

James Almer March 2, 2021, 12:56 p.m. UTC | #1
On 3/2/2021 6:10 AM, Anton Khirnov wrote:
> State explicitly when this field will be removed and how to access it in
> a forward compatible way.
> ---
>   libavcodec/avcodec.h | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index cd6e6d19bc..5a0904a854 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -1797,7 +1797,11 @@ typedef struct AVCodecContext {
>        *
>        * @deprecated the custom get_buffer2() callback should always be
>        *   thread-safe. Thread-unsafe get_buffer2() implementations will be
> -     *   invalid once this field is removed.
> +     *   invalid starting with LIBAVCODEC_VERSION_MAJOR=60; in other words,
> +     *   libavcodec will behave as if this field was always set to 1.
> +     *   Callers that want to be forward compatible with future libavcodec
> +     *   versions should wrap access to this field in
> +     *     #if LIBAVCODEC_VERSION_MAJOR < 60
>        */
>       attribute_deprecated
>       int thread_safe_callbacks;

LGTM.
diff mbox series

Patch

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index cd6e6d19bc..5a0904a854 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1797,7 +1797,11 @@  typedef struct AVCodecContext {
      *
      * @deprecated the custom get_buffer2() callback should always be
      *   thread-safe. Thread-unsafe get_buffer2() implementations will be
-     *   invalid once this field is removed.
+     *   invalid starting with LIBAVCODEC_VERSION_MAJOR=60; in other words,
+     *   libavcodec will behave as if this field was always set to 1.
+     *   Callers that want to be forward compatible with future libavcodec
+     *   versions should wrap access to this field in
+     *     #if LIBAVCODEC_VERSION_MAJOR < 60
      */
     attribute_deprecated
     int thread_safe_callbacks;