mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-25 16:52:31 +00:00
avutil: remove deprecated AVClass.child_class_next
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
3749eede66
commit
0bf3a7361d
@ -91,28 +91,6 @@ const AVBitStreamFilter *av_bsf_get_by_name(const char *name)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if FF_API_CHILD_CLASS_NEXT
|
||||
const AVClass *ff_bsf_child_class_next(const AVClass *prev)
|
||||
{
|
||||
const AVBitStreamFilter *f = NULL;
|
||||
void *i = 0;
|
||||
|
||||
/* find the filter that corresponds to prev */
|
||||
while (prev && (f = av_bsf_iterate(&i))) {
|
||||
if (f->priv_class == prev) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* find next filter with priv options */
|
||||
while ((f = av_bsf_iterate(&i))) {
|
||||
if (f->priv_class)
|
||||
return f->priv_class;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
const AVClass *ff_bsf_child_class_iterate(void **opaque)
|
||||
{
|
||||
const AVBitStreamFilter *f;
|
||||
|
@ -80,9 +80,6 @@ static const AVClass bsf_class = {
|
||||
.item_name = bsf_to_name,
|
||||
.version = LIBAVUTIL_VERSION_INT,
|
||||
.child_next = bsf_child_next,
|
||||
#if FF_API_CHILD_CLASS_NEXT
|
||||
.child_class_next = ff_bsf_child_class_next,
|
||||
#endif
|
||||
.child_class_iterate = ff_bsf_child_class_iterate,
|
||||
.category = AV_CLASS_CATEGORY_BITSTREAM_FILTER,
|
||||
};
|
||||
|
@ -42,10 +42,6 @@ int ff_bsf_get_packet(AVBSFContext *ctx, AVPacket **pkt);
|
||||
*/
|
||||
int ff_bsf_get_packet_ref(AVBSFContext *ctx, AVPacket *pkt);
|
||||
|
||||
#if FF_API_CHILD_CLASS_NEXT
|
||||
const AVClass *ff_bsf_child_class_next(const AVClass *prev);
|
||||
#endif
|
||||
|
||||
const AVClass *ff_bsf_child_class_iterate(void **opaque);
|
||||
|
||||
#endif /* AVCODEC_BSF_INTERNAL_H */
|
||||
|
@ -53,25 +53,6 @@ static void *codec_child_next(void *obj, void *prev)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if FF_API_CHILD_CLASS_NEXT
|
||||
static const AVClass *codec_child_class_next(const AVClass *prev)
|
||||
{
|
||||
void *iter = NULL;
|
||||
const AVCodec *c = NULL;
|
||||
|
||||
/* find the codec that corresponds to prev */
|
||||
while (prev && (c = av_codec_iterate(&iter)))
|
||||
if (c->priv_class == prev)
|
||||
break;
|
||||
|
||||
/* find next codec with priv options */
|
||||
while (c = av_codec_iterate(&iter))
|
||||
if (c->priv_class)
|
||||
return c->priv_class;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
static const AVClass *codec_child_class_iterate(void **iter)
|
||||
{
|
||||
const AVCodec *c;
|
||||
@ -96,9 +77,6 @@ static const AVClass av_codec_context_class = {
|
||||
.version = LIBAVUTIL_VERSION_INT,
|
||||
.log_level_offset_offset = offsetof(AVCodecContext, log_level_offset),
|
||||
.child_next = codec_child_next,
|
||||
#if FF_API_CHILD_CLASS_NEXT
|
||||
.child_class_next = codec_child_class_next,
|
||||
#endif
|
||||
.child_class_iterate = codec_child_class_iterate,
|
||||
.category = AV_CLASS_CATEGORY_ENCODER,
|
||||
.get_category = get_category,
|
||||
|
@ -293,13 +293,6 @@ static int request_frame(AVFilterLink *outlink)
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if FF_API_CHILD_CLASS_NEXT
|
||||
static const AVClass *resample_child_class_next(const AVClass *prev)
|
||||
{
|
||||
return prev ? NULL : swr_get_class();
|
||||
}
|
||||
#endif
|
||||
|
||||
static const AVClass *resample_child_class_iterate(void **iter)
|
||||
{
|
||||
const AVClass *c = *iter ? NULL : swr_get_class();
|
||||
@ -326,9 +319,6 @@ static const AVClass aresample_class = {
|
||||
.item_name = av_default_item_name,
|
||||
.option = options,
|
||||
.version = LIBAVUTIL_VERSION_INT,
|
||||
#if FF_API_CHILD_CLASS_NEXT
|
||||
.child_class_next = resample_child_class_next,
|
||||
#endif
|
||||
.child_class_iterate = resample_child_class_iterate,
|
||||
.child_next = resample_child_next,
|
||||
};
|
||||
|
@ -571,30 +571,6 @@ static void *filter_child_next(void *obj, void *prev)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if FF_API_CHILD_CLASS_NEXT
|
||||
static const AVClass *filter_child_class_next(const AVClass *prev)
|
||||
{
|
||||
void *opaque = NULL;
|
||||
const AVFilter *f = NULL;
|
||||
|
||||
/* find the filter that corresponds to prev */
|
||||
while (prev && (f = av_filter_iterate(&opaque)))
|
||||
if (f->priv_class == prev)
|
||||
break;
|
||||
|
||||
/* could not find filter corresponding to prev */
|
||||
if (prev && !f)
|
||||
return NULL;
|
||||
|
||||
/* find next filter with specific options */
|
||||
while ((f = av_filter_iterate(&opaque)))
|
||||
if (f->priv_class)
|
||||
return f->priv_class;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
static const AVClass *filter_child_class_iterate(void **iter)
|
||||
{
|
||||
const AVFilter *f;
|
||||
@ -627,9 +603,6 @@ static const AVClass avfilter_class = {
|
||||
.version = LIBAVUTIL_VERSION_INT,
|
||||
.category = AV_CLASS_CATEGORY_FILTER,
|
||||
.child_next = filter_child_next,
|
||||
#if FF_API_CHILD_CLASS_NEXT
|
||||
.child_class_next = filter_child_class_next,
|
||||
#endif
|
||||
.child_class_iterate = filter_child_class_iterate,
|
||||
.option = avfilter_options,
|
||||
};
|
||||
|
@ -305,9 +305,6 @@ static int name##_framesync_preinit(AVFilterContext *ctx) { \
|
||||
ff_framesync_preinit(&s->field); \
|
||||
return 0; \
|
||||
} \
|
||||
static const AVClass *name##_child_class_next(const AVClass *prev) { \
|
||||
return prev ? NULL : ff_framesync_get_class(); \
|
||||
} \
|
||||
static void *name##_child_next(void *obj, void *prev) { \
|
||||
context *s = obj; \
|
||||
s->fs.class = ff_framesync_get_class(); /* FIXME */ \
|
||||
@ -319,7 +316,6 @@ static const AVClass name##_class = { \
|
||||
.option = name##_options, \
|
||||
.version = LIBAVUTIL_VERSION_INT, \
|
||||
.category = AV_CLASS_CATEGORY_FILTER, \
|
||||
.child_class_next = name##_child_class_next, \
|
||||
.child_class_iterate = ff_framesync_child_class_iterate, \
|
||||
.child_next = name##_child_next, \
|
||||
}
|
||||
|
@ -879,13 +879,6 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if FF_API_CHILD_CLASS_NEXT
|
||||
static const AVClass *child_class_next(const AVClass *prev)
|
||||
{
|
||||
return prev ? NULL : sws_get_class();
|
||||
}
|
||||
#endif
|
||||
|
||||
static const AVClass *child_class_iterate(void **iter)
|
||||
{
|
||||
const AVClass *c = *iter ? NULL : sws_get_class();
|
||||
@ -950,9 +943,6 @@ static const AVClass scale_class = {
|
||||
.option = scale_options,
|
||||
.version = LIBAVUTIL_VERSION_INT,
|
||||
.category = AV_CLASS_CATEGORY_FILTER,
|
||||
#if FF_API_CHILD_CLASS_NEXT
|
||||
.child_class_next = child_class_next,
|
||||
#endif
|
||||
.child_class_iterate = child_class_iterate,
|
||||
};
|
||||
|
||||
@ -993,9 +983,6 @@ static const AVClass scale2ref_class = {
|
||||
.option = scale_options,
|
||||
.version = LIBAVUTIL_VERSION_INT,
|
||||
.category = AV_CLASS_CATEGORY_FILTER,
|
||||
#if FF_API_CHILD_CLASS_NEXT
|
||||
.child_class_next = child_class_next,
|
||||
#endif
|
||||
.child_class_iterate = child_class_iterate,
|
||||
};
|
||||
|
||||
|
@ -46,13 +46,6 @@ enum mode {
|
||||
NB_MODES
|
||||
};
|
||||
|
||||
#if FF_API_CHILD_CLASS_NEXT
|
||||
static const AVClass *child_class_next(const AVClass *prev)
|
||||
{
|
||||
return prev ? NULL : avcodec_dct_get_class();
|
||||
}
|
||||
#endif
|
||||
|
||||
static const AVClass *child_class_iterate(void **iter)
|
||||
{
|
||||
const AVClass *c = *iter ? NULL : avcodec_dct_get_class();
|
||||
@ -85,9 +78,6 @@ static const AVClass spp_class = {
|
||||
.option = spp_options,
|
||||
.version = LIBAVUTIL_VERSION_INT,
|
||||
.category = AV_CLASS_CATEGORY_FILTER,
|
||||
#if FF_API_CHILD_CLASS_NEXT
|
||||
.child_class_next = child_class_next,
|
||||
#endif
|
||||
.child_class_iterate = child_class_iterate,
|
||||
.child_next = child_next,
|
||||
};
|
||||
|
@ -67,9 +67,6 @@ const AVClass ffurl_context_class = {
|
||||
.option = options,
|
||||
.version = LIBAVUTIL_VERSION_INT,
|
||||
.child_next = urlcontext_child_next,
|
||||
#if FF_API_CHILD_CLASS_NEXT
|
||||
.child_class_next = ff_urlcontext_child_class_next,
|
||||
#endif
|
||||
.child_class_iterate = ff_urlcontext_child_class_iterate,
|
||||
};
|
||||
/*@}*/
|
||||
|
@ -48,13 +48,6 @@ static void *ff_avio_child_next(void *obj, void *prev)
|
||||
return prev ? NULL : s->opaque;
|
||||
}
|
||||
|
||||
#if FF_API_CHILD_CLASS_NEXT
|
||||
static const AVClass *ff_avio_child_class_next(const AVClass *prev)
|
||||
{
|
||||
return prev ? NULL : &ffurl_context_class;
|
||||
}
|
||||
#endif
|
||||
|
||||
static const AVClass *child_class_iterate(void **iter)
|
||||
{
|
||||
const AVClass *c = *iter ? NULL : &ffurl_context_class;
|
||||
@ -76,9 +69,6 @@ const AVClass ff_avio_class = {
|
||||
.version = LIBAVUTIL_VERSION_INT,
|
||||
.option = ff_avio_options,
|
||||
.child_next = ff_avio_child_next,
|
||||
#if FF_API_CHILD_CLASS_NEXT
|
||||
.child_class_next = ff_avio_child_class_next,
|
||||
#endif
|
||||
.child_class_iterate = child_class_iterate,
|
||||
};
|
||||
|
||||
|
@ -54,41 +54,6 @@ static void *format_child_next(void *obj, void *prev)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if FF_API_CHILD_CLASS_NEXT
|
||||
static const AVClass *format_child_class_next(const AVClass *prev)
|
||||
{
|
||||
const AVInputFormat *ifmt = NULL;
|
||||
const AVOutputFormat *ofmt = NULL;
|
||||
void *ifmt_iter = NULL, *ofmt_iter = NULL;
|
||||
|
||||
if (!prev)
|
||||
return &ff_avio_class;
|
||||
|
||||
while ((ifmt = av_demuxer_iterate(&ifmt_iter)))
|
||||
if (ifmt->priv_class == prev)
|
||||
break;
|
||||
|
||||
if (!ifmt) {
|
||||
ifmt_iter = NULL;
|
||||
while ((ofmt = av_muxer_iterate(&ofmt_iter)))
|
||||
if (ofmt->priv_class == prev)
|
||||
break;
|
||||
}
|
||||
if (!ofmt) {
|
||||
ofmt_iter = NULL;
|
||||
while ((ifmt = av_demuxer_iterate(&ifmt_iter)))
|
||||
if (ifmt->priv_class)
|
||||
return ifmt->priv_class;
|
||||
}
|
||||
|
||||
while ((ofmt = av_muxer_iterate(&ofmt_iter)))
|
||||
if (ofmt->priv_class)
|
||||
return ofmt->priv_class;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
enum {
|
||||
CHILD_CLASS_ITER_AVIO = 0,
|
||||
CHILD_CLASS_ITER_MUX,
|
||||
@ -158,9 +123,6 @@ static const AVClass av_format_context_class = {
|
||||
.option = avformat_options,
|
||||
.version = LIBAVUTIL_VERSION_INT,
|
||||
.child_next = format_child_next,
|
||||
#if FF_API_CHILD_CLASS_NEXT
|
||||
.child_class_next = format_child_class_next,
|
||||
#endif
|
||||
.child_class_iterate = format_child_class_iterate,
|
||||
.category = AV_CLASS_CATEGORY_MUXER,
|
||||
.get_category = get_category,
|
||||
|
@ -75,27 +75,6 @@ extern const URLProtocol ff_libzmq_protocol;
|
||||
|
||||
#include "libavformat/protocol_list.c"
|
||||
|
||||
#if FF_API_CHILD_CLASS_NEXT
|
||||
const AVClass *ff_urlcontext_child_class_next(const AVClass *prev)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* find the protocol that corresponds to prev */
|
||||
for (i = 0; prev && url_protocols[i]; i++) {
|
||||
if (url_protocols[i]->priv_data_class == prev) {
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* find next protocol with priv options */
|
||||
for (; url_protocols[i]; i++)
|
||||
if (url_protocols[i]->priv_data_class)
|
||||
return url_protocols[i]->priv_data_class;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
const AVClass *ff_urlcontext_child_class_iterate(void **iter)
|
||||
{
|
||||
const AVClass *ret = NULL;
|
||||
|
@ -329,10 +329,6 @@ int ff_make_absolute_url(char *buf, int size, const char *base,
|
||||
*/
|
||||
AVIODirEntry *ff_alloc_dir_entry(void);
|
||||
|
||||
#if FF_API_CHILD_CLASS_NEXT
|
||||
const AVClass *ff_urlcontext_child_class_next(const AVClass *prev);
|
||||
#endif
|
||||
|
||||
const AVClass *ff_urlcontext_child_class_iterate(void **iter);
|
||||
|
||||
/**
|
||||
|
@ -112,19 +112,6 @@ typedef struct AVClass {
|
||||
*/
|
||||
void* (*child_next)(void *obj, void *prev);
|
||||
|
||||
#if FF_API_CHILD_CLASS_NEXT
|
||||
/**
|
||||
* Return an AVClass corresponding to the next potential
|
||||
* AVOptions-enabled child.
|
||||
*
|
||||
* The difference between child_next and this is that
|
||||
* child_next iterates over _already existing_ objects, while
|
||||
* child_class_next iterates over _all possible_ children.
|
||||
*/
|
||||
attribute_deprecated
|
||||
const struct AVClass* (*child_class_next)(const struct AVClass *prev);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Category used for visualization (like color)
|
||||
* This is only set if the category is equal for all objects using this class.
|
||||
|
@ -1717,29 +1717,10 @@ void *av_opt_child_next(void *obj, void *prev)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if FF_API_CHILD_CLASS_NEXT
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
const AVClass *av_opt_child_class_next(const AVClass *parent, const AVClass *prev)
|
||||
{
|
||||
if (parent->child_class_next)
|
||||
return parent->child_class_next(prev);
|
||||
return NULL;
|
||||
}
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
|
||||
const AVClass *av_opt_child_class_iterate(const AVClass *parent, void **iter)
|
||||
{
|
||||
if (parent->child_class_iterate)
|
||||
return parent->child_class_iterate(iter);
|
||||
#if FF_API_CHILD_CLASS_NEXT
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
if (parent->child_class_next) {
|
||||
*iter = parent->child_class_next(*iter);
|
||||
return *iter;
|
||||
}
|
||||
FF_ENABLE_DEPRECATION_WARNINGS
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -648,19 +648,6 @@ const AVOption *av_opt_next(const void *obj, const AVOption *prev);
|
||||
*/
|
||||
void *av_opt_child_next(void *obj, void *prev);
|
||||
|
||||
#if FF_API_CHILD_CLASS_NEXT
|
||||
/**
|
||||
* Iterate over potential AVOptions-enabled children of parent.
|
||||
*
|
||||
* @param prev result of a previous call to this function or NULL
|
||||
* @return AVClass corresponding to next potential child or NULL
|
||||
*
|
||||
* @deprecated use av_opt_child_class_iterate
|
||||
*/
|
||||
attribute_deprecated
|
||||
const AVClass *av_opt_child_class_next(const AVClass *parent, const AVClass *prev);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Iterate over potential AVOptions-enabled children of parent.
|
||||
*
|
||||
|
@ -105,9 +105,6 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef FF_API_CHILD_CLASS_NEXT
|
||||
#define FF_API_CHILD_CLASS_NEXT (LIBAVUTIL_VERSION_MAJOR < 57)
|
||||
#endif
|
||||
#ifndef FF_API_D2STR
|
||||
#define FF_API_D2STR (LIBAVUTIL_VERSION_MAJOR < 58)
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user