ffmpeg中如何取出AVFormatContext::void *priv_data到一个结构体中;
其中SRTContext在对应ffmpeg_4.2.3_win32源码中ffmpeg-4.2.3\libavformat\libsrt.c的结构体,不同版本应对应;
static void test(AVFormatContext *s)
{
SRTContext* srtctx = NULL;
srtctx = (SRTContext*) ffio_geturlcontext(s->pb);
}
SRTContext* ffio_geturlcontext(AVIOContext *s)
{
AVIODirContext *internal;
if (!s)
{
return NULL;
}
internal = (AVIODirContext*)s->opaque;
return (SRTContext*)(((URLContext *)(internal->url_context))->priv_data);
}
如有错误请指正: