gpt4 book ai didi

function - ffmpeg avcodec_get_frame_defaults 被宣布弃用

转载 作者:行者123 更新时间:2023-12-02 22:44:39 25 4
gpt4 key购买 nike

关闭。这个问题需要details or clarity .它目前不接受答案。












想改进这个问题?通过 editing this post 添加详细信息并澄清问题.


3年前关闭。







Improve this question




制作 ffmpeg 简单的播放器

我引用ffmpeg示例代码
(https://github.com/phamquy/FFmpeg-tutorial-samples/blob/master/tutorial03.c)

在带有 Visual Studio 12 的窗口 7 中

首先我做了cmd-project,所有链接,编译都OK

但是当我在 vs12 中按 F5 时

**1>ConsoleApplication1.cpp (141): error C4996: 'avcodec_get_frame_defaults': was declared deprecated
Failed | ConsoleApplication1\ConsoleApplication1.vcxproj [Debug|x64]**

我怎么了?

我再次下载了最新的 ffmpeg DLL,但注意到发生了变化

最佳答案

avcodec_get_frame_defaults 的函数声明周围的注释说你应该使用 av_frame_unref并且代码似乎正在这样做:

void avcodec_get_frame_defaults(AVFrame *frame)
{
#if LIBAVCODEC_VERSION_MAJOR >= 55
// extended_data should explicitly be freed when needed, this code is unsafe currently
// also this is not compatible to the <55 ABI/API
if (frame->extended_data != frame->data && 0)
av_freep(&frame->extended_data);
#endif

memset(frame, 0, sizeof(AVFrame));
av_frame_unref(frame);
}

关于function - ffmpeg avcodec_get_frame_defaults 被宣布弃用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27686064/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com