Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
2d423666
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,发现更多精彩内容 >>
提交
2d423666
编写于
9月 16, 2009
作者:
P
Peter Ross
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make mov LPCM and AAC parsing functions public
Originally committed as revision 19878 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
fa77dd63
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
24 addition
and
15 deletion
+24
-15
libavformat/isom.h
libavformat/isom.h
+4
-0
libavformat/mov.c
libavformat/mov.c
+20
-15
未找到文件。
libavformat/isom.h
浏览文件 @
2d423666
...
...
@@ -137,4 +137,8 @@ typedef struct MOVContext {
int
itunes_metadata
;
///< metadata are itunes style
}
MOVContext
;
int
ff_mp4_read_descr_len
(
ByteIOContext
*
pb
);
int
ff_mov_read_esds
(
AVFormatContext
*
fc
,
ByteIOContext
*
pb
,
MOVAtom
atom
);
enum
CodecID
ff_mov_get_lpcm_codec_id
(
int
bps
,
int
flags
);
#endif
/* AVFORMAT_ISOM_H */
libavformat/mov.c
浏览文件 @
2d423666
...
...
@@ -358,7 +358,7 @@ static int mov_read_hdlr(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
return
0
;
}
static
int
mp4_read_descr_len
(
ByteIOContext
*
pb
)
int
ff_
mp4_read_descr_len
(
ByteIOContext
*
pb
)
{
int
len
=
0
;
int
count
=
4
;
...
...
@@ -371,12 +371,12 @@ static int mp4_read_descr_len(ByteIOContext *pb)
return
len
;
}
static
int
mp4_read_descr
(
MOVContext
*
c
,
ByteIOContext
*
pb
,
int
*
tag
)
int
mp4_read_descr
(
AVFormatContext
*
f
c
,
ByteIOContext
*
pb
,
int
*
tag
)
{
int
len
;
*
tag
=
get_byte
(
pb
);
len
=
mp4_read_descr_len
(
pb
);
dprintf
(
c
->
fc
,
"MPEG4 description: tag=0x%02x len=%d
\n
"
,
*
tag
,
len
);
len
=
ff_
mp4_read_descr_len
(
pb
);
dprintf
(
fc
,
"MPEG4 description: tag=0x%02x len=%d
\n
"
,
*
tag
,
len
);
return
len
;
}
...
...
@@ -393,24 +393,24 @@ static const AVCodecTag mp4_audio_types[] = {
{
CODEC_ID_NONE
,
AOT_NULL
},
};
static
int
mov_read_esds
(
MOVContext
*
c
,
ByteIOContext
*
pb
,
MOVAtom
atom
)
int
ff_mov_read_esds
(
AVFormatContext
*
f
c
,
ByteIOContext
*
pb
,
MOVAtom
atom
)
{
AVStream
*
st
;
int
tag
,
len
;
if
(
c
->
fc
->
nb_streams
<
1
)
if
(
fc
->
nb_streams
<
1
)
return
0
;
st
=
c
->
fc
->
streams
[
c
->
fc
->
nb_streams
-
1
];
st
=
fc
->
streams
[
fc
->
nb_streams
-
1
];
get_be32
(
pb
);
/* version + flags */
len
=
mp4_read_descr
(
c
,
pb
,
&
tag
);
len
=
mp4_read_descr
(
f
c
,
pb
,
&
tag
);
if
(
tag
==
MP4ESDescrTag
)
{
get_be16
(
pb
);
/* ID */
get_byte
(
pb
);
/* priority */
}
else
get_be16
(
pb
);
/* ID */
len
=
mp4_read_descr
(
c
,
pb
,
&
tag
);
len
=
mp4_read_descr
(
f
c
,
pb
,
&
tag
);
if
(
tag
==
MP4DecConfigDescrTag
)
{
int
object_type_id
=
get_byte
(
pb
);
get_byte
(
pb
);
/* stream type */
...
...
@@ -419,10 +419,10 @@ static int mov_read_esds(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
get_be32
(
pb
);
/* avg bitrate */
st
->
codec
->
codec_id
=
ff_codec_get_id
(
ff_mp4_obj_type
,
object_type_id
);
dprintf
(
c
->
fc
,
"esds object type id %d
\n
"
,
object_type_id
);
len
=
mp4_read_descr
(
c
,
pb
,
&
tag
);
dprintf
(
fc
,
"esds object type id %d
\n
"
,
object_type_id
);
len
=
mp4_read_descr
(
f
c
,
pb
,
&
tag
);
if
(
tag
==
MP4DecSpecificDescrTag
)
{
dprintf
(
c
->
fc
,
"Specific MPEG4 header len=%d
\n
"
,
len
);
dprintf
(
fc
,
"Specific MPEG4 header len=%d
\n
"
,
len
);
if
((
uint64_t
)
len
>
(
1
<<
30
))
return
-
1
;
st
->
codec
->
extradata
=
av_mallocz
(
len
+
FF_INPUT_BUFFER_PADDING_SIZE
);
...
...
@@ -441,7 +441,7 @@ static int mov_read_esds(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
st
->
codec
->
sample_rate
=
ff_mpa_freq_tab
[
cfg
.
sampling_index
];
else
st
->
codec
->
sample_rate
=
cfg
.
sample_rate
;
// ext sample rate ?
dprintf
(
c
->
fc
,
"mp4a config channels %d obj %d ext obj %d "
dprintf
(
fc
,
"mp4a config channels %d obj %d ext obj %d "
"sample rate %d ext sample rate %d
\n
"
,
st
->
codec
->
channels
,
cfg
.
object_type
,
cfg
.
ext_object_type
,
cfg
.
sample_rate
,
cfg
.
ext_sample_rate
);
...
...
@@ -454,6 +454,11 @@ static int mov_read_esds(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
return
0
;
}
static
int
mov_read_esds
(
MOVContext
*
c
,
ByteIOContext
*
pb
,
MOVAtom
atom
)
{
return
ff_mov_read_esds
(
c
->
fc
,
pb
,
atom
);
}
static
int
mov_read_pasp
(
MOVContext
*
c
,
ByteIOContext
*
pb
,
MOVAtom
atom
)
{
const
int
num
=
get_be32
(
pb
);
...
...
@@ -760,7 +765,7 @@ static int mov_read_stco(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
* Compute codec id for 'lpcm' tag.
* See CoreAudioTypes and AudioStreamBasicDescription at Apple.
*/
static
enum
CodecID
mov_get_lpcm_codec_id
(
int
bps
,
int
flags
)
enum
CodecID
ff_
mov_get_lpcm_codec_id
(
int
bps
,
int
flags
)
{
if
(
flags
&
1
)
{
// floating point
if
(
flags
&
2
)
{
// big endian
...
...
@@ -998,7 +1003,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
sc
->
bytes_per_frame
=
get_be32
(
pb
);
/* bytes per audio packet if constant */
sc
->
samples_per_frame
=
get_be32
(
pb
);
/* lpcm frames per audio packet if constant */
if
(
format
==
MKTAG
(
'l'
,
'p'
,
'c'
,
'm'
))
st
->
codec
->
codec_id
=
mov_get_lpcm_codec_id
(
st
->
codec
->
bits_per_coded_sample
,
flags
);
st
->
codec
->
codec_id
=
ff_
mov_get_lpcm_codec_id
(
st
->
codec
->
bits_per_coded_sample
,
flags
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录