Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
TrueDei
FFmpeg
提交
5306bf41
F
FFmpeg
项目概览
TrueDei
/
FFmpeg
通知
1
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,发现更多精彩内容 >>
提交
5306bf41
编写于
2月 04, 2011
作者:
M
Martin Storsjö
提交者:
Ronald S. Bultje
2月 04, 2011
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
movenchint: Use rtpenc_chain for setting up the chained RTP muxer
Signed-off-by:
N
Ronald S. Bultje
<
rsbultje@gmail.com
>
上级
397ffde1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
5 addition
and
33 deletion
+5
-33
libavformat/Makefile
libavformat/Makefile
+2
-1
libavformat/movenchint.c
libavformat/movenchint.c
+3
-32
未找到文件。
libavformat/Makefile
浏览文件 @
5306bf41
...
...
@@ -128,7 +128,8 @@ OBJS-$(CONFIG_MM_DEMUXER) += mm.o
OBJS-$(CONFIG_MMF_DEMUXER)
+=
mmf.o pcm.o
OBJS-$(CONFIG_MMF_MUXER)
+=
mmf.o riff.o
OBJS-$(CONFIG_MOV_DEMUXER)
+=
mov.o riff.o isom.o
OBJS-$(CONFIG_MOV_MUXER)
+=
movenc.o riff.o isom.o avc.o movenchint.o
OBJS-$(CONFIG_MOV_MUXER)
+=
movenc.o riff.o isom.o avc.o
\
movenchint.o rtpenc_chain.o
OBJS-$(CONFIG_MP2_MUXER)
+=
mp3enc.o
OBJS-$(CONFIG_MP3_DEMUXER)
+=
mp3dec.o
OBJS-$(CONFIG_MP3_MUXER)
+=
mp3enc.o
...
...
libavformat/movenchint.c
浏览文件 @
5306bf41
...
...
@@ -22,6 +22,7 @@
#include "movenc.h"
#include "libavutil/intreadwrite.h"
#include "internal.h"
#include "rtpenc_chain.h"
int
ff_mov_init_hinting
(
AVFormatContext
*
s
,
int
index
,
int
src_index
)
{
...
...
@@ -30,41 +31,20 @@ int ff_mov_init_hinting(AVFormatContext *s, int index, int src_index)
MOVTrack
*
src_track
=
&
mov
->
tracks
[
src_index
];
AVStream
*
src_st
=
s
->
streams
[
src_index
];
int
ret
=
AVERROR
(
ENOMEM
);
AVOutputFormat
*
rtp_format
=
av_guess_format
(
"rtp"
,
NULL
,
NULL
);
track
->
tag
=
MKTAG
(
'r'
,
't'
,
'p'
,
' '
);
track
->
src_track
=
src_index
;
if
(
!
rtp_format
)
{
ret
=
AVERROR
(
ENOENT
);
goto
fail
;
}
track
->
enc
=
avcodec_alloc_context
();
if
(
!
track
->
enc
)
goto
fail
;
track
->
enc
->
codec_type
=
AVMEDIA_TYPE_DATA
;
track
->
enc
->
codec_tag
=
track
->
tag
;
track
->
rtp_ctx
=
avformat_alloc_context
();
track
->
rtp_ctx
=
ff_rtp_chain_mux_open
(
s
,
src_st
,
NULL
,
RTP_MAX_PACKET_SIZE
);
if
(
!
track
->
rtp_ctx
)
goto
fail
;
track
->
rtp_ctx
->
oformat
=
rtp_format
;
if
(
!
av_new_stream
(
track
->
rtp_ctx
,
0
))
goto
fail
;
/* Copy stream parameters */
track
->
rtp_ctx
->
streams
[
0
]
->
sample_aspect_ratio
=
src_st
->
sample_aspect_ratio
;
avcodec_copy_context
(
track
->
rtp_ctx
->
streams
[
0
]
->
codec
,
src_st
->
codec
);
if
((
ret
=
url_open_dyn_packet_buf
(
&
track
->
rtp_ctx
->
pb
,
RTP_MAX_PACKET_SIZE
))
<
0
)
goto
fail
;
ret
=
av_write_header
(
track
->
rtp_ctx
);
if
(
ret
)
goto
fail
;
/* Copy the RTP AVStream timebase back to the hint AVStream */
track
->
timescale
=
track
->
rtp_ctx
->
streams
[
0
]
->
time_base
.
den
;
...
...
@@ -76,15 +56,6 @@ int ff_mov_init_hinting(AVFormatContext *s, int index, int src_index)
fail:
av_log
(
s
,
AV_LOG_WARNING
,
"Unable to initialize hinting of stream %d
\n
"
,
src_index
);
if
(
track
->
rtp_ctx
&&
track
->
rtp_ctx
->
pb
)
{
uint8_t
*
buf
;
url_close_dyn_buf
(
track
->
rtp_ctx
->
pb
,
&
buf
);
av_free
(
buf
);
}
if
(
track
->
rtp_ctx
)
{
avformat_free_context
(
track
->
rtp_ctx
);
track
->
rtp_ctx
=
NULL
;
}
av_freep
(
&
track
->
enc
);
/* Set a default timescale, to avoid crashes in dump_format */
track
->
timescale
=
90000
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录