|
@@ -30,6 +30,7 @@
|
|
|
#include "libavutil/samplefmt.h"
|
|
|
#include "libavutil/avutil.h"
|
|
|
#include "libavutil/cpu.h"
|
|
|
+#include "libavutil/dict.h"
|
|
|
|
|
|
#include "libavcodec/version.h"
|
|
|
|
|
@@ -3615,6 +3616,7 @@ int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, v
|
|
|
int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count);
|
|
|
//FIXME func typedef
|
|
|
|
|
|
+#if FF_API_AVCODEC_OPEN
|
|
|
/**
|
|
|
* Initialize the AVCodecContext to use the given AVCodec. Prior to using this
|
|
|
* function the context has to be allocated.
|
|
@@ -3641,8 +3643,45 @@ int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2,
|
|
|
* @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
|
|
|
+ *
|
|
|
+ * @deprecated use avcodec_open2
|
|
|
*/
|
|
|
+attribute_deprecated
|
|
|
int avcodec_open(AVCodecContext *avctx, AVCodec *codec);
|
|
|
+#endif
|
|
|
+
|
|
|
+/**
|
|
|
+ * Initialize the AVCodecContext to use the given AVCodec. Prior to using this
|
|
|
+ * function the context has to be allocated with avcodec_alloc_context().
|
|
|
+ *
|
|
|
+ * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(),
|
|
|
+ * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for
|
|
|
+ * retrieving a codec.
|
|
|
+ *
|
|
|
+ * @warning This function is not thread safe!
|
|
|
+ *
|
|
|
+ * @code
|
|
|
+ * avcodec_register_all();
|
|
|
+ * av_dict_set(&opts, "b", "2.5M", 0);
|
|
|
+ * codec = avcodec_find_decoder(CODEC_ID_H264);
|
|
|
+ * if (!codec)
|
|
|
+ * exit(1);
|
|
|
+ *
|
|
|
+ * context = avcodec_alloc_context();
|
|
|
+ *
|
|
|
+ * if (avcodec_open(context, codec, opts) < 0)
|
|
|
+ * exit(1);
|
|
|
+ * @endcode
|
|
|
+ *
|
|
|
+ * @param avctx The context to initialize.
|
|
|
+ * @param options A dictionary filled with AVCodecContext and codec-private options.
|
|
|
+ * On return this object will be filled with options that were not found.
|
|
|
+ *
|
|
|
+ * @return zero on success, a negative value on error
|
|
|
+ * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(),
|
|
|
+ * av_dict_set(), av_opt_find().
|
|
|
+ */
|
|
|
+int avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVDictionary **options);
|
|
|
|
|
|
/**
|
|
|
* Decode the audio frame of size avpkt->size from avpkt->data into samples.
|