summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c138
1 files changed, 3 insertions, 135 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index ffb114d5e9..971d4d7fcc 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -116,15 +116,9 @@ static void av_frac_add(AVFrac *f, int64_t incr)
}
/** head of registered input format linked list */
-#if !FF_API_FIRST_FORMAT
-static
-#endif
-AVInputFormat *first_iformat = NULL;
+static AVInputFormat *first_iformat = NULL;
/** head of registered output format linked list */
-#if !FF_API_FIRST_FORMAT
-static
-#endif
-AVOutputFormat *first_oformat = NULL;
+static AVOutputFormat *first_oformat = NULL;
AVInputFormat *av_iformat_next(AVInputFormat *f)
{
@@ -201,14 +195,6 @@ static int match_format(const char *name, const char *names)
return !strcasecmp(name, names);
}
-#if FF_API_GUESS_FORMAT
-AVOutputFormat *guess_format(const char *short_name, const char *filename,
- const char *mime_type)
-{
- return av_guess_format(short_name, filename, mime_type);
-}
-#endif
-
AVOutputFormat *av_guess_format(const char *short_name, const char *filename,
const char *mime_type)
{
@@ -244,27 +230,6 @@ AVOutputFormat *av_guess_format(const char *short_name, const char *filename,
return fmt_found;
}
-#if FF_API_GUESS_FORMAT
-AVOutputFormat *guess_stream_format(const char *short_name, const char *filename,
- const char *mime_type)
-{
- AVOutputFormat *fmt = av_guess_format(short_name, filename, mime_type);
-
- if (fmt) {
- AVOutputFormat *stream_fmt;
- char stream_format_name[64];
-
- snprintf(stream_format_name, sizeof(stream_format_name), "%s_stream", fmt->name);
- stream_fmt = av_guess_format(stream_format_name, NULL, NULL);
-
- if (stream_fmt)
- fmt = stream_fmt;
- }
-
- return fmt;
-}
-#endif
-
enum CodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
const char *filename, const char *mime_type, enum AVMediaType type){
if(type == AVMEDIA_TYPE_VIDEO){
@@ -296,38 +261,6 @@ AVInputFormat *av_find_input_format(const char *short_name)
return NULL;
}
-#if FF_API_SYMVER && CONFIG_SHARED && HAVE_SYMVER
-FF_SYMVER(void, av_destruct_packet_nofree, (AVPacket *pkt), "LIBAVFORMAT_52")
-{
- av_destruct_packet_nofree(pkt);
-}
-
-FF_SYMVER(void, av_destruct_packet, (AVPacket *pkt), "LIBAVFORMAT_52")
-{
- av_destruct_packet(pkt);
-}
-
-FF_SYMVER(int, av_new_packet, (AVPacket *pkt, int size), "LIBAVFORMAT_52")
-{
- return av_new_packet(pkt, size);
-}
-
-FF_SYMVER(int, av_dup_packet, (AVPacket *pkt), "LIBAVFORMAT_52")
-{
- return av_dup_packet(pkt);
-}
-
-FF_SYMVER(void, av_free_packet, (AVPacket *pkt), "LIBAVFORMAT_52")
-{
- av_free_packet(pkt);
-}
-
-FF_SYMVER(void, av_init_packet, (AVPacket *pkt), "LIBAVFORMAT_52")
-{
- av_log(NULL, AV_LOG_WARNING, "Diverting av_*_packet function calls to libavcodec. Recompile to improve performance\n");
- av_init_packet(pkt);
-}
-#endif
int av_get_packet(AVIOContext *s, AVPacket *pkt, int size)
{
@@ -513,10 +446,6 @@ int av_open_input_stream(AVFormatContext **ic_ptr,
if (pb && !ic->data_offset)
ic->data_offset = avio_tell(ic->pb);
-#if FF_API_OLD_METADATA
- ff_metadata_demux_compat(ic);
-#endif
-
ic->raw_packet_buffer_remaining_size = RAW_PACKET_BUFFER_SIZE;
*ic_ptr = ic;
@@ -637,7 +566,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
hack needed to handle RTSP/TCP */
if (!fmt || !(fmt->flags & AVFMT_NOFILE)) {
/* if no file needed do not try to open one */
- if ((err=avio_open(&pb, filename, AVIO_RDONLY)) < 0) {
+ if ((err=avio_open(&pb, filename, AVIO_FLAG_READ)) < 0) {
goto fail;
}
if (buf_size > 0) {
@@ -2639,18 +2568,11 @@ void avformat_free_context(AVFormatContext *s)
av_free(st->codec->extradata);
av_free(st->codec->subtitle_header);
av_free(st->codec);
-#if FF_API_OLD_METADATA
- av_free(st->filename);
-#endif
av_free(st->priv_data);
av_free(st->info);
av_free(st);
}
for(i=s->nb_programs-1; i>=0; i--) {
-#if FF_API_OLD_METADATA
- av_freep(&s->programs[i]->provider_name);
- av_freep(&s->programs[i]->name);
-#endif
av_metadata_free(&s->programs[i]->metadata);
av_freep(&s->programs[i]->stream_index);
av_freep(&s->programs[i]);
@@ -2658,9 +2580,6 @@ void avformat_free_context(AVFormatContext *s)
av_freep(&s->programs);
av_freep(&s->priv_data);
while(s->nb_chapters--) {
-#if FF_API_OLD_METADATA
- av_free(s->chapters[s->nb_chapters]->title);
-#endif
av_metadata_free(&s->chapters[s->nb_chapters]->metadata);
av_free(s->chapters[s->nb_chapters]);
}
@@ -2682,13 +2601,6 @@ AVStream *av_new_stream(AVFormatContext *s, int id)
{
AVStream *st;
int i;
-
-#if FF_API_MAX_STREAMS
- if (s->nb_streams >= MAX_STREAMS){
- av_log(s, AV_LOG_ERROR, "Too many streams\n");
- return NULL;
- }
-#else
AVStream **streams;
if (s->nb_streams >= INT_MAX/sizeof(*streams))
@@ -2697,7 +2609,6 @@ AVStream *av_new_stream(AVFormatContext *s, int id)
if (!streams)
return NULL;
s->streams = streams;
-#endif
st = av_mallocz(sizeof(AVStream));
if (!st)
@@ -2777,9 +2688,6 @@ AVChapter *ff_new_chapter(AVFormatContext *s, int id, AVRational time_base, int6
return NULL;
dynarray_add(&s->chapters, &s->nb_chapters, chapter);
}
-#if FF_API_OLD_METADATA
- av_free(chapter->title);
-#endif
av_metadata_set2(&chapter->metadata, "title", title, 0);
chapter->id = id;
chapter->time_base= time_base;
@@ -2917,10 +2825,6 @@ int av_write_header(AVFormatContext *s)
return AVERROR(ENOMEM);
}
-#if FF_API_OLD_METADATA
- ff_metadata_mux_compat(s);
-#endif
-
/* set muxer identification string */
if (s->nb_streams && !(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)) {
av_metadata_set2(&s->metadata, "encoder", LIBAVFORMAT_IDENT, 0);
@@ -3408,24 +3312,6 @@ void av_dump_format(AVFormatContext *ic,
av_free(printed);
}
-#if FF_API_PARSE_FRAME_PARAM
-#include "libavutil/parseutils.h"
-
-int parse_image_size(int *width_ptr, int *height_ptr, const char *str)
-{
- return av_parse_video_size(width_ptr, height_ptr, str);
-}
-
-int parse_frame_rate(int *frame_rate_num, int *frame_rate_den, const char *arg)
-{
- AVRational frame_rate;
- int ret = av_parse_video_rate(&frame_rate, arg);
- *frame_rate_num= frame_rate.num;
- *frame_rate_den= frame_rate.den;
- return ret;
-}
-#endif
-
int64_t av_gettime(void)
{
struct timeval tv;
@@ -3605,24 +3491,6 @@ void av_pkt_dump_log2(void *avcl, int level, AVPacket *pkt, int dump_payload,
pkt_dump_internal(avcl, NULL, level, pkt, dump_payload, st->time_base);
}
-#if FF_API_URL_SPLIT
-attribute_deprecated
-void ff_url_split(char *proto, int proto_size,
- char *authorization, int authorization_size,
- char *hostname, int hostname_size,
- int *port_ptr,
- char *path, int path_size,
- const char *url)
-{
- av_url_split(proto, proto_size,
- authorization, authorization_size,
- hostname, hostname_size,
- port_ptr,
- path, path_size,
- url);
-}
-#endif
-
void av_url_split(char *proto, int proto_size,
char *authorization, int authorization_size,
char *hostname, int hostname_size,