Quoting Vittorio Giovara (2015-03-10 02:28:53)
> This field is designed for marking codec properties useful to lavc internals.
> Two internal capabilities are added:
> - CODEC_INT_CAP_THREAD_SAFE: codec can be opened without locks;
> - CODEC_INT_CAP_CLEANUP_INIT: codec frees memory if initialization fails.
> ---
> I feel like the variable name is overly long but not sure how else (or if
> at all) to call it. Any suggestions?
internal_caps? Or possibly caps_internal.
> Vittorio
>
> libavcodec/avcodec.h | 5 +++++
> libavcodec/internal.h | 10 ++++++++++
> libavcodec/utils.c | 7 ++++++-
> 3 files changed, 21 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 8b9e21f..b9e5375 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -2924,6 +2924,11 @@ typedef struct AVCodec {
> * Will be called when seeking
> */
> void (*flush)(AVCodecContext *);
> + /**
> + * Internal codec capabilities.
> + * see CODEC_CAP_INT_* in internal.h
> + */
> + int internal_capabilities;
> } AVCodec;
>
> /**
> diff --git a/libavcodec/internal.h b/libavcodec/internal.h
> index a68d613..bbc7d22 100644
> --- a/libavcodec/internal.h
> +++ b/libavcodec/internal.h
> @@ -33,6 +33,16 @@
> #include "avcodec.h"
> #include "config.h"
>
> +/**
> + * Codec is thread safe.
> + */
> +#define CODEC_INT_CAP_THREAD_SAFE 1 << 0
> +/**
> + * Codec cleans up memory on init failure.
> + */
> +#define CODEC_INT_CAP_CLEANUP_INIT 1 << 1
FF_-prefixed please
And add parentheses.
--
Anton Khirnov
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel