Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
4ec153bb
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,发现更多精彩内容 >>
提交
4ec153bb
编写于
3月 08, 2011
作者:
A
Anton Khirnov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
avio: make udp_set_remote_url/get_local_port internal.
上级
4377fafd
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
19 addition
and
13 deletion
+19
-13
doc/protocols.texi
doc/protocols.texi
+2
-2
libavformat/avio.h
libavformat/avio.h
+3
-3
libavformat/avio_internal.h
libavformat/avio_internal.h
+4
-0
libavformat/rtpproto.c
libavformat/rtpproto.c
+6
-5
libavformat/udp.c
libavformat/udp.c
+4
-3
未找到文件。
doc/protocols.texi
浏览文件 @
4ec153bb
...
...
@@ -433,9 +433,9 @@ set the time to live value (for multicast only)
@item connect=@var{1|0}
Initialize the UDP socket with @code{connect()}. In this case, the
destination address can't be changed with udp_set_remote_url later.
destination address can't be changed with
ff_
udp_set_remote_url later.
If the destination address isn't known at the start, this option can
be specified in udp_set_remote_url, too.
be specified in
ff_
udp_set_remote_url, too.
This allows finding out the source address for the packets with getsockname,
and makes writes return with AVERROR(ECONNREFUSED) if "destination
unreachable" is received.
...
...
libavformat/avio.h
浏览文件 @
4ec153bb
...
...
@@ -448,6 +448,9 @@ attribute_deprecated void put_flush_packet(AVIOContext *s);
*/
attribute_deprecated
int
url_feof
(
AVIOContext
*
s
);
attribute_deprecated
int
url_ferror
(
AVIOContext
*
s
);
attribute_deprecated
int
udp_set_remote_url
(
URLContext
*
h
,
const
char
*
uri
);
attribute_deprecated
int
udp_get_local_port
(
URLContext
*
h
);
#endif
AVIOContext
*
avio_alloc_context
(
...
...
@@ -675,9 +678,6 @@ void init_checksum(AVIOContext *s,
unsigned
long
(
*
update_checksum
)(
unsigned
long
c
,
const
uint8_t
*
p
,
unsigned
int
len
),
unsigned
long
checksum
);
/* udp.c */
int
udp_set_remote_url
(
URLContext
*
h
,
const
char
*
uri
);
int
udp_get_local_port
(
URLContext
*
h
);
#if FF_API_UDP_GET_FILE
int
udp_get_file_handle
(
URLContext
*
h
);
#endif
...
...
libavformat/avio_internal.h
浏览文件 @
4ec153bb
...
...
@@ -70,5 +70,9 @@ int ffio_read_pause(AVIOContext *h, int pause);
int64_t
ffio_read_seek
(
AVIOContext
*
h
,
int
stream_index
,
int64_t
timestamp
,
int
flags
);
/* udp.c */
int
ff_udp_set_remote_url
(
URLContext
*
h
,
const
char
*
uri
);
int
ff_udp_get_local_port
(
URLContext
*
h
);
#endif // AVFORMAT_AVIO_INTERNAL_H
libavformat/rtpproto.c
浏览文件 @
4ec153bb
...
...
@@ -27,6 +27,7 @@
#include "libavutil/parseutils.h"
#include "libavutil/avstring.h"
#include "avformat.h"
#include "avio_internal.h"
#include "rtpdec.h"
#include <unistd.h>
...
...
@@ -71,10 +72,10 @@ int rtp_set_remote_url(URLContext *h, const char *uri)
path
,
sizeof
(
path
),
uri
);
ff_url_join
(
buf
,
sizeof
(
buf
),
"udp"
,
NULL
,
hostname
,
port
,
"%s"
,
path
);
udp_set_remote_url
(
s
->
rtp_hd
,
buf
);
ff_
udp_set_remote_url
(
s
->
rtp_hd
,
buf
);
ff_url_join
(
buf
,
sizeof
(
buf
),
"udp"
,
NULL
,
hostname
,
port
+
1
,
"%s"
,
path
);
udp_set_remote_url
(
s
->
rtcp_hd
,
buf
);
ff_
udp_set_remote_url
(
s
->
rtcp_hd
,
buf
);
return
0
;
}
...
...
@@ -191,7 +192,7 @@ static int rtp_open(URLContext *h, const char *uri, int flags)
if
(
url_open
(
&
s
->
rtp_hd
,
buf
,
flags
)
<
0
)
goto
fail
;
if
(
local_rtp_port
>=
0
&&
local_rtcp_port
<
0
)
local_rtcp_port
=
udp_get_local_port
(
s
->
rtp_hd
)
+
1
;
local_rtcp_port
=
ff_
udp_get_local_port
(
s
->
rtp_hd
)
+
1
;
build_udp_url
(
buf
,
sizeof
(
buf
),
hostname
,
rtcp_port
,
local_rtcp_port
,
ttl
,
max_packet_size
,
...
...
@@ -326,7 +327,7 @@ static int rtp_close(URLContext *h)
int
rtp_get_local_rtp_port
(
URLContext
*
h
)
{
RTPContext
*
s
=
h
->
priv_data
;
return
udp_get_local_port
(
s
->
rtp_hd
);
return
ff_
udp_get_local_port
(
s
->
rtp_hd
);
}
/**
...
...
@@ -338,7 +339,7 @@ int rtp_get_local_rtp_port(URLContext *h)
int
rtp_get_local_rtcp_port
(
URLContext
*
h
)
{
RTPContext
*
s
=
h
->
priv_data
;
return
udp_get_local_port
(
s
->
rtcp_hd
);
return
ff_
udp_get_local_port
(
s
->
rtcp_hd
);
}
static
int
rtp_get_file_handle
(
URLContext
*
h
)
...
...
libavformat/udp.c
浏览文件 @
4ec153bb
...
...
@@ -27,6 +27,7 @@
#define _BSD_SOURCE
/* Needed for using struct ip_mreq with recent glibc */
#define _DARWIN_C_SOURCE
/* Needed for using IP_MULTICAST_TTL on OS X */
#include "avformat.h"
#include "avio_internal.h"
#include "libavutil/parseutils.h"
#include <unistd.h>
#include "internal.h"
...
...
@@ -243,7 +244,7 @@ static int udp_port(struct sockaddr_storage *addr, int addr_len)
* @param uri of the remote server
* @return zero if no error.
*/
int
udp_set_remote_url
(
URLContext
*
h
,
const
char
*
uri
)
int
ff_
udp_set_remote_url
(
URLContext
*
h
,
const
char
*
uri
)
{
UDPContext
*
s
=
h
->
priv_data
;
char
hostname
[
256
],
buf
[
10
];
...
...
@@ -282,7 +283,7 @@ int udp_set_remote_url(URLContext *h, const char *uri)
* @param h media file context
* @return the local port number
*/
int
udp_get_local_port
(
URLContext
*
h
)
int
ff_
udp_get_local_port
(
URLContext
*
h
)
{
UDPContext
*
s
=
h
->
priv_data
;
return
s
->
local_port
;
...
...
@@ -365,7 +366,7 @@ static int udp_open(URLContext *h, const char *uri, int flags)
if
(
flags
&
URL_WRONLY
)
goto
fail
;
}
else
{
if
(
udp_set_remote_url
(
h
,
uri
)
<
0
)
if
(
ff_
udp_set_remote_url
(
h
,
uri
)
<
0
)
goto
fail
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录