summaryrefslogtreecommitdiff
path: root/libavcodec/avcodec.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-06-18 13:40:48 +0200
committerAnton Khirnov <anton@khirnov.net>2011-07-10 17:09:28 +0200
commit71a861cf4010ab835fab383a250f27903eb61a34 (patch)
tree5af1c2668613d3cd606b9803f34ac68c22152228 /libavcodec/avcodec.h
parent18c007ba37b2c7dee5bd2f1a3eb3bfee9b6b3d26 (diff)
lavc: make avcodec_alloc_context3 officially public.
Deprecate avcodec_alloc_context/2.
Diffstat (limited to 'libavcodec/avcodec.h')
-rw-r--r--libavcodec/avcodec.h27
1 files changed, 22 insertions, 5 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 7c7a0c6a97..3f016807ab 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3529,21 +3529,38 @@ void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType);
* we WILL change its arguments and name a few times! */
int avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec);
+#if FF_API_ALLOC_CONTEXT
/**
* Allocate an AVCodecContext and set its fields to default values. The
* resulting struct can be deallocated by simply calling av_free().
*
* @return An AVCodecContext filled with default values or NULL on failure.
* @see avcodec_get_context_defaults
+ *
+ * @deprecated use avcodec_alloc_context3()
*/
+attribute_deprecated
AVCodecContext *avcodec_alloc_context(void);
/** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API!
* we WILL change its arguments and name a few times! */
+attribute_deprecated
AVCodecContext *avcodec_alloc_context2(enum AVMediaType);
+#endif
-/** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API!
- * we WILL change its arguments and name a few times! */
+/**
+ * Allocate an AVCodecContext and set its fields to default values. The
+ * resulting struct can be deallocated by simply calling av_free().
+ *
+ * @param codec if non-NULL, allocate private data and initialize defaults
+ * for the given codec. It is illegal to then call avcodec_open()
+ * with a different codec.
+ *
+ * @return An AVCodecContext filled with default values or NULL on failure.
+ * @see avcodec_get_context_defaults
+ *
+ * @deprecated use avcodec_alloc_context3()
+ */
AVCodecContext *avcodec_alloc_context3(AVCodec *codec);
/**
@@ -3553,7 +3570,7 @@ AVCodecContext *avcodec_alloc_context3(AVCodec *codec);
* can use this AVCodecContext to decode/encode video/audio data.
*
* @param dest target codec context, should be initialized with
- * avcodec_alloc_context(), but otherwise uninitialized
+ * avcodec_alloc_context3(), but otherwise uninitialized
* @param src source codec context
* @return AVERROR() on error (e.g. memory allocation error), 0 on success
*/
@@ -3640,7 +3657,7 @@ int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2,
* if (!codec)
* exit(1);
*
- * context = avcodec_alloc_context();
+ * context = avcodec_alloc_context3(codec);
*
* if (avcodec_open(context, codec) < 0)
* exit(1);
@@ -3649,7 +3666,7 @@ int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2,
* @param avctx The context which will be set up to use the given codec.
* @param codec The codec to use within the context.
* @return zero on success, a negative value on error
- * @see avcodec_alloc_context, avcodec_find_decoder, avcodec_find_encoder, avcodec_close
+ * @see avcodec_alloc_context3, avcodec_find_decoder, avcodec_find_encoder, avcodec_close
*
* @deprecated use avcodec_open2
*/