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);
}
如有錯誤請指正: