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
bc650c59
Commit
bc650c59
authored
Sep 15, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rework SDP API a little
parent
d5f7a3c1
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
15 deletions
+62
-15
include/vlc_sout.h
include/vlc_sout.h
+1
-0
modules/stream_out/rtp.c
modules/stream_out/rtp.c
+15
-11
src/libvlc.sym
src/libvlc.sym
+1
-1
src/stream_output/sdp.c
src/stream_output/sdp.c
+45
-3
No files found.
include/vlc_sout.h
View file @
bc650c59
...
@@ -222,6 +222,7 @@ VLC_EXPORT(void, sout_MethodRelease, (announce_method_t *) );
...
@@ -222,6 +222,7 @@ VLC_EXPORT(void, sout_MethodRelease, (announce_method_t *) );
/** SDP */
/** SDP */
VLC_EXPORT
(
char
*
,
vlc_sdp_Start
,
(
vlc_object_t
*
obj
,
const
char
*
cfgpref
,
const
struct
sockaddr
*
src
,
size_t
srclen
,
const
struct
sockaddr
*
addr
,
size_t
addrlen
)
);
VLC_EXPORT
(
char
*
,
sdp_Start
,
(
const
char
*
name
,
const
char
*
description
,
const
char
*
url
,
const
char
*
email
,
const
char
*
phone
,
const
struct
sockaddr
*
orig
,
size_t
origlen
,
const
struct
sockaddr
*
addr
,
size_t
addrlen
)
);
VLC_EXPORT
(
char
*
,
sdp_Start
,
(
const
char
*
name
,
const
char
*
description
,
const
char
*
url
,
const
char
*
email
,
const
char
*
phone
,
const
struct
sockaddr
*
orig
,
size_t
origlen
,
const
struct
sockaddr
*
addr
,
size_t
addrlen
)
);
VLC_EXPORT
(
char
*
,
sdp_AddMedia
,
(
char
**
sdp
,
const
char
*
type
,
const
char
*
protocol
,
int
dport
,
unsigned
pt
,
vlc_bool_t
bw_indep
,
unsigned
bw
,
const
char
*
rtpmap
,
const
char
*
fmtp
)
);
VLC_EXPORT
(
char
*
,
sdp_AddMedia
,
(
char
**
sdp
,
const
char
*
type
,
const
char
*
protocol
,
int
dport
,
unsigned
pt
,
vlc_bool_t
bw_indep
,
unsigned
bw
,
const
char
*
rtpmap
,
const
char
*
fmtp
)
);
VLC_EXPORT
(
char
*
,
sdp_AddAttribute
,
(
char
**
sdp
,
const
char
*
name
,
const
char
*
fmt
,
...)
ATTRIBUTE_FORMAT
(
3
,
4
)
);
VLC_EXPORT
(
char
*
,
sdp_AddAttribute
,
(
char
**
sdp
,
const
char
*
name
,
const
char
*
fmt
,
...)
ATTRIBUTE_FORMAT
(
3
,
4
)
);
...
...
modules/stream_out/rtp.c
View file @
bc650c59
...
@@ -69,10 +69,10 @@
...
@@ -69,10 +69,10 @@
#define NAME_LONGTEXT N_( \
#define NAME_LONGTEXT N_( \
"This is the name of the session that will be announced in the SDP " \
"This is the name of the session that will be announced in the SDP " \
"(Session Descriptor)." )
"(Session Descriptor)." )
#define DESC_TEXT N_("Session descripti
o
n")
#define DESC_TEXT N_("Session descripti
p
n")
#define DESC_LONGTEXT N_( \
#define DESC_LONGTEXT N_( \
"This allows you to give a
broader description of the stream, that will
" \
"This allows you to give a
short description with details about the stream,
" \
"be announced in the SDP (Session Descriptor)." )
"
that will
be announced in the SDP (Session Descriptor)." )
#define URL_TEXT N_("Session URL")
#define URL_TEXT N_("Session URL")
#define URL_LONGTEXT N_( \
#define URL_LONGTEXT N_( \
"This allows you to give an URL with more details about the stream " \
"This allows you to give an URL with more details about the stream " \
...
@@ -82,6 +82,11 @@
...
@@ -82,6 +82,11 @@
#define EMAIL_LONGTEXT N_( \
#define EMAIL_LONGTEXT N_( \
"This allows you to give a contact mail address for the stream, that will " \
"This allows you to give a contact mail address for the stream, that will " \
"be announced in the SDP (Session Descriptor)." )
"be announced in the SDP (Session Descriptor)." )
#define PHONE_TEXT N_("Session phone number")
#define PHONE_LONGTEXT N_( \
"This allows you to give a contact telephone number for the stream, that will " \
"be announced in the SDP (Session Descriptor)." )
#define PORT_TEXT N_("Port")
#define PORT_TEXT N_("Port")
#define PORT_LONGTEXT N_( \
#define PORT_LONGTEXT N_( \
"This allows you to specify the base port for the RTP streaming." )
"This allows you to specify the base port for the RTP streaming." )
...
@@ -141,6 +146,8 @@ vlc_module_begin();
...
@@ -141,6 +146,8 @@ vlc_module_begin();
URL_LONGTEXT
,
VLC_TRUE
);
URL_LONGTEXT
,
VLC_TRUE
);
add_string
(
SOUT_CFG_PREFIX
"email"
,
""
,
NULL
,
EMAIL_TEXT
,
add_string
(
SOUT_CFG_PREFIX
"email"
,
""
,
NULL
,
EMAIL_TEXT
,
EMAIL_LONGTEXT
,
VLC_TRUE
);
EMAIL_LONGTEXT
,
VLC_TRUE
);
add_string
(
SOUT_CFG_PREFIX
"phone"
,
""
,
NULL
,
PHONE_TEXT
,
PHONE_LONGTEXT
,
VLC_TRUE
);
add_integer
(
SOUT_CFG_PREFIX
"port"
,
1234
,
NULL
,
PORT_TEXT
,
add_integer
(
SOUT_CFG_PREFIX
"port"
,
1234
,
NULL
,
PORT_TEXT
,
PORT_LONGTEXT
,
VLC_TRUE
);
PORT_LONGTEXT
,
VLC_TRUE
);
...
@@ -170,7 +177,7 @@ vlc_module_end();
...
@@ -170,7 +177,7 @@ vlc_module_end();
*****************************************************************************/
*****************************************************************************/
static
const
char
*
ppsz_sout_options
[]
=
{
static
const
char
*
ppsz_sout_options
[]
=
{
"dst"
,
"name"
,
"port"
,
"port-audio"
,
"port-video"
,
"*sdp"
,
"ttl"
,
"mux"
,
"dst"
,
"name"
,
"port"
,
"port-audio"
,
"port-video"
,
"*sdp"
,
"ttl"
,
"mux"
,
"description"
,
"url"
,
"email"
,
"description"
,
"url"
,
"email"
,
"phone"
,
"dccp"
,
"tcp"
,
"udplite"
,
"dccp"
,
"tcp"
,
"udplite"
,
"mp4a-latm"
,
NULL
"mp4a-latm"
,
NULL
};
};
...
@@ -686,14 +693,11 @@ char *SDPGenerate( const sout_stream_t *p_stream, const char *rtsp_url )
...
@@ -686,14 +693,11 @@ char *SDPGenerate( const sout_stream_t *p_stream, const char *rtsp_url )
dstlen
=
sizeof
(
struct
sockaddr_in
);
dstlen
=
sizeof
(
struct
sockaddr_in
);
}
}
psz_sdp
=
sdp_Start
(
p_sys
->
psz_session_name
,
psz_sdp
=
vlc_sdp_Start
(
VLC_OBJECT
(
p_stream
),
SOUT_CFG_PREFIX
,
p_sys
->
psz_session_description
,
NULL
,
0
,
(
struct
sockaddr
*
)
&
dst
,
dstlen
);
p_sys
->
psz_session_url
,
p_sys
->
psz_session_email
,
NULL
,
NULL
,
0
,
(
struct
sockaddr
*
)
&
dst
,
dstlen
);
if
(
psz_sdp
==
NULL
)
if
(
psz_sdp
==
NULL
)
return
NULL
;
return
NULL
;
/* TODO: a=source-filter */
/* TODO: a=source-filter */
if
(
rtsp_url
!=
NULL
)
if
(
rtsp_url
!=
NULL
)
...
...
src/libvlc.sym
View file @
bc650c59
...
@@ -257,7 +257,7 @@ playlist_ServicesDiscoveryRemove
...
@@ -257,7 +257,7 @@ playlist_ServicesDiscoveryRemove
playlist_TreeMove
playlist_TreeMove
resolve_xml_special_chars
resolve_xml_special_chars
secstotimestr
secstotimestr
sdp_Start
vlc_
sdp_Start
sdp_AddAttribute
sdp_AddAttribute
sdp_AddMedia
sdp_AddMedia
sout_AccessOutDelete
sout_AccessOutDelete
...
...
src/stream_output/sdp.c
View file @
bc650c59
...
@@ -244,3 +244,45 @@ char *sdp_AddMedia (char **sdp,
...
@@ -244,3 +244,45 @@ char *sdp_AddMedia (char **sdp,
return
newsdp
;
return
newsdp
;
}
}
char
*
vlc_sdp_Start
(
vlc_object_t
*
obj
,
const
char
*
cfgpref
,
const
struct
sockaddr
*
src
,
size_t
srclen
,
const
struct
sockaddr
*
addr
,
size_t
addrlen
)
{
size_t
cfglen
=
strlen
(
cfgpref
);
if
(
cfglen
>
100
)
return
NULL
;
char
varname
[
cfglen
+
sizeof
(
"description"
)],
*
subvar
=
varname
+
cfglen
;
strcpy
(
varname
,
cfgpref
);
session_descriptor_t
*
p_session
=
calloc
(
1
,
sizeof
(
*
p_session
));
if
(
p_session
==
NULL
)
return
NULL
;
strcpy
(
subvar
,
"name"
);
char
*
name
=
var_GetNonEmptyString
(
obj
,
varname
);
strcpy
(
subvar
,
"description"
);
char
*
description
=
var_GetNonEmptyString
(
obj
,
varname
);
strcpy
(
subvar
,
"url"
);
char
*
url
=
var_GetNonEmptyString
(
obj
,
varname
);
strcpy
(
subvar
,
"email"
);
char
*
email
=
var_GetNonEmptyString
(
obj
,
varname
);
strcpy
(
subvar
,
"phone"
);
char
*
phone
=
var_GetNonEmptyString
(
obj
,
varname
);
#if 0
strcpy (subvar, "group");
char *group = var_GetNonEmptyString (obj, varname);
#endif
char
*
sdp
=
sdp_Start
(
name
,
description
,
url
,
email
,
phone
,
src
,
srclen
,
addr
,
addrlen
);
free
(
name
);
free
(
description
);
free
(
url
);
free
(
email
);
free
(
phone
);
return
sdp
;
}
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