Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
d2121795
Commit
d2121795
authored
Sep 15, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove dead code
parent
974be97b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
106 deletions
+5
-106
src/stream_output/announce.c
src/stream_output/announce.c
+2
-38
src/stream_output/sap.c
src/stream_output/sap.c
+3
-59
src/stream_output/stream_output.h
src/stream_output/stream_output.h
+0
-9
No files found.
src/stream_output/announce.c
View file @
d2121795
...
@@ -54,32 +54,7 @@ struct announce_method_t
...
@@ -54,32 +54,7 @@ struct announce_method_t
static
session_descriptor_t
*
sout_AnnounceSessionCreate
(
vlc_object_t
*
obj
,
static
session_descriptor_t
*
sout_AnnounceSessionCreate
(
vlc_object_t
*
obj
,
const
char
*
cfgpref
)
const
char
*
cfgpref
)
{
{
size_t
cfglen
=
strlen
(
cfgpref
);
return
calloc
(
1
,
sizeof
(
session_descriptor_t
));
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"
);
p_session
->
psz_name
=
var_GetNonEmptyString
(
obj
,
varname
);
strcpy
(
subvar
,
"group"
);
p_session
->
psz_group
=
var_GetNonEmptyString
(
obj
,
varname
);
strcpy
(
subvar
,
"description"
);
p_session
->
description
=
var_GetNonEmptyString
(
obj
,
varname
);
strcpy
(
subvar
,
"url"
);
p_session
->
url
=
var_GetNonEmptyString
(
obj
,
varname
);
strcpy
(
subvar
,
"email"
);
p_session
->
email
=
var_GetNonEmptyString
(
obj
,
varname
);
strcpy
(
subvar
,
"phone"
);
p_session
->
phone
=
var_GetNonEmptyString
(
obj
,
varname
);
return
p_session
;
}
}
/**
/**
...
@@ -167,18 +142,7 @@ int sout_AnnounceUnRegister( sout_instance_t *p_sout,
...
@@ -167,18 +142,7 @@ int sout_AnnounceUnRegister( sout_instance_t *p_sout,
*/
*/
void
sout_AnnounceSessionDestroy
(
session_descriptor_t
*
p_session
)
void
sout_AnnounceSessionDestroy
(
session_descriptor_t
*
p_session
)
{
{
if
(
p_session
)
{
free
(
p_session
->
psz_name
);
free
(
p_session
->
psz_group
);
free
(
p_session
->
psz_sdp
);
free
(
p_session
->
description
);
free
(
p_session
->
sdpformat
);
free
(
p_session
->
url
);
free
(
p_session
->
email
);
free
(
p_session
->
phone
);
free
(
p_session
);
free
(
p_session
);
}
}
}
/**
/**
...
...
src/stream_output/sap.c
View file @
d2121795
...
@@ -90,9 +90,6 @@ struct sap_session_t {
...
@@ -90,9 +90,6 @@ struct sap_session_t {
*****************************************************************************/
*****************************************************************************/
static
void
RunThread
(
vlc_object_t
*
p_this
);
static
void
RunThread
(
vlc_object_t
*
p_this
);
static
int
ComputeRate
(
sap_address_t
*
p_address
);
static
int
ComputeRate
(
sap_address_t
*
p_address
);
static
char
*
SDPGenerate
(
sap_handler_t
*
p_sap
,
const
session_descriptor_t
*
p_session
,
vlc_bool_t
b_ssm
);
static
int
announce_SendSAPAnnounce
(
sap_handler_t
*
p_sap
,
static
int
announce_SendSAPAnnounce
(
sap_handler_t
*
p_sap
,
sap_session_t
*
p_session
);
sap_session_t
*
p_session
);
...
@@ -419,7 +416,6 @@ static int announce_SAPAnnounceAdd( sap_handler_t *p_sap,
...
@@ -419,7 +416,6 @@ static int announce_SAPAnnounceAdd( sap_handler_t *p_sap,
p_sap_session
->
p_address
=
p_address
;
p_sap_session
->
p_address
=
p_address
;
}
}
if
(
p_session
->
origlen
==
0
)
memcpy
(
&
p_session
->
orig
,
&
p_sap_session
->
p_address
->
orig
,
memcpy
(
&
p_session
->
orig
,
&
p_sap_session
->
p_address
->
orig
,
p_session
->
origlen
=
p_sap_session
->
p_address
->
origlen
);
p_session
->
origlen
=
p_sap_session
->
p_address
->
origlen
);
...
@@ -442,15 +438,7 @@ static int announce_SAPAnnounceAdd( sap_handler_t *p_sap,
...
@@ -442,15 +438,7 @@ static int announce_SAPAnnounceAdd( sap_handler_t *p_sap,
}
}
/* If needed, build the SDP */
/* If needed, build the SDP */
if
(
p_session
->
psz_sdp
==
NULL
)
assert
(
p_session
->
psz_sdp
!=
NULL
);
{
p_session
->
psz_sdp
=
SDPGenerate
(
p_sap
,
p_session
,
b_ssm
);
if
(
p_session
->
psz_sdp
==
NULL
)
{
vlc_mutex_unlock
(
&
p_sap
->
object_lock
);
return
VLC_ENOMEM
;
}
}
p_sap_session
->
i_last
=
0
;
p_sap_session
->
i_last
=
0
;
p_sap_session
->
i_length
=
headsize
+
strlen
(
p_session
->
psz_sdp
);
p_sap_session
->
i_length
=
headsize
+
strlen
(
p_session
->
psz_sdp
);
...
@@ -587,50 +575,6 @@ static int announce_SendSAPAnnounce( sap_handler_t *p_sap,
...
@@ -587,50 +575,6 @@ static int announce_SendSAPAnnounce( sap_handler_t *p_sap,
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
static
char
*
SDPGenerate
(
sap_handler_t
*
p_sap
,
const
session_descriptor_t
*
p_session
,
vlc_bool_t
b_ssm
)
{
char
*
psz_group
,
*
psz_name
,
*
psz_sdp
;
char
*
head
=
sdp_Start
(
p_session
->
psz_name
,
p_session
->
description
,
p_session
->
url
,
p_session
->
email
,
p_session
->
phone
,
(
const
struct
sockaddr
*
)
&
p_session
->
orig
,
p_session
->
origlen
,
(
const
struct
sockaddr
*
)
&
p_session
->
addr
,
p_session
->
addrlen
);
if
(
head
==
NULL
)
return
NULL
;
psz_group
=
p_session
->
psz_group
;
psz_name
=
p_session
->
psz_name
;
char
*
plgroup
;
if
((
psz_group
==
NULL
)
||
(
asprintf
(
&
plgroup
,
"a=x-plgroup:%s
\r\n
"
,
psz_group
)
==
-
1
))
plgroup
=
NULL
;
const
char
*
comedia
=
NULL
;
if
(
!
strncasecmp
(
p_session
->
sdpformat
,
"DCCP"
,
4
)
||
!
strncasecmp
(
p_session
->
sdpformat
,
"TCP"
,
3
))
comedia
=
"a=setup:passive
\r\n
"
"a=connection:new
\r\n
"
;
int
res
=
asprintf
(
&
psz_sdp
,
"%s"
"%s"
"%s"
"m=video %d %s
\r\n
"
,
head
,
plgroup
?:
""
,
comedia
?:
""
,
ntohs
(
net_GetPort
((
const
struct
sockaddr
*
)
&
p_session
->
addr
)),
p_session
->
sdpformat
);
free
(
plgroup
);
if
(
res
==
-
1
)
return
NULL
;
msg_Dbg
(
p_sap
,
"Generated SDP (%u bytes):
\n
%s"
,
(
unsigned
)
strlen
(
psz_sdp
),
psz_sdp
);
return
psz_sdp
;
}
static
int
ComputeRate
(
sap_address_t
*
p_address
)
static
int
ComputeRate
(
sap_address_t
*
p_address
)
{
{
uint8_t
buffer
[
SAP_MAX_BUFFER
];
uint8_t
buffer
[
SAP_MAX_BUFFER
];
...
...
src/stream_output/stream_output.h
View file @
d2121795
...
@@ -75,20 +75,11 @@ struct sap_handler_t
...
@@ -75,20 +75,11 @@ struct sap_handler_t
struct
session_descriptor_t
struct
session_descriptor_t
{
{
char
*
psz_name
;
char
*
psz_group
;
char
*
description
;
char
*
url
;
// meta URL for SAP, potentially real URL for other cases
char
*
email
;
char
*
phone
;
struct
sockaddr_storage
orig
;
struct
sockaddr_storage
orig
;
socklen_t
origlen
;
socklen_t
origlen
;
struct
sockaddr_storage
addr
;
struct
sockaddr_storage
addr
;
socklen_t
addrlen
;
socklen_t
addrlen
;
char
*
sdpformat
;
// format suitable for SDP
char
*
psz_sdp
;
char
*
psz_sdp
;
vlc_bool_t
b_ssm
;
vlc_bool_t
b_ssm
;
};
};
...
...
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