Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
11e5d3b9
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,体验更适合开发者的 AI 搜索 >>
提交
11e5d3b9
编写于
1月 31, 2012
作者:
C
Clément Bœsch
提交者:
Clément Bœsch
2月 02, 2012
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
dv: use new public timecode API.
上级
77971609
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
8 addition
and
30 deletion
+8
-30
libavformat/dv.c
libavformat/dv.c
+8
-30
未找到文件。
libavformat/dv.c
浏览文件 @
11e5d3b9
...
...
@@ -34,6 +34,7 @@
#include "libavcodec/dvdata.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mathematics.h"
#include "libavutil/timecode.h"
#include "dv.h"
#include "libavutil/avassert.h"
...
...
@@ -275,42 +276,19 @@ static int dv_extract_video_info(DVDemuxContext *c, uint8_t* frame)
return
size
;
}
static
int
bcd2int
(
uint8_t
bcd
)
static
int
dv_extract_timecode
(
DVDemuxContext
*
c
,
uint8_t
*
frame
,
char
*
tc
)
{
int
low
=
bcd
&
0xf
;
int
high
=
bcd
>>
4
;
if
(
low
>
9
||
high
>
9
)
return
-
1
;
return
low
+
10
*
high
;
}
static
int
dv_extract_timecode
(
DVDemuxContext
*
c
,
uint8_t
*
frame
,
char
tc
[
32
])
{
int
hh
,
mm
,
ss
,
ff
,
drop_frame
;
const
uint8_t
*
tc_pack
;
tc_pack
=
dv_extract_pack
(
frame
,
dv_timecode
);
if
(
!
tc_pack
)
return
0
;
ff
=
bcd2int
(
tc_pack
[
1
]
&
0x3f
);
ss
=
bcd2int
(
tc_pack
[
2
]
&
0x7f
);
mm
=
bcd2int
(
tc_pack
[
3
]
&
0x7f
);
hh
=
bcd2int
(
tc_pack
[
4
]
&
0x3f
);
drop_frame
=
tc_pack
[
1
]
>>
6
&
0x1
;
if
(
ff
<
0
||
ss
<
0
||
mm
<
0
||
hh
<
0
)
return
-
1
;
// For PAL systems, drop frame bit is replaced by an arbitrary
// bit so its value should not be considered. Drop frame timecode
// is only relevant for NTSC systems.
if
(
c
->
sys
->
ltc_divisor
==
25
||
c
->
sys
->
ltc_divisor
==
50
)
{
drop_frame
=
0
;
}
int
prevent_df
=
c
->
sys
->
ltc_divisor
==
25
||
c
->
sys
->
ltc_divisor
==
50
;
snprintf
(
tc
,
32
,
"%02d:%02d:%02d%c%02d"
,
hh
,
mm
,
ss
,
drop_frame
?
';'
:
':'
,
ff
);
tc_pack
=
dv_extract_pack
(
frame
,
dv_timecode
);
if
(
!
tc_pack
)
return
0
;
av_timecode_make_smpte_tc_string
(
tc
,
AV_RB32
(
tc_pack
+
1
),
prevent_df
);
return
1
;
}
...
...
@@ -454,7 +432,7 @@ typedef struct RawDVContext {
static
int
dv_read_timecode
(
AVFormatContext
*
s
)
{
int
ret
;
char
timecode
[
32
];
char
timecode
[
AV_TIMECODE_STR_SIZE
];
int64_t
pos
=
avio_tell
(
s
->
pb
);
// Read 3 DIF blocks: Header block and 2 Subcode blocks.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录