Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
96baaa6a
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,发现更多精彩内容 >>
提交
96baaa6a
编写于
9月 24, 2001
作者:
F
Fabrice Bellard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
changed av_open_input_file() prototype
Originally committed as revision 146 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
4b44538c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
44 addition
and
29 deletion
+44
-29
libav/avformat.h
libav/avformat.h
+11
-1
libav/utils.c
libav/utils.c
+33
-28
未找到文件。
libav/avformat.h
浏览文件 @
96baaa6a
...
...
@@ -180,7 +180,10 @@ int fifo_size(FifoBuffer *f, UINT8 *rptr);
int
fifo_read
(
FifoBuffer
*
f
,
UINT8
*
buf
,
int
buf_size
,
UINT8
**
rptr_ptr
);
void
fifo_write
(
FifoBuffer
*
f
,
UINT8
*
buf
,
int
size
,
UINT8
**
wptr_ptr
);
AVFormatContext
*
av_open_input_file
(
const
char
*
filename
,
int
buf_size
);
AVFormatContext
*
av_open_input_file
(
const
char
*
filename
,
const
char
*
format_name
,
int
buf_size
,
AVFormatParameters
*
ap
);
int
av_read_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
);
void
av_close_input_file
(
AVFormatContext
*
s
);
...
...
@@ -204,3 +207,10 @@ int find_info_tag(char *arg, int arg_size, const char *tag1, const char *info);
int
get_frame_filename
(
char
*
buf
,
int
buf_size
,
const
char
*
path
,
int
number
);
/* grab/output specific */
extern
AVFormat
video_grab_device_format
;
extern
AVFormat
audio_device_format
;
extern
const
char
*
v4l_device
;
extern
const
char
*
audio_device
;
libav/utils.c
浏览文件 @
96baaa6a
...
...
@@ -161,13 +161,14 @@ void register_all(void)
register_avformat
(
&
pgmpipe_format
);
register_avformat
(
&
pgmyuvpipe_format
);
register_avformat
(
&
ppmpipe_format
);
#ifdef CONFIG_GRAB
register_avformat
(
&
video_grab_device_format
);
register_avformat
(
&
audio_device_format
);
#endif
/* file protocols */
register_protocol
(
&
file_protocol
);
register_protocol
(
&
pipe_protocol
);
#ifdef CONFIG_GRAB
register_protocol
(
&
audio_protocol
);
register_protocol
(
&
video_protocol
);
#endif
#ifndef CONFIG_WIN32
register_protocol
(
&
udp_protocol
);
register_protocol
(
&
http_protocol
);
...
...
@@ -274,49 +275,51 @@ void fifo_write(FifoBuffer *f, UINT8 *buf, int size, UINT8 **wptr_ptr)
*
wptr_ptr
=
wptr
;
}
/* media file handling */
AVFormatContext
*
av_open_input_file
(
const
char
*
filename
,
int
buf_size
)
/* media file handling.
'filename' is the filename to open.
'format_name' is used to force the file format (NULL if auto guess).
'buf_size' is the optional buffer size (zero if default is OK).
'ap' are additionnal parameters needed when opening the file (NULL if default).
*/
AVFormatContext
*
av_open_input_file
(
const
char
*
filename
,
const
char
*
format_name
,
int
buf_size
,
AVFormatParameters
*
ap
)
{
AVFormatParameters
params
,
*
ap
;
AVFormat
*
fmt
;
AVFormatContext
*
ic
=
NULL
;
URLFormat
url_format
;
int
err
;
ic
=
av_mallocz
(
sizeof
(
AVFormatContext
));
if
(
!
ic
)
goto
fail
;
if
(
url_fopen
(
&
ic
->
pb
,
filename
,
URL_RDONLY
)
<
0
)
goto
fail
;
if
(
buf_size
>
0
)
{
url_setbufsize
(
&
ic
->
pb
,
buf_size
);
}
/* find format */
err
=
url_getformat
(
url_fileno
(
&
ic
->
pb
),
&
url_format
);
if
(
err
>=
0
)
{
fmt
=
guess_format
(
url_format
.
format_name
,
NULL
,
NULL
);
ap
=
&
params
;
ap
->
sample_rate
=
url_format
.
sample_rate
;
ap
->
frame_rate
=
url_format
.
frame_rate
;
ap
->
channels
=
url_format
.
channels
;
ap
->
width
=
url_format
.
width
;
ap
->
height
=
url_format
.
height
;
ap
->
pix_fmt
=
url_format
.
pix_fmt
;
if
(
format_name
!=
NULL
)
{
fmt
=
guess_format
(
format_name
,
NULL
,
NULL
);
}
else
{
fmt
=
guess_format
(
NULL
,
filename
,
NULL
);
ap
=
NULL
;
}
if
(
!
fmt
||
!
fmt
->
read_header
)
{
return
NULL
;
}
ic
->
format
=
fmt
;
/* if no file needed do not try to open one */
if
(
!
(
fmt
->
flags
&
AVFMT_NOFILE
))
{
if
(
url_fopen
(
&
ic
->
pb
,
filename
,
URL_RDONLY
)
<
0
)
goto
fail
;
if
(
buf_size
>
0
)
{
url_setbufsize
(
&
ic
->
pb
,
buf_size
);
}
}
err
=
ic
->
format
->
read_header
(
ic
,
ap
);
if
(
err
<
0
)
{
url_fclose
(
&
ic
->
pb
);
if
(
!
(
fmt
->
flags
&
AVFMT_NOFILE
))
{
url_fclose
(
&
ic
->
pb
);
}
goto
fail
;
}
...
...
@@ -364,7 +367,9 @@ void av_close_input_file(AVFormatContext *s)
}
s
->
packet_buffer
=
NULL
;
}
url_fclose
(
&
s
->
pb
);
if
(
!
(
s
->
format
->
flags
&
AVFMT_NOFILE
))
{
url_fclose
(
&
s
->
pb
);
}
free
(
s
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录