Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
950c26c8
提交
950c26c8
authored
3月 09, 2016
作者:
Seven Du
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
borrow code from ffmpeg to fix log_packet function for debuging
上级
e07c472f
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
58 行增加
和
6 行删除
+58
-6
avformat.c
src/mod/applications/mod_av/avformat.c
+58
-6
没有找到文件。
src/mod/applications/mod_av/avformat.c
浏览文件 @
950c26c8
...
@@ -43,6 +43,58 @@
...
@@ -43,6 +43,58 @@
#define SCALE_FLAGS SWS_BICUBIC
#define SCALE_FLAGS SWS_BICUBIC
#define DFT_RECORD_OFFSET 0
#define DFT_RECORD_OFFSET 0
#ifndef AVUTIL_TIMESTAMP_H
#define AVUTIL_TIMESTAMP_H
#define AV_TS_MAX_STRING_SIZE 32
/**
* Fill the provided buffer with a string containing a timestamp
* representation.
*
* @param buf a buffer with size in bytes of at least AV_TS_MAX_STRING_SIZE
* @param ts the timestamp to represent
* @return the buffer in input
*/
static
inline
char
*
av_ts_make_string
(
char
*
buf
,
int64_t
ts
)
{
if
(
ts
==
AV_NOPTS_VALUE
)
snprintf
(
buf
,
AV_TS_MAX_STRING_SIZE
,
"NOPTS"
);
else
snprintf
(
buf
,
AV_TS_MAX_STRING_SIZE
,
"%"
PRId64
""
,
ts
);
return
buf
;
}
/**
* Convenience macro, the return value should be used only directly in
* function arguments but never stand-alone.
*/
#define av_ts2str(ts) av_ts_make_string((char[AV_TS_MAX_STRING_SIZE]){0}, ts)
/**
* Fill the provided buffer with a string containing a timestamp time
* representation.
*
* @param buf a buffer with size in bytes of at least AV_TS_MAX_STRING_SIZE
* @param ts the timestamp to represent
* @param tb the timebase of the timestamp
* @return the buffer in input
*/
static
inline
char
*
av_ts_make_time_string
(
char
*
buf
,
int64_t
ts
,
AVRational
*
tb
)
{
if
(
ts
==
AV_NOPTS_VALUE
)
snprintf
(
buf
,
AV_TS_MAX_STRING_SIZE
,
"NOPTS"
);
else
snprintf
(
buf
,
AV_TS_MAX_STRING_SIZE
,
"%.6g"
,
av_q2d
(
*
tb
)
*
ts
);
return
buf
;
}
/**
* Convenience macro, the return value should be used only directly in
* function arguments but never stand-alone.
*/
#define av_ts2timestr(ts, tb) av_ts_make_time_string((char[AV_TS_MAX_STRING_SIZE]){0}, ts, tb)
#endif
/* AVUTIL_TIMESTAMP_H */
static
switch_status_t
av_file_close
(
switch_file_handle_t
*
handle
);
static
switch_status_t
av_file_close
(
switch_file_handle_t
*
handle
);
SWITCH_MODULE_LOAD_FUNCTION
(
mod_avformat_load
);
SWITCH_MODULE_LOAD_FUNCTION
(
mod_avformat_load
);
...
@@ -148,13 +200,13 @@ typedef struct record_helper_s {
...
@@ -148,13 +200,13 @@ typedef struct record_helper_s {
static
void
log_packet
(
const
AVFormatContext
*
fmt_ctx
,
const
AVPacket
*
pkt
)
static
void
log_packet
(
const
AVFormatContext
*
fmt_ctx
,
const
AVPacket
*
pkt
)
{
{
//
AVRational *time_base = &fmt_ctx->streams[pkt->stream_index]->time_base;
AVRational
*
time_base
=
&
fmt_ctx
->
streams
[
pkt
->
stream_index
]
->
time_base
;
//
printf("pts:%s pts_time:%s dts:%s dts_time:%s duration:%s duration_time:%s stream_index:%d\n",
printf
(
"pts:%s pts_time:%s dts:%s dts_time:%s duration:%s duration_time:%s stream_index:%d
\n
"
,
//
av_ts2str(pkt->pts), av_ts2timestr(pkt->pts, time_base),
av_ts2str
(
pkt
->
pts
),
av_ts2timestr
(
pkt
->
pts
,
time_base
),
//
av_ts2str(pkt->dts), av_ts2timestr(pkt->dts, time_base),
av_ts2str
(
pkt
->
dts
),
av_ts2timestr
(
pkt
->
dts
,
time_base
),
//
av_ts2str(pkt->duration), av_ts2timestr(pkt->duration, time_base),
av_ts2str
(
pkt
->
duration
),
av_ts2timestr
(
pkt
->
duration
,
time_base
),
//
pkt->stream_index);
pkt
->
stream_index
);
}
}
static
int
mod_avformat_alloc_output_context2
(
AVFormatContext
**
avctx
,
AVOutputFormat
*
oformat
,
static
int
mod_avformat_alloc_output_context2
(
AVFormatContext
**
avctx
,
AVOutputFormat
*
oformat
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论