summaryrefslogtreecommitdiff
path: root/libavformat/options.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/options.c')
-rw-r--r--libavformat/options.c50
1 files changed, 26 insertions, 24 deletions
diff --git a/libavformat/options.c b/libavformat/options.c
index f0d2c47e1e..04d9c454d3 100644
--- a/libavformat/options.c
+++ b/libavformat/options.c
@@ -1,26 +1,25 @@
/*
* Copyright (c) 2000, 2001, 2002 Fabrice Bellard
*
- * This file is part of Libav.
+ * This file is part of FFmpeg.
*
- * Libav is free software; you can redistribute it and/or
+ * FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
- * Libav is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "avformat.h"
#include "avio_internal.h"
#include "internal.h"
-#include "url.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
@@ -82,6 +81,13 @@ static const AVClass *format_child_class_next(const AVClass *prev)
return NULL;
}
+static AVClassCategory get_category(void *ptr)
+{
+ AVFormatContext* s = ptr;
+ if(s->iformat) return AV_CLASS_CATEGORY_DEMUXER;
+ else return AV_CLASS_CATEGORY_MUXER;
+}
+
static const AVClass av_format_context_class = {
.class_name = "AVFormatContext",
.item_name = format_to_name,
@@ -89,31 +95,21 @@ static const AVClass av_format_context_class = {
.version = LIBAVUTIL_VERSION_INT,
.child_next = format_child_next,
.child_class_next = format_child_class_next,
+ .category = AV_CLASS_CATEGORY_MUXER,
+ .get_category = get_category,
};
static int io_open_default(AVFormatContext *s, AVIOContext **pb,
const char *url, int flags, AVDictionary **options)
{
- AVDictionary *opts_local = NULL;
- int ret;
-
- if (!options)
- options = &opts_local;
+#if FF_API_OLD_OPEN_CALLBACKS
+FF_DISABLE_DEPRECATION_WARNINGS
+ if (s->open_cb)
+ return s->open_cb(s, pb, url, flags, &s->interrupt_callback, options);
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
- if (s->protocol_whitelist) {
- ret = av_dict_set(options, "protocol_whitelist", s->protocol_whitelist, 0);
- if (ret < 0)
- goto finish;
- }
- if (s->protocol_blacklist) {
- ret = av_dict_set(options, "protocol_blacklist", s->protocol_blacklist, 0);
- if (ret < 0)
- goto finish;
- }
- ret = avio_open2(pb, url, flags, &s->interrupt_callback, options);
-finish:
- av_dict_free(&opts_local);
- return ret;
+ return ffio_open_whitelist(pb, url, flags, &s->interrupt_callback, options, s->protocol_whitelist, s->protocol_blacklist);
}
static void io_close_default(AVFormatContext *s, AVIOContext *pb)
@@ -146,10 +142,16 @@ AVFormatContext *avformat_alloc_context(void)
return NULL;
}
ic->internal->offset = AV_NOPTS_VALUE;
+ ic->internal->raw_packet_buffer_remaining_size = RAW_PACKET_BUFFER_SIZE;
return ic;
}
+enum AVDurationEstimationMethod av_fmt_ctx_get_duration_estimation_method(const AVFormatContext* ctx)
+{
+ return ctx->duration_estimation_method;
+}
+
const AVClass *avformat_get_class(void)
{
return &av_format_context_class;