Browse Source

Merge commit '5f30ac27795f9f98043e8582ccaad8813104adc4'

* commit '5f30ac27795f9f98043e8582ccaad8813104adc4':
  lavc: deprecate avcodec_copy_context()

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
tags/n3.1
Hendrik Leppkes 9 years ago
parent
commit
6988cf2969
3 changed files with 14 additions and 0 deletions
  1. +9
    -0
      libavcodec/avcodec.h
  2. +2
    -0
      libavcodec/options.c
  3. +3
    -0
      libavcodec/version.h

+ 9
- 0
libavcodec/avcodec.h View File

@@ -4147,6 +4147,7 @@ int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec);
*/
const AVClass *avcodec_get_class(void);

#if FF_API_COPY_CONTEXT
/**
* Get the AVClass for AVFrame. It can be used in combination with
* AV_OPT_SEARCH_FAKE_OBJ for examining options.
@@ -4173,8 +4174,16 @@ const AVClass *avcodec_get_subtitle_rect_class(void);
* avcodec_alloc_context3(NULL), but otherwise uninitialized
* @param src source codec context
* @return AVERROR() on error (e.g. memory allocation error), 0 on success
*
* @deprecated The semantics of this function are ill-defined and it should not
* be used. If you need to transfer the stream parameters from one codec context
* to another, use an intermediate AVCodecParameters instance and the
* avcodec_parameters_from_context() / avcodec_parameters_to_context()
* functions.
*/
attribute_deprecated
int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src);
#endif

/**
* Allocate a new AVCodecParameters and set its fields to default values


+ 2
- 0
libavcodec/options.c View File

@@ -179,6 +179,7 @@ void avcodec_free_context(AVCodecContext **pavctx)
av_freep(pavctx);
}

#if FF_API_COPY_CONTEXT
int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
{
const AVCodec *orig_codec = dest->codec;
@@ -258,6 +259,7 @@ fail:
av_opt_free(dest);
return AVERROR(ENOMEM);
}
#endif

const AVClass *avcodec_get_class(void)
{


+ 3
- 0
libavcodec/version.h View File

@@ -217,6 +217,9 @@
#ifndef FF_API_OLD_BSF
#define FF_API_OLD_BSF (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_COPY_CONTEXT
#define FF_API_COPY_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
#ifndef FF_API_NVENC_OLD_NAME
#define FF_API_NVENC_OLD_NAME (LIBAVCODEC_VERSION_MAJOR < 59)
#endif


Loading…
Cancel
Save