Merge branch 'remove-libav-deprecated'
This commit is contained in:
commit
933d2dde42
|
@ -55,8 +55,8 @@ endmacro()
|
||||||
|
|
||||||
macro(check_libav)
|
macro(check_libav)
|
||||||
if(PKG_CONFIG_FOUND)
|
if(PKG_CONFIG_FOUND)
|
||||||
pkg_check_modules(LIBAV libavcodec>=52.72.2 libavformat>=52.64.2
|
pkg_check_modules(LIBAV libavcodec>=53.5.0 libavformat>=53.2.0
|
||||||
libswscale>=0.11.0 libavutil>=50.15.1)
|
libswscale>=2.0.0 libavutil>=51.7.0)
|
||||||
else()
|
else()
|
||||||
message("pkg-config is required to check for libav")
|
message("pkg-config is required to check for libav")
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -267,8 +267,6 @@ bool AVIDump::CreateFile()
|
||||||
s_Stream->codec->gop_size = 12;
|
s_Stream->codec->gop_size = 12;
|
||||||
s_Stream->codec->pix_fmt = g_Config.bUseFFV1 ? PIX_FMT_BGRA : PIX_FMT_YUV420P;
|
s_Stream->codec->pix_fmt = g_Config.bUseFFV1 ? PIX_FMT_BGRA : PIX_FMT_YUV420P;
|
||||||
|
|
||||||
av_set_parameters(s_FormatContext, NULL);
|
|
||||||
|
|
||||||
if (!(codec = avcodec_find_encoder(s_Stream->codec->codec_id)) ||
|
if (!(codec = avcodec_find_encoder(s_Stream->codec->codec_id)) ||
|
||||||
(avcodec_open(s_Stream->codec, codec) < 0))
|
(avcodec_open(s_Stream->codec, codec) < 0))
|
||||||
{
|
{
|
||||||
|
@ -287,14 +285,14 @@ bool AVIDump::CreateFile()
|
||||||
s_OutBuffer = new uint8_t[s_size];
|
s_OutBuffer = new uint8_t[s_size];
|
||||||
|
|
||||||
NOTICE_LOG(VIDEO, "Opening file %s for dumping", s_FormatContext->filename);
|
NOTICE_LOG(VIDEO, "Opening file %s for dumping", s_FormatContext->filename);
|
||||||
if (url_fopen(&s_FormatContext->pb, s_FormatContext->filename, URL_WRONLY) < 0)
|
if (avio_open(&s_FormatContext->pb, s_FormatContext->filename, AVIO_FLAG_WRITE) < 0)
|
||||||
{
|
{
|
||||||
WARN_LOG(VIDEO, "Could not open %s", s_FormatContext->filename);
|
WARN_LOG(VIDEO, "Could not open %s", s_FormatContext->filename);
|
||||||
CloseFile();
|
CloseFile();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
av_write_header(s_FormatContext);
|
avformat_write_header(s_FormatContext, NULL);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -374,7 +372,7 @@ void AVIDump::CloseFile()
|
||||||
if (s_FormatContext)
|
if (s_FormatContext)
|
||||||
{
|
{
|
||||||
if (s_FormatContext->pb)
|
if (s_FormatContext->pb)
|
||||||
url_fclose(s_FormatContext->pb);
|
avio_close(s_FormatContext->pb);
|
||||||
av_free(s_FormatContext);
|
av_free(s_FormatContext);
|
||||||
s_FormatContext = NULL;
|
s_FormatContext = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue