Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Obs Studio
提交
17a9fcaa
O
Obs Studio
项目概览
小白菜888
/
Obs Studio
通知
4
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Obs Studio
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
17a9fcaa
编写于
6月 28, 2014
作者:
B
BtbN
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use propper ffmpeg compatiblity instead of relying on deprecated functions
上级
ed9d5b1d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
28 addition
and
3 deletion
+28
-3
libobs/CMakeLists.txt
libobs/CMakeLists.txt
+2
-1
libobs/graphics/graphics-ffmpeg.c
libobs/graphics/graphics-ffmpeg.c
+4
-2
libobs/obs-ffmpeg-compat.h
libobs/obs-ffmpeg-compat.h
+22
-0
未找到文件。
libobs/CMakeLists.txt
浏览文件 @
17a9fcaa
...
...
@@ -223,7 +223,8 @@ set(libobs_libobs_HEADERS
obs-module.h
obs-scene.h
obs-source.h
obs-output.h
)
obs-output.h
obs-ffmpeg-compat.h
)
set
(
libobs_SOURCES
${
libobs_callback_SOURCES
}
...
...
libobs/graphics/graphics-ffmpeg.c
浏览文件 @
17a9fcaa
...
...
@@ -4,6 +4,8 @@
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
#include "../obs-ffmpeg-compat.h"
struct
ffmpeg_image
{
const
char
*
file
;
AVFormatContext
*
fmt_ctx
;
...
...
@@ -121,7 +123,7 @@ static bool ffmpeg_image_decode(struct ffmpeg_image *info, uint8_t *out,
{
AVPacket
packet
=
{
0
};
bool
success
=
false
;
AVFrame
*
frame
=
av
codec_alloc_frame
();
AVFrame
*
frame
=
av
_frame_alloc
();
int
got_frame
=
0
;
int
ret
;
...
...
@@ -152,7 +154,7 @@ static bool ffmpeg_image_decode(struct ffmpeg_image *info, uint8_t *out,
fail:
av_free_packet
(
&
packet
);
av
codec_free_fram
e
(
&
frame
);
av
_frame_fre
e
(
&
frame
);
return
success
;
}
...
...
libobs/obs-ffmpeg-compat.h
0 → 100644
浏览文件 @
17a9fcaa
#pragma once
#include <libavcodec/avcodec.h>
/* LIBAVCODEC_VERSION_CHECK checks for the right version of libav and FFmpeg
* a is the major version
* b and c the minor and micro versions of libav
* d and e the minor and micro versions of FFmpeg */
#define LIBAVCODEC_VERSION_CHECK( a, b, c, d, e ) \
( (LIBAVCODEC_VERSION_MICRO < 100 && LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( a, b, c ) ) || \
(LIBAVCODEC_VERSION_MICRO >= 100 && LIBAVCODEC_VERSION_INT >= AV_VERSION_INT( a, d, e ) ) )
#if !LIBAVCODEC_VERSION_CHECK(54, 28, 0, 59, 100)
# define avcodec_free_frame av_freep
#endif
#if LIBAVCODEC_VERSION_INT < 0x371c01
# define av_frame_alloc avcodec_alloc_frame
# define av_frame_unref avcodec_get_frame_defaults
# define av_frame_free avcodec_free_frame
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录