summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorJosh de Kock <josh@itanimul.li>2018-03-23 10:16:15 +0000
committerJosh de Kock <josh@itanimul.li>2018-03-31 23:26:31 +0100
commitd8ae40611bc01257776b71f20d774eb720151906 (patch)
tree125ca3583f0c36bd81ba4c26e74191ba189f9e63 /libavformat
parent8f1382f80e0d4184c54c14afdda6482f050fbba7 (diff)
Revert "lavd: add new API for iterating input and output devices"
This reverts commit 0fd475704e871ef3a535947596a012894bae3cbd. Revert "lavd: fix iterating of input and output devices" This reverts commit ce1d77a5e7cebce11074bf6f9e38ad6da37338ff. Signed-off-by: Josh de Kock <josh@itanimul.li>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/allformats.c42
-rw-r--r--libavformat/format.c8
-rw-r--r--libavformat/internal.h7
3 files changed, 2 insertions, 55 deletions
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 9dc5ce8a76..e748faf4e6 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -25,9 +25,6 @@
#include "rdt.h"
#include "url.h"
#include "version.h"
-#if FF_API_NEXT
-#include "internal.h"
-#endif
/* (de)muxers */
extern AVOutputFormat ff_a64_muxer;
@@ -491,7 +488,6 @@ const AVOutputFormat *av_muxer_iterate(void **opaque)
{
uintptr_t i = (uintptr_t)*opaque;
const AVOutputFormat *f = muxer_list[i];
-
if (f)
*opaque = (void*)(i + 1);
return f;
@@ -510,9 +506,6 @@ const AVInputFormat *av_demuxer_iterate(void **opaque){
FF_DISABLE_DEPRECATION_WARNINGS
static AVOnce av_format_next_init = AV_ONCE_INIT;
-static const AVInputFormat * const *indev_list = NULL;
-static const AVOutputFormat * const *outdev_list = NULL;
-
static void av_format_init_next(void)
{
AVOutputFormat *prevout = NULL, *out;
@@ -525,61 +518,30 @@ static void av_format_init_next(void)
prevout = out;
}
- if (outdev_list) {
- for (int j = 0; (out = (AVOutputFormat*)outdev_list[j]); j++) {
- if (prevout)
- prevout->next = out;
- prevout = out;
- }
- }
-
i = 0;
while ((in = (AVInputFormat*)av_demuxer_iterate(&i))) {
if (previn)
previn->next = in;
previn = in;
}
-
- if (indev_list) {
- for (int j = 0; (in = (AVInputFormat*)indev_list[j]); j++) {
- if (previn)
- previn->next = in;
- previn = in;
- }
- }
-
-}
-
-void avpriv_register_devices(const AVOutputFormat * const o[], const AVInputFormat * const i[])
-{
- static AVMutex avpriv_register_devices_mutex = AV_MUTEX_INITIALIZER;
- ff_mutex_lock(&avpriv_register_devices_mutex);
- outdev_list = o;
- indev_list = i;
- av_format_init_next();
- ff_mutex_unlock(&avpriv_register_devices_mutex);
}
AVInputFormat *av_iformat_next(const AVInputFormat *f)
{
ff_thread_once(&av_format_next_init, av_format_init_next);
-
if (f)
return f->next;
else
- /* If there are no demuxers but input devices, then return the first input device.
- * This will still return null if both there are both no demuxers or input devices. */
- return demuxer_list[0] ? (AVInputFormat*)demuxer_list[0] : (indev_list ? (AVInputFormat*)indev_list[0] : NULL);
+ return demuxer_list[0];
}
AVOutputFormat *av_oformat_next(const AVOutputFormat *f)
{
ff_thread_once(&av_format_next_init, av_format_init_next);
-
if (f)
return f->next;
else
- return muxer_list[0] ? (AVOutputFormat*)muxer_list[0] : (outdev_list ? (AVOutputFormat*)outdev_list[0] : NULL);
+ return muxer_list[0];
}
void av_register_all(void)
diff --git a/libavformat/format.c b/libavformat/format.c
index 75951938cf..123f5faf6c 100644
--- a/libavformat/format.c
+++ b/libavformat/format.c
@@ -129,18 +129,10 @@ enum AVCodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
AVInputFormat *av_find_input_format(const char *short_name)
{
AVInputFormat *fmt = NULL;
-#if FF_API_NEXT
-FF_DISABLE_DEPRECATION_WARNINGS
- while ((fmt = av_iformat_next(fmt)))
- if (av_match_name(short_name, fmt->name))
- return fmt;
-FF_ENABLE_DEPRECATION_WARNINGS
-#else
void *i = 0;
while ((fmt = av_demuxer_iterate(&i)))
if (av_match_name(short_name, fmt->name))
return fmt;
-#endif
return NULL;
}
diff --git a/libavformat/internal.h b/libavformat/internal.h
index a020b1b417..619063097f 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -731,11 +731,4 @@ int ff_unlock_avformat(void);
*/
void ff_format_set_url(AVFormatContext *s, char *url);
-#if FF_API_NEXT
-/**
- * Register devices in deprecated format linked list.
- */
-void avpriv_register_devices(const AVOutputFormat * const o[], const AVInputFormat * const i[]);
-#endif
-
#endif /* AVFORMAT_INTERNAL_H */