Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
e69263cd
F
Ffmpeg
项目概览
小白菜888
/
Ffmpeg
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Ffmpeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e69263cd
编写于
6月 03, 2012
作者:
M
Michael Niedermayer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
avutil: add get_category() for the case where one AVClass can have more than 1 category
Signed-off-by:
N
Michael Niedermayer
<
michaelni@gmx.at
>
上级
b76f77ee
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
5 deletion
+22
-5
libavutil/avutil.h
libavutil/avutil.h
+1
-1
libavutil/log.c
libavutil/log.c
+13
-4
libavutil/log.h
libavutil/log.h
+8
-0
未找到文件。
libavutil/avutil.h
浏览文件 @
e69263cd
...
...
@@ -153,7 +153,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 51
#define LIBAVUTIL_VERSION_MINOR 5
8
#define LIBAVUTIL_VERSION_MINOR 5
9
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
...
...
libavutil/log.c
浏览文件 @
e69263cd
...
...
@@ -121,6 +121,11 @@ const char *av_default_item_name(void *ptr)
return
(
*
(
AVClass
**
)
ptr
)
->
class_name
;
}
AVClassCategory
av_default_get_category
(
void
*
ptr
)
{
return
(
*
(
AVClass
**
)
ptr
)
->
category
;
}
static
void
sanitize
(
uint8_t
*
line
){
while
(
*
line
){
if
(
*
line
<
0x08
||
(
*
line
>
0x0D
&&
*
line
<
0x20
))
...
...
@@ -129,12 +134,16 @@ static void sanitize(uint8_t *line){
}
}
static
int
get_category
(
AVClass
*
avc
){
static
int
get_category
(
void
*
ptr
){
AVClass
*
avc
=
*
(
AVClass
**
)
ptr
;
if
(
!
avc
||
(
avc
->
version
&
0xFF
)
<
100
||
avc
->
version
<
(
51
<<
16
|
5
6
<<
8
)
||
avc
->
version
<
(
51
<<
16
|
5
9
<<
8
)
||
avc
->
category
>=
AV_CLASS_CATEGORY_NB
)
return
AV_CLASS_CATEGORY_NA
+
16
;
if
(
avc
->
get_category
)
return
avc
->
get_category
(
ptr
)
+
16
;
return
avc
->
category
+
16
;
}
...
...
@@ -151,12 +160,12 @@ static void format_line(void *ptr, int level, const char *fmt, va_list vl,
if
(
parent
&&
*
parent
)
{
snprintf
(
part
[
0
],
part_size
,
"[%s @ %p] "
,
(
*
parent
)
->
item_name
(
parent
),
parent
);
if
(
type
)
type
[
0
]
=
get_category
(
*
paren
t
);
if
(
type
)
type
[
0
]
=
get_category
(
((
uint8_t
*
)
ptr
)
+
avc
->
parent_log_context_offse
t
);
}
}
snprintf
(
part
[
1
],
part_size
,
"[%s @ %p] "
,
avc
->
item_name
(
ptr
),
ptr
);
if
(
type
)
type
[
1
]
=
get_category
(
avc
);
if
(
type
)
type
[
1
]
=
get_category
(
ptr
);
}
vsnprintf
(
part
[
2
],
part_size
,
fmt
,
vl
);
...
...
libavutil/log.h
浏览文件 @
e69263cd
...
...
@@ -102,9 +102,16 @@ typedef struct AVClass {
/**
* Category used for visualization (like color)
* This is only set if the category is equal for all objects using this class.
* available since version (51 << 16 | 56 << 8 | 100)
*/
AVClassCategory
category
;
/**
* Callback to return the category.
* available since version (51 << 16 | 59 << 8 | 100)
*/
AVClassCategory
(
*
get_category
)(
void
*
ctx
);
}
AVClass
;
/* av_log API */
...
...
@@ -167,6 +174,7 @@ void av_log_set_level(int);
void
av_log_set_callback
(
void
(
*
)(
void
*
,
int
,
const
char
*
,
va_list
));
void
av_log_default_callback
(
void
*
ptr
,
int
level
,
const
char
*
fmt
,
va_list
vl
);
const
char
*
av_default_item_name
(
void
*
ctx
);
AVClassCategory
av_default_get_category
(
void
*
ptr
);
/**
* Format a line of log the same way as the default callback.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录