Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
08cb8e62
Commit
08cb8e62
authored
Feb 10, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for session description
parent
2f9e4e4c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
21 deletions
+55
-21
src/stream_output/sdp.c
src/stream_output/sdp.c
+53
-20
src/stream_output/stream_output.h
src/stream_output/stream_output.h
+2
-1
No files found.
src/stream_output/sdp.c
View file @
08cb8e62
...
...
@@ -21,15 +21,15 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#
include <vlc/vlc.h>
#include <vlc/vlc.h>
#
include <string.h>
#
include <vlc_network.h>
#
include <vlc_charset.h>
#include <string.h>
#include <vlc_network.h>
#include <vlc_charset.h>
#
include "stream_output.h"
#include "stream_output.h"
#
define MAXSDPADDRESS 47
#define MAXSDPADDRESS 47
static
char
*
AddressToSDP
(
const
struct
sockaddr
*
addr
,
socklen_t
addrlen
,
char
*
buf
)
...
...
@@ -68,35 +68,68 @@ char *AddressToSDP (const struct sockaddr *addr, socklen_t addrlen, char *buf)
}
char
*
StartSDP
(
const
char
*
name
,
static
vlc_bool_t
IsSDPString
(
const
char
*
str
)
{
if
(
strchr
(
str
,
'\r'
)
!=
NULL
)
return
VLC_FALSE
;
if
(
strchr
(
str
,
'\n'
)
!=
NULL
)
return
VLC_FALSE
;
if
(
!
IsUTF8
(
str
))
return
VLC_FALSE
;
return
VLC_TRUE
;
}
char
*
StartSDP
(
const
char
*
name
,
const
char
*
description
,
const
char
*
url
,
const
char
*
email
,
const
char
*
phone
,
const
struct
sockaddr
*
orig
,
socklen_t
origlen
,
const
struct
sockaddr
*
addr
,
socklen_t
addrlen
)
{
uint64_t
t
=
NTPtime64
();
char
*
sdp
,
machine
[
MAXSDPADDRESS
],
conn
[
MAXSDPADDRESS
];
if
(
strchr
(
name
,
'\r'
)
||
strchr
(
name
,
'\n'
)
||
!
IsUTF8
(
name
)
const
char
*
preurl
=
"
\r\n
u="
,
*
premail
=
"
\r\n
e="
,
*
prephone
=
"
\r\n
p="
;
if
(
name
==
NULL
)
name
=
"Unnamed"
;
if
(
description
==
NULL
)
description
=
"N/A"
;
if
(
url
==
NULL
)
preurl
=
url
=
""
;
if
(
email
==
NULL
)
premail
=
email
=
""
;
if
(
phone
==
NULL
)
prephone
=
phone
=
""
;
if
(
!
IsSDPString
(
name
)
||
!
IsSDPString
(
description
)
||
!
IsSDPString
(
url
)
||
!
IsSDPString
(
email
)
||
!
IsSDPString
(
phone
)
||
(
AddressToSDP
((
struct
sockaddr
*
)
&
orig
,
origlen
,
machine
)
==
NULL
)
||
(
AddressToSDP
((
struct
sockaddr
*
)
&
addr
,
addrlen
,
conn
)
==
NULL
))
return
NULL
;
if
(
asprintf
(
&
sdp
,
"v=0
\r\n
"
"o=- "
I64Fu
" "
I64Fu
" %s
\r\n
"
"s=%s
\r\n
"
"i=N/A
\r\n
"
// must be there even if useless
// no URL, email and phone here */
"c=%s
\r\n
"
if
(
asprintf
(
&
sdp
,
"v=0"
"
\r\n
o=- "
I64Fu
" "
I64Fu
" %s"
"
\r\n
s=%s"
"
\r\n
i=%s"
"%s%s"
// optional URL
"%s%s"
// optional email
"%s%s"
// optional phone number
"
\r\n
c=%s"
// bandwidth not specified
"
t= 0 0"
// one dummy time span
"
\r\n
t= 0 0"
// one dummy time span
// no repeating
// no time zone adjustment (silly idea anyway)
// no encryption key (deprecated)
"a=tool:"
PACKAGE_STRING
"
\r\n
"
"a=recvonly
\r\n
"
"a=type:broadcast
\r\n
"
"a=charset:UTF-8
\r\n
"
,
"
\r\n
a=tool:"
PACKAGE_STRING
"
\r\n
a=recvonly"
"
\r\n
a=type:broadcast"
"
\r\n
a=charset:UTF-8"
"
\r\n
"
,
/* o= */
t
,
t
,
machine
,
/* s= */
name
,
/* i= */
description
,
/* u= */
preurl
,
url
,
/* e= */
premail
,
email
,
/* p= */
prephone
,
phone
,
/* c= */
conn
)
==
-
1
)
return
NULL
;
return
sdp
;
...
...
src/stream_output/stream_output.h
View file @
08cb8e62
...
...
@@ -90,7 +90,8 @@ int announce_UnRegister( announce_handler_t *p_announce,
sap_handler_t
*
announce_SAPHandlerCreate
(
announce_handler_t
*
p_announce
);
void
announce_SAPHandlerDestroy
(
sap_handler_t
*
p_sap
);
char
*
StartSDP
(
const
char
*
name
,
char
*
StartSDP
(
const
char
*
name
,
const
char
*
description
,
const
char
*
url
,
const
char
*
email
,
const
char
*
phone
,
const
struct
sockaddr
*
orig
,
socklen_t
origlen
,
const
struct
sockaddr
*
addr
,
socklen_t
addrlen
);
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