Commit c0d6eaca authored by Anton Khirnov's avatar Anton Khirnov

bsf: switch to child_class_iterate()

parent e0fbb6cf
......@@ -96,6 +96,7 @@ 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;
......@@ -115,3 +116,16 @@ const AVClass *ff_bsf_child_class_next(const AVClass *prev)
}
return NULL;
}
#endif
const AVClass *ff_bsf_child_class_iterate(void **opaque)
{
const AVBitStreamFilter *f;
/* find next filter with priv options */
while ((f = av_bsf_iterate(opaque))) {
if (f->priv_class)
return f->priv_class;
}
return NULL;
}
......@@ -79,7 +79,10 @@ 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,6 +42,10 @@ 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 */
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