Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
4d693b02
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,发现更多精彩内容 >>
提交
4d693b02
编写于
4月 05, 2012
作者:
J
Justin Ruggles
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
avutil: add av_get_packed_sample_fmt() and av_get_planar_sample_fmt()
Based on a patch by Clément Bœsch <ubitux@gmail.com>
上级
9294f538
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
55 addition
and
11 deletion
+55
-11
doc/APIchanges
doc/APIchanges
+3
-0
libavutil/avutil.h
libavutil/avutil.h
+1
-1
libavutil/samplefmt.c
libavutil/samplefmt.c
+29
-10
libavutil/samplefmt.h
libavutil/samplefmt.h
+22
-0
未找到文件。
doc/APIchanges
浏览文件 @
4d693b02
...
...
@@ -12,6 +12,9 @@ libavutil: 2011-04-18
API changes, most recent first:
2012-xx-xx - xxxxxxx - lavu 51.27.0 - samplefmt.h
Add av_get_packed_sample_fmt() and av_get_planar_sample_fmt()
2012-xx-xx - xxxxxxx - lavu 51.26.0 - audioconvert.h
Add av_get_default_channel_layout()
...
...
libavutil/avutil.h
浏览文件 @
4d693b02
...
...
@@ -152,7 +152,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 51
#define LIBAVUTIL_VERSION_MINOR 2
6
#define LIBAVUTIL_VERSION_MINOR 2
7
#define LIBAVUTIL_VERSION_MICRO 0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
...
...
libavutil/samplefmt.c
浏览文件 @
4d693b02
...
...
@@ -26,20 +26,21 @@ typedef struct SampleFmtInfo {
const
char
*
name
;
int
bits
;
int
planar
;
enum
AVSampleFormat
altform
;
///< planar<->packed alternative form
}
SampleFmtInfo
;
/** this table gives more information about formats */
static
const
SampleFmtInfo
sample_fmt_info
[
AV_SAMPLE_FMT_NB
]
=
{
[
AV_SAMPLE_FMT_U8
]
=
{
.
name
=
"u8"
,
.
bits
=
8
,
.
planar
=
0
},
[
AV_SAMPLE_FMT_S16
]
=
{
.
name
=
"s16"
,
.
bits
=
16
,
.
planar
=
0
},
[
AV_SAMPLE_FMT_S32
]
=
{
.
name
=
"s32"
,
.
bits
=
32
,
.
planar
=
0
},
[
AV_SAMPLE_FMT_FLT
]
=
{
.
name
=
"flt"
,
.
bits
=
32
,
.
planar
=
0
},
[
AV_SAMPLE_FMT_DBL
]
=
{
.
name
=
"dbl"
,
.
bits
=
64
,
.
planar
=
0
},
[
AV_SAMPLE_FMT_U8P
]
=
{
.
name
=
"u8p"
,
.
bits
=
8
,
.
planar
=
1
},
[
AV_SAMPLE_FMT_S16P
]
=
{
.
name
=
"s16p"
,
.
bits
=
16
,
.
planar
=
1
},
[
AV_SAMPLE_FMT_S32P
]
=
{
.
name
=
"s32p"
,
.
bits
=
32
,
.
planar
=
1
},
[
AV_SAMPLE_FMT_FLTP
]
=
{
.
name
=
"fltp"
,
.
bits
=
32
,
.
planar
=
1
},
[
AV_SAMPLE_FMT_DBLP
]
=
{
.
name
=
"dblp"
,
.
bits
=
64
,
.
planar
=
1
},
[
AV_SAMPLE_FMT_U8
]
=
{
.
name
=
"u8"
,
.
bits
=
8
,
.
planar
=
0
,
.
altform
=
AV_SAMPLE_FMT_U8P
},
[
AV_SAMPLE_FMT_S16
]
=
{
.
name
=
"s16"
,
.
bits
=
16
,
.
planar
=
0
,
.
altform
=
AV_SAMPLE_FMT_S16P
},
[
AV_SAMPLE_FMT_S32
]
=
{
.
name
=
"s32"
,
.
bits
=
32
,
.
planar
=
0
,
.
altform
=
AV_SAMPLE_FMT_S32P
},
[
AV_SAMPLE_FMT_FLT
]
=
{
.
name
=
"flt"
,
.
bits
=
32
,
.
planar
=
0
,
.
altform
=
AV_SAMPLE_FMT_FLTP
},
[
AV_SAMPLE_FMT_DBL
]
=
{
.
name
=
"dbl"
,
.
bits
=
64
,
.
planar
=
0
,
.
altform
=
AV_SAMPLE_FMT_DBLP
},
[
AV_SAMPLE_FMT_U8P
]
=
{
.
name
=
"u8p"
,
.
bits
=
8
,
.
planar
=
1
,
.
altform
=
AV_SAMPLE_FMT_U8
},
[
AV_SAMPLE_FMT_S16P
]
=
{
.
name
=
"s16p"
,
.
bits
=
16
,
.
planar
=
1
,
.
altform
=
AV_SAMPLE_FMT_S16
},
[
AV_SAMPLE_FMT_S32P
]
=
{
.
name
=
"s32p"
,
.
bits
=
32
,
.
planar
=
1
,
.
altform
=
AV_SAMPLE_FMT_S32
},
[
AV_SAMPLE_FMT_FLTP
]
=
{
.
name
=
"fltp"
,
.
bits
=
32
,
.
planar
=
1
,
.
altform
=
AV_SAMPLE_FMT_FLT
},
[
AV_SAMPLE_FMT_DBLP
]
=
{
.
name
=
"dblp"
,
.
bits
=
64
,
.
planar
=
1
,
.
altform
=
AV_SAMPLE_FMT_DBL
},
};
const
char
*
av_get_sample_fmt_name
(
enum
AVSampleFormat
sample_fmt
)
...
...
@@ -59,6 +60,24 @@ enum AVSampleFormat av_get_sample_fmt(const char *name)
return
AV_SAMPLE_FMT_NONE
;
}
enum
AVSampleFormat
av_get_packed_sample_fmt
(
enum
AVSampleFormat
sample_fmt
)
{
if
(
sample_fmt
<
0
||
sample_fmt
>=
AV_SAMPLE_FMT_NB
)
return
AV_SAMPLE_FMT_NONE
;
if
(
sample_fmt_info
[
sample_fmt
].
planar
)
return
sample_fmt_info
[
sample_fmt
].
altform
;
return
sample_fmt
;
}
enum
AVSampleFormat
av_get_planar_sample_fmt
(
enum
AVSampleFormat
sample_fmt
)
{
if
(
sample_fmt
<
0
||
sample_fmt
>=
AV_SAMPLE_FMT_NB
)
return
AV_SAMPLE_FMT_NONE
;
if
(
sample_fmt_info
[
sample_fmt
].
planar
)
return
sample_fmt
;
return
sample_fmt_info
[
sample_fmt
].
altform
;
}
char
*
av_get_sample_fmt_string
(
char
*
buf
,
int
buf_size
,
enum
AVSampleFormat
sample_fmt
)
{
/* print header */
...
...
libavutil/samplefmt.h
浏览文件 @
4d693b02
...
...
@@ -53,6 +53,28 @@ const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt);
*/
enum
AVSampleFormat
av_get_sample_fmt
(
const
char
*
name
);
/**
* Get the packed alternative form of the given sample format.
*
* If the passed sample_fmt is already in packed format, the format returned is
* the same as the input.
*
* @return the packed alternative form of the given sample format or
AV_SAMPLE_FMT_NONE on error.
*/
enum
AVSampleFormat
av_get_packed_sample_fmt
(
enum
AVSampleFormat
sample_fmt
);
/**
* Get the planar alternative form of the given sample format.
*
* If the passed sample_fmt is already in planar format, the format returned is
* the same as the input.
*
* @return the planar alternative form of the given sample format or
AV_SAMPLE_FMT_NONE on error.
*/
enum
AVSampleFormat
av_get_planar_sample_fmt
(
enum
AVSampleFormat
sample_fmt
);
/**
* Generate a string corresponding to the sample format with
* sample_fmt, or a header if sample_fmt is negative.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录