Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
21198155
Commit
21198155
authored
Jul 21, 2015
by
Stephan Holljes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/tcp: add tcp_accept
Signed-off-by:
Stephan Holljes
<
klaxa1337@googlemail.com
>
parent
63c07a95
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
tcp.c
libavformat/tcp.c
+18
-0
No files found.
libavformat/tcp.c
View file @
21198155
...
...
@@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "avformat.h"
#include "libavutil/avassert.h"
#include "libavutil/parseutils.h"
#include "libavutil/opt.h"
#include "libavutil/time.h"
...
...
@@ -163,6 +164,22 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
return
ret
;
}
static
int
tcp_accept
(
URLContext
*
s
,
URLContext
**
c
)
{
TCPContext
*
sc
=
s
->
priv_data
;
TCPContext
*
cc
;
int
ret
;
av_assert0
(
sc
->
listen
);
if
((
ret
=
ffurl_alloc
(
c
,
s
->
filename
,
s
->
flags
,
&
s
->
interrupt_callback
))
<
0
)
return
ret
;
cc
=
(
*
c
)
->
priv_data
;
ret
=
ff_accept
(
sc
->
fd
,
sc
->
listen_timeout
,
s
);
if
(
ret
<
0
)
return
ff_neterrno
();
cc
->
fd
=
ret
;
return
0
;
}
static
int
tcp_read
(
URLContext
*
h
,
uint8_t
*
buf
,
int
size
)
{
TCPContext
*
s
=
h
->
priv_data
;
...
...
@@ -223,6 +240,7 @@ static int tcp_get_file_handle(URLContext *h)
URLProtocol
ff_tcp_protocol
=
{
.
name
=
"tcp"
,
.
url_open
=
tcp_open
,
.
url_accept
=
tcp_accept
,
.
url_read
=
tcp_read
,
.
url_write
=
tcp_write
,
.
url_close
=
tcp_close
,
...
...
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