]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/options.c
movenc: Use null buffers for measuring the amount of data to be written
[ffmpeg] / libavcodec / options.c
index abbca0bf2491ca3b499c2cd798bbafddd49a101a..8d36c01183a72645d28f53595f686f5eeef35abc 100644 (file)
 #include "avcodec.h"
 #include "internal.h"
 #include "libavutil/avassert.h"
+#include "libavutil/mem.h"
 #include "libavutil/opt.h"
 #include <float.h>              /* FLT_MIN, FLT_MAX */
+#include <string.h>
 
 #include "options_table.h"
 
@@ -68,14 +70,15 @@ static const AVClass *codec_child_class_next(const AVClass *prev)
 static const AVClass av_codec_context_class = {
     .class_name              = "AVCodecContext",
     .item_name               = context_to_name,
-    .option                  = options,
+    .option                  = avcodec_options,
     .version                 = LIBAVUTIL_VERSION_INT,
     .log_level_offset_offset = offsetof(AVCodecContext, log_level_offset),
     .child_next              = codec_child_next,
     .child_class_next        = codec_child_class_next,
 };
 
-int avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec){
+int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec)
+{
     memset(s, 0, sizeof(AVCodecContext));
 
     s->av_class = &av_codec_context_class;
@@ -85,16 +88,14 @@ int avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec){
     av_opt_set_defaults(s);
 
     s->time_base           = (AVRational){0,1};
-    s->get_buffer          = avcodec_default_get_buffer;
-    s->release_buffer      = avcodec_default_release_buffer;
+    s->get_buffer2         = avcodec_default_get_buffer2;
     s->get_format          = avcodec_default_get_format;
     s->execute             = avcodec_default_execute;
     s->execute2            = avcodec_default_execute2;
     s->sample_aspect_ratio = (AVRational){0,1};
-    s->pix_fmt             = PIX_FMT_NONE;
+    s->pix_fmt             = AV_PIX_FMT_NONE;
     s->sample_fmt          = AV_SAMPLE_FMT_NONE;
 
-    s->reget_buffer        = avcodec_default_reget_buffer;
     s->reordered_opaque    = AV_NOPTS_VALUE;
     if(codec && codec->priv_data_size){
         if(!s->priv_data){
@@ -120,7 +121,8 @@ int avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec){
     return 0;
 }
 
-AVCodecContext *avcodec_alloc_context3(AVCodec *codec){
+AVCodecContext *avcodec_alloc_context3(const AVCodec *codec)
+{
     AVCodecContext *avctx= av_malloc(sizeof(AVCodecContext));
 
     if(avctx==NULL) return NULL;