[FFmpeg-cvslog] Merge commit '5f30ac27795f9f98043e8582ccaad8813104adc4'
Hendrik Leppkes
git at videolan.org
Sun Jun 26 20:23:51 CEST 2016
ffmpeg | branch: release/3.1 | Hendrik Leppkes <h.leppkes at gmail.com> | Sun Jun 26 14:34:02 2016 +0200| [6988cf2969d777ebac84d241123883357375dc6c] | committer: Hendrik Leppkes
Merge commit '5f30ac27795f9f98043e8582ccaad8813104adc4'
* commit '5f30ac27795f9f98043e8582ccaad8813104adc4':
lavc: deprecate avcodec_copy_context()
Merged-by: Hendrik Leppkes <h.leppkes at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6988cf2969d777ebac84d241123883357375dc6c
---
libavcodec/avcodec.h | 9 +++++++++
libavcodec/options.c | 2 ++
libavcodec/version.h | 3 +++
3 files changed, 14 insertions(+)
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index c8a4039..6c1d54b 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -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
diff --git a/libavcodec/options.c b/libavcodec/options.c
index ea2563b..a82f375 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -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)
{
diff --git a/libavcodec/version.h b/libavcodec/version.h
index f7cbae9..b3dc8e8 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -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
======================================================================
diff --cc libavcodec/avcodec.h
index c8a4039,639ecf3..6c1d54b
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@@ -4147,34 -3648,27 +4147,43 @@@ int avcodec_get_context_defaults3(AVCod
*/
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.
+ *
+ * @see av_opt_find().
+ */
+const AVClass *avcodec_get_frame_class(void);
+
+/**
+ * Get the AVClass for AVSubtitleRect. It can be used in combination with
+ * AV_OPT_SEARCH_FAKE_OBJ for examining options.
+ *
+ * @see av_opt_find().
+ */
+const AVClass *avcodec_get_subtitle_rect_class(void);
+
+/**
* Copy the settings of the source AVCodecContext into the destination
* AVCodecContext. The resulting destination codec context will be
* unopened, i.e. you are required to call avcodec_open2() before you
* can use this AVCodecContext to decode/encode video/audio data.
*
* @param dest target codec context, should be initialized with
- * avcodec_alloc_context3(), but otherwise uninitialized
+ * 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
diff --cc libavcodec/options.c
index ea2563b,50bacd3..a82f375
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@@ -252,12 -219,14 +253,13 @@@ fail
av_freep(&dest->intra_matrix);
av_freep(&dest->inter_matrix);
av_freep(&dest->extradata);
-#if FF_API_MPV_OPT
- FF_DISABLE_DEPRECATION_WARNINGS
- av_freep(&dest->rc_eq);
- FF_ENABLE_DEPRECATION_WARNINGS
-#endif
+ av_freep(&dest->subtitle_header);
+ dest->subtitle_header_size = 0;
+ dest->extradata_size = 0;
+ av_opt_free(dest);
return AVERROR(ENOMEM);
}
+ #endif
const AVClass *avcodec_get_class(void)
{
diff --cc libavcodec/version.h
index f7cbae9,57006c9..b3dc8e8
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@@ -217,8 -200,8 +217,11 @@@
#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
#endif /* AVCODEC_VERSION_H */
More information about the ffmpeg-cvslog
mailing list