mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-10-10 11:12:21 +08:00
lavf: add an AVClass to AVStream on next major bump
Also add a function to retrieve that class, analogously to avformat_get_class(). This will be useful for adding an AVOption for dispositions.
This commit is contained in:
@@ -721,6 +721,17 @@ void avformat_free_context(AVFormatContext *s)
|
||||
av_free(s);
|
||||
}
|
||||
|
||||
static const AVClass stream_class = {
|
||||
.class_name = "AVStream",
|
||||
.item_name = av_default_item_name,
|
||||
.version = LIBAVUTIL_VERSION_INT,
|
||||
};
|
||||
|
||||
const AVClass *av_stream_get_class(void)
|
||||
{
|
||||
return &stream_class;
|
||||
}
|
||||
|
||||
AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c)
|
||||
{
|
||||
FFFormatContext *const si = ffformatcontext(s);
|
||||
@@ -745,6 +756,10 @@ AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c)
|
||||
return NULL;
|
||||
st = &sti->pub;
|
||||
|
||||
#if FF_API_AVSTREAM_CLASS
|
||||
st->av_class = &stream_class;
|
||||
#endif
|
||||
|
||||
st->codecpar = avcodec_parameters_alloc();
|
||||
if (!st->codecpar)
|
||||
goto fail;
|
||||
|
Reference in New Issue
Block a user