Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
1869ea03
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,发现更多精彩内容 >>
提交
1869ea03
编写于
3月 31, 2011
作者:
A
Anton Khirnov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
avio: make url_get_file_handle() internal.
上级
32a97d46
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
24 addition
and
19 deletion
+24
-19
libavformat/avio.c
libavformat/avio.c
+5
-1
libavformat/avio.h
libavformat/avio.h
+1
-8
libavformat/http.c
libavformat/http.c
+1
-1
libavformat/rtpproto.c
libavformat/rtpproto.c
+2
-2
libavformat/rtsp.c
libavformat/rtsp.c
+4
-4
libavformat/rtspenc.c
libavformat/rtspenc.c
+1
-1
libavformat/sapdec.c
libavformat/sapdec.c
+1
-1
libavformat/sapenc.c
libavformat/sapenc.c
+1
-1
libavformat/url.h
libavformat/url.h
+8
-0
未找到文件。
libavformat/avio.c
浏览文件 @
1869ea03
...
@@ -204,6 +204,10 @@ int64_t url_filesize(URLContext *h)
...
@@ -204,6 +204,10 @@ int64_t url_filesize(URLContext *h)
{
{
return
ffurl_size
(
h
);
return
ffurl_size
(
h
);
}
}
int
url_get_file_handle
(
URLContext
*
h
)
{
return
ffurl_get_file_handle
(
h
);
}
#endif
#endif
#define URL_SCHEME_CHARS \
#define URL_SCHEME_CHARS \
...
@@ -357,7 +361,7 @@ int64_t ffurl_size(URLContext *h)
...
@@ -357,7 +361,7 @@ int64_t ffurl_size(URLContext *h)
return
size
;
return
size
;
}
}
int
url_get_file_handle
(
URLContext
*
h
)
int
ff
url_get_file_handle
(
URLContext
*
h
)
{
{
if
(
!
h
->
prot
->
url_get_file_handle
)
if
(
!
h
->
prot
->
url_get_file_handle
)
return
-
1
;
return
-
1
;
...
...
libavformat/avio.h
浏览文件 @
1869ea03
...
@@ -111,6 +111,7 @@ attribute_deprecated int url_write(URLContext *h, const unsigned char *buf, int
...
@@ -111,6 +111,7 @@ attribute_deprecated int url_write(URLContext *h, const unsigned char *buf, int
attribute_deprecated
int64_t
url_seek
(
URLContext
*
h
,
int64_t
pos
,
int
whence
);
attribute_deprecated
int64_t
url_seek
(
URLContext
*
h
,
int64_t
pos
,
int
whence
);
attribute_deprecated
int
url_close
(
URLContext
*
h
);
attribute_deprecated
int
url_close
(
URLContext
*
h
);
attribute_deprecated
int64_t
url_filesize
(
URLContext
*
h
);
attribute_deprecated
int64_t
url_filesize
(
URLContext
*
h
);
attribute_deprecated
int
url_get_file_handle
(
URLContext
*
h
);
#endif
#endif
/**
/**
...
@@ -119,14 +120,6 @@ attribute_deprecated int64_t url_filesize(URLContext *h);
...
@@ -119,14 +120,6 @@ attribute_deprecated int64_t url_filesize(URLContext *h);
*/
*/
int
url_exist
(
const
char
*
url
);
int
url_exist
(
const
char
*
url
);
/**
* Return the file descriptor associated with this URL. For RTP, this
* will return only the RTP file descriptor, not the RTCP file descriptor.
*
* @return the file descriptor associated with this URL, or <0 on error.
*/
int
url_get_file_handle
(
URLContext
*
h
);
/**
/**
* Return the maximum packet size associated to packetized file
* Return the maximum packet size associated to packetized file
* handle. If the file is not packetized (stream like HTTP or file on
* handle. If the file is not packetized (stream like HTTP or file on
...
...
libavformat/http.c
浏览文件 @
1869ea03
...
@@ -501,7 +501,7 @@ static int
...
@@ -501,7 +501,7 @@ static int
http_get_file_handle
(
URLContext
*
h
)
http_get_file_handle
(
URLContext
*
h
)
{
{
HTTPContext
*
s
=
h
->
priv_data
;
HTTPContext
*
s
=
h
->
priv_data
;
return
url_get_file_handle
(
s
->
hd
);
return
ff
url_get_file_handle
(
s
->
hd
);
}
}
URLProtocol
ff_http_protocol
=
{
URLProtocol
ff_http_protocol
=
{
...
...
libavformat/rtpproto.c
浏览文件 @
1869ea03
...
@@ -203,8 +203,8 @@ static int rtp_open(URLContext *h, const char *uri, int flags)
...
@@ -203,8 +203,8 @@ static int rtp_open(URLContext *h, const char *uri, int flags)
/* just to ease handle access. XXX: need to suppress direct handle
/* just to ease handle access. XXX: need to suppress direct handle
access */
access */
s
->
rtp_fd
=
url_get_file_handle
(
s
->
rtp_hd
);
s
->
rtp_fd
=
ff
url_get_file_handle
(
s
->
rtp_hd
);
s
->
rtcp_fd
=
url_get_file_handle
(
s
->
rtcp_hd
);
s
->
rtcp_fd
=
ff
url_get_file_handle
(
s
->
rtcp_hd
);
h
->
max_packet_size
=
url_get_max_packet_size
(
s
->
rtp_hd
);
h
->
max_packet_size
=
url_get_max_packet_size
(
s
->
rtp_hd
);
h
->
is_streamed
=
1
;
h
->
is_streamed
=
1
;
...
...
libavformat/rtsp.c
浏览文件 @
1869ea03
...
@@ -1468,7 +1468,7 @@ redirect:
...
@@ -1468,7 +1468,7 @@ redirect:
}
}
rt
->
seq
=
0
;
rt
->
seq
=
0
;
tcp_fd
=
url_get_file_handle
(
rt
->
rtsp_hd
);
tcp_fd
=
ff
url_get_file_handle
(
rt
->
rtsp_hd
);
if
(
!
getpeername
(
tcp_fd
,
(
struct
sockaddr
*
)
&
peer
,
&
peer_len
))
{
if
(
!
getpeername
(
tcp_fd
,
(
struct
sockaddr
*
)
&
peer
,
&
peer_len
))
{
getnameinfo
((
struct
sockaddr
*
)
&
peer
,
peer_len
,
host
,
sizeof
(
host
),
getnameinfo
((
struct
sockaddr
*
)
&
peer
,
peer_len
,
host
,
sizeof
(
host
),
NULL
,
0
,
NI_NUMERICHOST
);
NULL
,
0
,
NI_NUMERICHOST
);
...
@@ -1571,7 +1571,7 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
...
@@ -1571,7 +1571,7 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
return
AVERROR
(
EAGAIN
);
return
AVERROR
(
EAGAIN
);
max_p
=
0
;
max_p
=
0
;
if
(
rt
->
rtsp_hd
)
{
if
(
rt
->
rtsp_hd
)
{
tcp_fd
=
url_get_file_handle
(
rt
->
rtsp_hd
);
tcp_fd
=
ff
url_get_file_handle
(
rt
->
rtsp_hd
);
p
[
max_p
].
fd
=
tcp_fd
;
p
[
max_p
].
fd
=
tcp_fd
;
p
[
max_p
++
].
events
=
POLLIN
;
p
[
max_p
++
].
events
=
POLLIN
;
}
else
{
}
else
{
...
@@ -1580,7 +1580,7 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
...
@@ -1580,7 +1580,7 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
for
(
i
=
0
;
i
<
rt
->
nb_rtsp_streams
;
i
++
)
{
for
(
i
=
0
;
i
<
rt
->
nb_rtsp_streams
;
i
++
)
{
rtsp_st
=
rt
->
rtsp_streams
[
i
];
rtsp_st
=
rt
->
rtsp_streams
[
i
];
if
(
rtsp_st
->
rtp_handle
)
{
if
(
rtsp_st
->
rtp_handle
)
{
p
[
max_p
].
fd
=
url_get_file_handle
(
rtsp_st
->
rtp_handle
);
p
[
max_p
].
fd
=
ff
url_get_file_handle
(
rtsp_st
->
rtp_handle
);
p
[
max_p
++
].
events
=
POLLIN
;
p
[
max_p
++
].
events
=
POLLIN
;
p
[
max_p
].
fd
=
rtp_get_rtcp_file_handle
(
rtsp_st
->
rtp_handle
);
p
[
max_p
].
fd
=
rtp_get_rtcp_file_handle
(
rtsp_st
->
rtp_handle
);
p
[
max_p
++
].
events
=
POLLIN
;
p
[
max_p
++
].
events
=
POLLIN
;
...
@@ -1887,7 +1887,7 @@ static int rtp_read_header(AVFormatContext *s,
...
@@ -1887,7 +1887,7 @@ static int rtp_read_header(AVFormatContext *s,
payload_type
=
recvbuf
[
1
]
&
0x7f
;
payload_type
=
recvbuf
[
1
]
&
0x7f
;
break
;
break
;
}
}
getsockname
(
url_get_file_handle
(
in
),
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
);
getsockname
(
ff
url_get_file_handle
(
in
),
(
struct
sockaddr
*
)
&
addr
,
&
addrlen
);
ffurl_close
(
in
);
ffurl_close
(
in
);
in
=
NULL
;
in
=
NULL
;
...
...
libavformat/rtspenc.c
浏览文件 @
1869ea03
...
@@ -173,7 +173,7 @@ static int rtsp_write_packet(AVFormatContext *s, AVPacket *pkt)
...
@@ -173,7 +173,7 @@ static int rtsp_write_packet(AVFormatContext *s, AVPacket *pkt)
RTSPState
*
rt
=
s
->
priv_data
;
RTSPState
*
rt
=
s
->
priv_data
;
RTSPStream
*
rtsp_st
;
RTSPStream
*
rtsp_st
;
int
n
;
int
n
;
struct
pollfd
p
=
{
url_get_file_handle
(
rt
->
rtsp_hd
),
POLLIN
,
0
};
struct
pollfd
p
=
{
ff
url_get_file_handle
(
rt
->
rtsp_hd
),
POLLIN
,
0
};
AVFormatContext
*
rtpctx
;
AVFormatContext
*
rtpctx
;
int
ret
;
int
ret
;
...
...
libavformat/sapdec.c
浏览文件 @
1869ea03
...
@@ -183,7 +183,7 @@ fail:
...
@@ -183,7 +183,7 @@ fail:
static
int
sap_fetch_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
static
int
sap_fetch_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
{
{
struct
SAPState
*
sap
=
s
->
priv_data
;
struct
SAPState
*
sap
=
s
->
priv_data
;
int
fd
=
url_get_file_handle
(
sap
->
ann_fd
);
int
fd
=
ff
url_get_file_handle
(
sap
->
ann_fd
);
int
n
,
ret
;
int
n
,
ret
;
struct
pollfd
p
=
{
fd
,
POLLIN
,
0
};
struct
pollfd
p
=
{
fd
,
POLLIN
,
0
};
uint8_t
recvbuf
[
1500
];
uint8_t
recvbuf
[
1500
];
...
...
libavformat/sapenc.c
浏览文件 @
1869ea03
...
@@ -164,7 +164,7 @@ static int sap_write_header(AVFormatContext *s)
...
@@ -164,7 +164,7 @@ static int sap_write_header(AVFormatContext *s)
goto
fail
;
goto
fail
;
}
}
udp_fd
=
url_get_file_handle
(
sap
->
ann_fd
);
udp_fd
=
ff
url_get_file_handle
(
sap
->
ann_fd
);
if
(
getsockname
(
udp_fd
,
(
struct
sockaddr
*
)
&
localaddr
,
&
addrlen
))
{
if
(
getsockname
(
udp_fd
,
(
struct
sockaddr
*
)
&
localaddr
,
&
addrlen
))
{
ret
=
AVERROR
(
EIO
);
ret
=
AVERROR
(
EIO
);
goto
fail
;
goto
fail
;
...
...
libavformat/url.h
浏览文件 @
1869ea03
...
@@ -118,4 +118,12 @@ int ffurl_close(URLContext *h);
...
@@ -118,4 +118,12 @@ int ffurl_close(URLContext *h);
*/
*/
int64_t
ffurl_size
(
URLContext
*
h
);
int64_t
ffurl_size
(
URLContext
*
h
);
/**
* Return the file descriptor associated with this URL. For RTP, this
* will return only the RTP file descriptor, not the RTCP file descriptor.
*
* @return the file descriptor associated with this URL, or <0 on error.
*/
int
ffurl_get_file_handle
(
URLContext
*
h
);
#endif //AVFORMAT_URL_H
#endif //AVFORMAT_URL_H
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录