Commit 53025fe1 authored by Derek Buitenhuis's avatar Derek Buitenhuis

Merge commit '7d61dc95'

* commit '7d61dc95':
  lavf: move urlcontext_child_class_next() to protocols.c
Merged-by: 's avatarDerek Buitenhuis <derek.buitenhuis@gmail.com>
parents 8fd53424 7d61dc95
...@@ -50,25 +50,6 @@ static void *urlcontext_child_next(void *obj, void *prev) ...@@ -50,25 +50,6 @@ static void *urlcontext_child_next(void *obj, void *prev)
return NULL; return NULL;
} }
static const AVClass *urlcontext_child_class_next(const AVClass *prev)
{
int i;
/* find the protocol that corresponds to prev */
for (i = 0; ff_url_protocols[i]; i++) {
if (ff_url_protocols[i]->priv_data_class == prev) {
i++;
break;
}
}
/* find next protocol with priv options */
for (; ff_url_protocols[i]; i++)
if (ff_url_protocols[i]->priv_data_class)
return ff_url_protocols[i]->priv_data_class;
return NULL;
}
#define OFFSET(x) offsetof(URLContext,x) #define OFFSET(x) offsetof(URLContext,x)
#define E AV_OPT_FLAG_ENCODING_PARAM #define E AV_OPT_FLAG_ENCODING_PARAM
#define D AV_OPT_FLAG_DECODING_PARAM #define D AV_OPT_FLAG_DECODING_PARAM
...@@ -76,13 +57,14 @@ static const AVOption options[] = { ...@@ -76,13 +57,14 @@ static const AVOption options[] = {
{"protocol_whitelist", "List of protocols that are allowed to be used", OFFSET(protocol_whitelist), AV_OPT_TYPE_STRING, { .str = NULL }, CHAR_MIN, CHAR_MAX, D }, {"protocol_whitelist", "List of protocols that are allowed to be used", OFFSET(protocol_whitelist), AV_OPT_TYPE_STRING, { .str = NULL }, CHAR_MIN, CHAR_MAX, D },
{ NULL } { NULL }
}; };
const AVClass ffurl_context_class = { const AVClass ffurl_context_class = {
.class_name = "URLContext", .class_name = "URLContext",
.item_name = urlcontext_to_name, .item_name = urlcontext_to_name,
.option = options, .option = options,
.version = LIBAVUTIL_VERSION_INT, .version = LIBAVUTIL_VERSION_INT,
.child_next = urlcontext_child_next, .child_next = urlcontext_child_next,
.child_class_next = urlcontext_child_class_next, .child_class_next = ff_urlcontext_child_class_next,
}; };
/*@}*/ /*@}*/
......
...@@ -207,6 +207,26 @@ const URLProtocol *ff_url_protocols[] = { ...@@ -207,6 +207,26 @@ const URLProtocol *ff_url_protocols[] = {
NULL, NULL,
}; };
const AVClass *ff_urlcontext_child_class_next(const AVClass *prev)
{
int i;
/* find the protocol that corresponds to prev */
for (i = 0; ff_url_protocols[i]; i++) {
if (ff_url_protocols[i]->priv_data_class == prev) {
i++;
break;
}
}
/* find next protocol with priv options */
for (; ff_url_protocols[i]; i++)
if (ff_url_protocols[i]->priv_data_class)
return ff_url_protocols[i]->priv_data_class;
return NULL;
}
const char *avio_enum_protocols(void **opaque, int output) const char *avio_enum_protocols(void **opaque, int output)
{ {
const URLProtocol **p = *opaque; const URLProtocol **p = *opaque;
......
...@@ -309,6 +309,8 @@ void ff_make_absolute_url(char *buf, int size, const char *base, ...@@ -309,6 +309,8 @@ void ff_make_absolute_url(char *buf, int size, const char *base,
*/ */
AVIODirEntry *ff_alloc_dir_entry(void); AVIODirEntry *ff_alloc_dir_entry(void);
const AVClass *ff_urlcontext_child_class_next(const AVClass *prev);
extern const URLProtocol *ff_url_protocols[]; extern const URLProtocol *ff_url_protocols[];
#endif /* AVFORMAT_URL_H */ #endif /* AVFORMAT_URL_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment