Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
fcd1f6bc
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 搜索 >>
提交
fcd1f6bc
编写于
7月 03, 2014
作者:
A
Andrey Utkin
提交者:
Michael Niedermayer
7月 07, 2014
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
avutil/bprint: Add av_bprint_fd_contents()
Signed-off-by:
N
Michael Niedermayer
<
michaelni@gmx.at
>
上级
06dae71d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
26 addition
and
2 deletion
+26
-2
libavutil/bprint.c
libavutil/bprint.c
+17
-0
libavutil/bprint.h
libavutil/bprint.h
+7
-0
libavutil/version.h
libavutil/version.h
+2
-2
未找到文件。
libavutil/bprint.c
浏览文件 @
fcd1f6bc
...
...
@@ -22,6 +22,7 @@
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include "avassert.h"
#include "avstring.h"
#include "bprint.h"
...
...
@@ -304,6 +305,22 @@ void av_bprint_escape(AVBPrint *dstbuf, const char *src, const char *special_cha
}
}
int
av_bprint_fd_contents
(
AVBPrint
*
pb
,
int
fd
)
{
int
ret
;
char
buf
[
1024
];
while
(
1
)
{
ret
=
read
(
fd
,
buf
,
sizeof
(
buf
));
if
(
!
ret
)
return
0
;
else
if
(
ret
<
0
)
return
AVERROR
(
errno
);
av_bprint_append_data
(
pb
,
buf
,
ret
);
if
(
!
av_bprint_is_complete
(
pb
))
return
AVERROR
(
ENOMEM
);
}
}
#ifdef TEST
#undef printf
...
...
libavutil/bprint.h
浏览文件 @
fcd1f6bc
...
...
@@ -213,4 +213,11 @@ int av_bprint_finalize(AVBPrint *buf, char **ret_str);
void
av_bprint_escape
(
AVBPrint
*
dstbuf
,
const
char
*
src
,
const
char
*
special_chars
,
enum
AVEscapeMode
mode
,
int
flags
);
/**
* Read contents of fd into print buffer up to EOF.
*
* @return 0 for success, error code otherwise
*/
int
av_bprint_fd_contents
(
AVBPrint
*
pb
,
int
fd
);
#endif
/* AVUTIL_BPRINT_H */
libavutil/version.h
浏览文件 @
fcd1f6bc
...
...
@@ -56,8 +56,8 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 52
#define LIBAVUTIL_VERSION_MINOR 9
0
#define LIBAVUTIL_VERSION_MICRO 10
1
#define LIBAVUTIL_VERSION_MINOR 9
1
#define LIBAVUTIL_VERSION_MICRO 10
0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录