Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
1869ea03
Commit
1869ea03
authored
Mar 31, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avio: make url_get_file_handle() internal.
parent
32a97d46
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
24 additions
and
19 deletions
+24
-19
avio.c
libavformat/avio.c
+5
-1
avio.h
libavformat/avio.h
+1
-8
http.c
libavformat/http.c
+1
-1
rtpproto.c
libavformat/rtpproto.c
+2
-2
rtsp.c
libavformat/rtsp.c
+4
-4
rtspenc.c
libavformat/rtspenc.c
+1
-1
sapdec.c
libavformat/sapdec.c
+1
-1
sapenc.c
libavformat/sapenc.c
+1
-1
url.h
libavformat/url.h
+8
-0
No files found.
libavformat/avio.c
View file @
1869ea03
...
...
@@ -204,6 +204,10 @@ int64_t url_filesize(URLContext *h)
{
return
ffurl_size
(
h
);
}
int
url_get_file_handle
(
URLContext
*
h
)
{
return
ffurl_get_file_handle
(
h
);
}
#endif
#define URL_SCHEME_CHARS \
...
...
@@ -357,7 +361,7 @@ int64_t ffurl_size(URLContext *h)
return
size
;
}
int
url_get_file_handle
(
URLContext
*
h
)
int
ff
url_get_file_handle
(
URLContext
*
h
)
{
if
(
!
h
->
prot
->
url_get_file_handle
)
return
-
1
;
...
...
libavformat/avio.h
View file @
1869ea03
...
...
@@ -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
int
url_close
(
URLContext
*
h
);
attribute_deprecated
int64_t
url_filesize
(
URLContext
*
h
);
attribute_deprecated
int
url_get_file_handle
(
URLContext
*
h
);
#endif
/**
...
...
@@ -119,14 +120,6 @@ attribute_deprecated int64_t url_filesize(URLContext *h);
*/
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
* handle. If the file is not packetized (stream like HTTP or file on
...
...
libavformat/http.c
View file @
1869ea03
...
...
@@ -501,7 +501,7 @@ static int
http_get_file_handle
(
URLContext
*
h
)
{
HTTPContext
*
s
=
h
->
priv_data
;
return
url_get_file_handle
(
s
->
hd
);
return
ff
url_get_file_handle
(
s
->
hd
);
}
URLProtocol
ff_http_protocol
=
{
...
...
libavformat/rtpproto.c
View file @
1869ea03
...
...
@@ -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
access */
s
->
rtp_fd
=
url_get_file_handle
(
s
->
rtp_hd
);
s
->
rtcp_fd
=
url_get_file_handle
(
s
->
rtcp_hd
);
s
->
rtp_fd
=
ff
url_get_file_handle
(
s
->
rtp_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
->
is_streamed
=
1
;
...
...
libavformat/rtsp.c
View file @
1869ea03
...
...
@@ -1468,7 +1468,7 @@ redirect:
}
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
))
{
getnameinfo
((
struct
sockaddr
*
)
&
peer
,
peer_len
,
host
,
sizeof
(
host
),
NULL
,
0
,
NI_NUMERICHOST
);
...
...
@@ -1571,7 +1571,7 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
return
AVERROR
(
EAGAIN
);
max_p
=
0
;
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
++
].
events
=
POLLIN
;
}
else
{
...
...
@@ -1580,7 +1580,7 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
for
(
i
=
0
;
i
<
rt
->
nb_rtsp_streams
;
i
++
)
{
rtsp_st
=
rt
->
rtsp_streams
[
i
];
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
].
fd
=
rtp_get_rtcp_file_handle
(
rtsp_st
->
rtp_handle
);
p
[
max_p
++
].
events
=
POLLIN
;
...
...
@@ -1887,7 +1887,7 @@ static int rtp_read_header(AVFormatContext *s,
payload_type
=
recvbuf
[
1
]
&
0x7f
;
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
);
in
=
NULL
;
...
...
libavformat/rtspenc.c
View file @
1869ea03
...
...
@@ -173,7 +173,7 @@ static int rtsp_write_packet(AVFormatContext *s, AVPacket *pkt)
RTSPState
*
rt
=
s
->
priv_data
;
RTSPStream
*
rtsp_st
;
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
;
int
ret
;
...
...
libavformat/sapdec.c
View file @
1869ea03
...
...
@@ -183,7 +183,7 @@ fail:
static
int
sap_fetch_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
{
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
;
struct
pollfd
p
=
{
fd
,
POLLIN
,
0
};
uint8_t
recvbuf
[
1500
];
...
...
libavformat/sapenc.c
View file @
1869ea03
...
...
@@ -164,7 +164,7 @@ static int sap_write_header(AVFormatContext *s)
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
))
{
ret
=
AVERROR
(
EIO
);
goto
fail
;
...
...
libavformat/url.h
View file @
1869ea03
...
...
@@ -118,4 +118,12 @@ int ffurl_close(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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment