Justin Ruggles <[email protected]> writes:
> A new field, AVCodecContext.internal is used to hold a new struct
> AVCodecInternal, which has private fields that are not codec-specific and are
> needed only by general libavcodec functions.
>
> Moved user_buffer, user_buffer_count, and is_copy.
> ---
> doc/APIchanges | 8 +++++
> libavcodec/avcodec.h | 24 +++++++++++++--
> libavcodec/h264.c | 4 ++-
> libavcodec/internal.h | 22 +++++++++++++
> libavcodec/mimic.c | 5 ++-
> libavcodec/mpegvideo.c | 3 +-
> libavcodec/options.c | 4 ++-
> libavcodec/pthread.c | 7 ++--
> libavcodec/utils.c | 78
> +++++++++++++++++++++++++++---------------------
> libavcodec/version.h | 5 ++-
> libavcodec/vp3.c | 5 ++-
> libavcodec/vp8.c | 4 ++-
> 12 files changed, 122 insertions(+), 47 deletions(-)
>
[...]
> diff --git a/libavcodec/h264.c b/libavcodec/h264.c
> index d959d56..9c76445 100644
> --- a/libavcodec/h264.c
> +++ b/libavcodec/h264.c
> @@ -1172,8 +1172,10 @@ static void copy_parameter_set(void **to, void **from,
> int count, int size)
>
> static int decode_init_thread_copy(AVCodecContext *avctx){
> H264Context *h= avctx->priv_data;
> + AVCodecInternal *avci = avctx->internal;
>
> - if (!avctx->is_copy) return 0;
> + if (!avci->is_copy)
> + return 0;
if (!avctx->internal->is_copy) perhaps. Same in a few other places
using ->internal only once in a function.
[...]
> diff --git a/libavcodec/options.c b/libavcodec/options.c
> index e747408..3ebb97b 100644
> --- a/libavcodec/options.c
> +++ b/libavcodec/options.c
> @@ -329,7 +329,9 @@ static const AVOption options[]={
> {"ibias", "intra quant bias", OFFSET(intra_quant_bias), AV_OPT_TYPE_INT,
> {.dbl = FF_DEFAULT_QUANT_BIAS }, INT_MIN, INT_MAX, V|E},
> {"pbias", "inter quant bias", OFFSET(inter_quant_bias), AV_OPT_TYPE_INT,
> {.dbl = FF_DEFAULT_QUANT_BIAS }, INT_MIN, INT_MAX, V|E},
> {"color_table_id", NULL, OFFSET(color_table_id), AV_OPT_TYPE_INT, {.dbl =
> DEFAULT }, INT_MIN, INT_MAX},
> +#if FF_API_INTERNAL_CONTEXT
> {"internal_buffer_count", NULL, OFFSET(internal_buffer_count),
> AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX},
> +#endif
This line can be removed immediately. Since the field is explicitly
marked "do not touch", exposing it here makes no sense at all.
Furthermore, even if someone were using this somehow, they'd only be
(deservedly) getting garbage after this patch.
--
Måns Rullgård
[email protected]
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel