Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
0af8501b
Commit
0af8501b
authored
Sep 09, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stream_out_rtp: Linux splice() support
parent
af9789b6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
1 deletion
+44
-1
configure.ac
configure.ac
+4
-0
modules/stream_out/rtp.c
modules/stream_out/rtp.c
+40
-1
No files found.
configure.ac
View file @
0af8501b
...
...
@@ -444,6 +444,10 @@ AC_CHECK_FUNCS(strcasecmp,,[AC_CHECK_FUNCS(stricmp)])
AC_CHECK_FUNCS(strncasecmp,,[AC_CHECK_FUNCS(strnicmp)])
AC_CHECK_FUNCS(strcasestr,,[AC_CHECK_FUNCS(stristr)])
AS_IF([test "${SYS}" = "linux"], [
AC_CHECK_FUNCS(tee)
])
dnl Check for setlocal and langinfo
AC_CHECK_FUNCS(setlocale)
AC_CHECK_HEADERS(langinfo.h)
...
...
modules/stream_out/rtp.c
View file @
0af8501b
...
...
@@ -39,7 +39,10 @@
#include "rtp.h"
#ifdef HAVE_UNISTD_H
# include <sys/types.h>
# include <unistd.h>
# include <fcntl.h>
# include <sys/stat.h>
#endif
#include <errno.h>
...
...
@@ -1304,24 +1307,60 @@ static void ThreadSend( vlc_object_t *p_this )
{
sout_stream_id_t
*
id
=
(
sout_stream_id_t
*
)
p_this
;
unsigned
i_caching
=
id
->
i_caching
;
#ifdef HAVE_TEE
int
fd
[
5
]
=
{
-
1
,
-
1
,
-
1
,
-
1
,
-
1
};
if
(
pipe
(
fd
)
)
fd
[
0
]
=
fd
[
1
]
=
-
1
;
else
if
(
pipe
(
fd
)
)
fd
[
2
]
=
fd
[
3
]
=
-
1
;
else
fd
[
4
]
=
open
(
"/dev/null"
,
O_WRONLY
);
#endif
while
(
!
id
->
b_die
)
{
block_t
*
out
=
block_FifoGet
(
id
->
p_fifo
);
mtime_t
i_date
=
out
->
i_dts
+
i_caching
;
ssize_t
len
=
out
->
i_buffer
;
#ifdef HAVE_TEE
if
(
fd
[
4
]
!=
-
1
)
len
=
write
(
fd
[
1
],
out
->
p_buffer
,
len
);
if
(
len
==
-
1
)
continue
;
/* Uho - should not happen */
#endif
mwait
(
i_date
);
vlc_mutex_lock
(
&
id
->
lock_sink
);
for
(
int
i
=
0
;
i
<
id
->
sinkc
;
i
++
)
{
send
(
id
->
sinkv
[
i
].
rtp_fd
,
out
->
p_buffer
,
out
->
i_buffer
,
0
);
SendRTCP
(
id
->
sinkv
[
i
].
rtcp
,
out
);
#ifdef HAVE_TEE
tee
(
fd
[
0
],
fd
[
3
],
len
,
0
);
if
(
splice
(
fd
[
2
],
NULL
,
id
->
sinkv
[
i
].
rtp_fd
,
NULL
,
len
,
SPLICE_F_NONBLOCK
)
>=
0
)
continue
;
/* splice failed */
splice
(
fd
[
2
],
NULL
,
fd
[
4
],
NULL
,
len
,
0
);
#endif
send
(
id
->
sinkv
[
i
].
rtp_fd
,
out
->
p_buffer
,
len
,
0
);
}
vlc_mutex_unlock
(
&
id
->
lock_sink
);
block_Release
(
out
);
#ifdef HAVE_TEE
splice
(
fd
[
0
],
NULL
,
fd
[
4
],
NULL
,
len
,
0
);
#endif
}
#ifdef HAVE_TEE
for
(
unsigned
i
=
0
;
i
<
5
;
i
++
)
close
(
fd
[
i
]
);
#endif
}
static
inline
void
rtp_packetize_send
(
sout_stream_id_t
*
id
,
block_t
*
out
)
...
...
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