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
3c0c2a2a
Commit
3c0c2a2a
authored
Apr 24, 2004
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* all: use sout_ParseCfg.
(udp-sout-caching has been renamed sout-udp-caching).
parent
bb236f0e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
32 deletions
+74
-32
modules/access_output/file.c
modules/access_output/file.c
+13
-1
modules/access_output/http.c
modules/access_output/http.c
+29
-3
modules/access_output/udp.c
modules/access_output/udp.c
+32
-28
No files found.
modules/access_output/file.c
View file @
3c0c2a2a
...
@@ -58,11 +58,14 @@
...
@@ -58,11 +58,14 @@
static
int
Open
(
vlc_object_t
*
);
static
int
Open
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
#define SOUT_CFG_PREFIX "sout-file-"
vlc_module_begin
();
vlc_module_begin
();
set_description
(
_
(
"File stream ouput"
)
);
set_description
(
_
(
"File stream ouput"
)
);
set_capability
(
"sout access"
,
50
);
set_capability
(
"sout access"
,
50
);
add_shortcut
(
"file"
);
add_shortcut
(
"file"
);
add_shortcut
(
"stream"
);
add_shortcut
(
"stream"
);
add_bool
(
SOUT_CFG_PREFIX
"append"
,
0
,
NULL
,
"append"
,
""
,
VLC_TRUE
);
set_callbacks
(
Open
,
Close
);
set_callbacks
(
Open
,
Close
);
vlc_module_end
();
vlc_module_end
();
...
@@ -70,6 +73,10 @@ vlc_module_end();
...
@@ -70,6 +73,10 @@ vlc_module_end();
/*****************************************************************************
/*****************************************************************************
* Exported prototypes
* Exported prototypes
*****************************************************************************/
*****************************************************************************/
static
const
char
*
ppsz_sout_options
[]
=
{
"append"
,
NULL
};
static
int
Write
(
sout_access_out_t
*
,
block_t
*
);
static
int
Write
(
sout_access_out_t
*
,
block_t
*
);
static
int
Seek
(
sout_access_out_t
*
,
off_t
);
static
int
Seek
(
sout_access_out_t
*
,
off_t
);
static
int
Read
(
sout_access_out_t
*
,
block_t
*
);
static
int
Read
(
sout_access_out_t
*
,
block_t
*
);
...
@@ -86,6 +93,9 @@ static int Open( vlc_object_t *p_this )
...
@@ -86,6 +93,9 @@ static int Open( vlc_object_t *p_this )
{
{
sout_access_out_t
*
p_access
=
(
sout_access_out_t
*
)
p_this
;
sout_access_out_t
*
p_access
=
(
sout_access_out_t
*
)
p_this
;
int
i_flags
;
int
i_flags
;
vlc_value_t
val
;
sout_ParseCfg
(
p_access
,
SOUT_CFG_PREFIX
,
ppsz_sout_options
,
p_access
->
p_cfg
);
if
(
!
(
p_access
->
p_sys
=
malloc
(
sizeof
(
sout_access_out_sys_t
)
)
)
)
if
(
!
(
p_access
->
p_sys
=
malloc
(
sizeof
(
sout_access_out_sys_t
)
)
)
)
{
{
...
@@ -99,7 +109,9 @@ static int Open( vlc_object_t *p_this )
...
@@ -99,7 +109,9 @@ static int Open( vlc_object_t *p_this )
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
i_flags
=
O_RDWR
|
O_CREAT
;
i_flags
=
O_RDWR
|
O_CREAT
;
if
(
sout_cfg_find_value
(
p_access
->
p_cfg
,
"append"
)
)
var_Get
(
p_access
,
SOUT_CFG_PREFIX
"append"
,
&
val
);
if
(
val
.
b_bool
)
{
{
i_flags
|=
O_APPEND
;
i_flags
|=
O_APPEND
;
}
}
...
...
modules/access_output/http.c
View file @
3c0c2a2a
...
@@ -41,11 +41,15 @@
...
@@ -41,11 +41,15 @@
static
int
Open
(
vlc_object_t
*
);
static
int
Open
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
#define SOUT_CFG_PREFIX "sout-http-"
vlc_module_begin
();
vlc_module_begin
();
set_description
(
_
(
"HTTP stream ouput"
)
);
set_description
(
_
(
"HTTP stream ouput"
)
);
set_capability
(
"sout access"
,
0
);
set_capability
(
"sout access"
,
0
);
add_shortcut
(
"http"
);
add_shortcut
(
"http"
);
add_shortcut
(
"mmsh"
);
add_shortcut
(
"mmsh"
);
add_string
(
SOUT_CFG_PREFIX
"user"
,
""
,
NULL
,
"User"
,
""
,
VLC_TRUE
);
add_string
(
SOUT_CFG_PREFIX
"pwd"
,
""
,
NULL
,
"Password"
,
""
,
VLC_TRUE
);
set_callbacks
(
Open
,
Close
);
set_callbacks
(
Open
,
Close
);
vlc_module_end
();
vlc_module_end
();
...
@@ -53,6 +57,10 @@ vlc_module_end();
...
@@ -53,6 +57,10 @@ vlc_module_end();
/*****************************************************************************
/*****************************************************************************
* Exported prototypes
* Exported prototypes
*****************************************************************************/
*****************************************************************************/
static
const
char
*
ppsz_sout_options
[]
=
{
"user"
,
"pwd"
,
NULL
};
static
int
Write
(
sout_access_out_t
*
,
block_t
*
);
static
int
Write
(
sout_access_out_t
*
,
block_t
*
);
static
int
Seek
(
sout_access_out_t
*
,
off_t
);
static
int
Seek
(
sout_access_out_t
*
,
off_t
);
...
@@ -84,8 +92,10 @@ static int Open( vlc_object_t *p_this )
...
@@ -84,8 +92,10 @@ static int Open( vlc_object_t *p_this )
char
*
psz_bind_addr
;
char
*
psz_bind_addr
;
int
i_bind_port
;
int
i_bind_port
;
char
*
psz_file_name
;
char
*
psz_file_name
;
char
*
psz_user
=
NULL
;
char
*
psz_pwd
=
NULL
;
char
*
psz_mime
=
NULL
;
char
*
psz_mime
=
NULL
;
vlc_value_t
val
;
if
(
!
(
p_sys
=
p_access
->
p_sys
=
if
(
!
(
p_sys
=
p_access
->
p_sys
=
malloc
(
sizeof
(
sout_access_out_sys_t
)
)
)
)
malloc
(
sizeof
(
sout_access_out_sys_t
)
)
)
)
...
@@ -94,6 +104,8 @@ static int Open( vlc_object_t *p_this )
...
@@ -94,6 +104,8 @@ static int Open( vlc_object_t *p_this )
return
(
VLC_EGENERIC
);
return
(
VLC_EGENERIC
);
}
}
sout_ParseCfg
(
p_access
,
SOUT_CFG_PREFIX
,
ppsz_sout_options
,
p_access
->
p_cfg
);
/* p_access->psz_name host.name:port/filename */
/* p_access->psz_name host.name:port/filename */
psz_name
=
psz_parser
=
strdup
(
p_access
->
psz_name
);
psz_name
=
psz_parser
=
strdup
(
p_access
->
psz_name
);
...
@@ -163,10 +175,24 @@ static int Open( vlc_object_t *p_this )
...
@@ -163,10 +175,24 @@ static int Open( vlc_object_t *p_this )
psz_mime
=
"video/x-ms-asf-stream"
;
psz_mime
=
"video/x-ms-asf-stream"
;
}
}
var_Get
(
p_access
,
SOUT_CFG_PREFIX
"user"
,
&
val
);
if
(
val
.
psz_string
&&
*
val
.
psz_string
)
psz_user
=
val
.
psz_string
;
else
if
(
val
.
psz_string
)
free
(
val
.
psz_string
);
var_Get
(
p_access
,
SOUT_CFG_PREFIX
"pwd"
,
&
val
);
if
(
val
.
psz_string
&&
*
val
.
psz_string
)
psz_pwd
=
val
.
psz_string
;
else
if
(
val
.
psz_string
)
free
(
val
.
psz_string
);
p_sys
->
p_httpd_stream
=
p_sys
->
p_httpd_stream
=
httpd_StreamNew
(
p_sys
->
p_httpd_host
,
psz_file_name
,
psz_mime
,
httpd_StreamNew
(
p_sys
->
p_httpd_host
,
psz_file_name
,
psz_mime
,
sout_cfg_find_value
(
p_access
->
p_cfg
,
"user"
),
psz_user
,
psz_pwd
);
sout_cfg_find_value
(
p_access
->
p_cfg
,
"pwd"
)
);
if
(
psz_user
)
free
(
psz_user
);
if
(
psz_pwd
)
free
(
psz_pwd
);
if
(
p_sys
->
p_httpd_stream
==
NULL
)
if
(
p_sys
->
p_httpd_stream
==
NULL
)
{
{
msg_Err
(
p_access
,
"cannot add stream %s"
,
psz_file_name
);
msg_Err
(
p_access
,
"cannot add stream %s"
,
psz_file_name
);
...
...
modules/access_output/udp.c
View file @
3c0c2a2a
...
@@ -58,6 +58,8 @@
...
@@ -58,6 +58,8 @@
static
int
Open
(
vlc_object_t
*
);
static
int
Open
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
#define SOUT_CFG_PREFIX "sout-udp-"
#define CACHING_TEXT N_("Caching value (ms)")
#define CACHING_TEXT N_("Caching value (ms)")
#define CACHING_LONGTEXT N_( \
#define CACHING_LONGTEXT N_( \
"Allows you to modify the default caching value for udp streams. This " \
"Allows you to modify the default caching value for udp streams. This " \
...
@@ -65,8 +67,12 @@ static void Close( vlc_object_t * );
...
@@ -65,8 +67,12 @@ static void Close( vlc_object_t * );
vlc_module_begin
();
vlc_module_begin
();
set_description
(
_
(
"UDP stream ouput"
)
);
set_description
(
_
(
"UDP stream ouput"
)
);
add_integer
(
"udp-sout-caching"
,
DEFAULT_PTS_DELAY
/
1000
,
NULL
,
add_integer
(
SOUT_CFG_PREFIX
"caching"
,
DEFAULT_PTS_DELAY
/
1000
,
NULL
,
CACHING_TEXT
,
CACHING_LONGTEXT
,
VLC_TRUE
);
CACHING_TEXT
,
CACHING_LONGTEXT
,
VLC_TRUE
);
add_integer
(
SOUT_CFG_PREFIX
"ttl"
,
0
,
NULL
,
"ttl"
,
""
,
VLC_TRUE
);
add_integer
(
SOUT_CFG_PREFIX
"group"
,
1
,
NULL
,
"group"
,
""
,
VLC_TRUE
);
add_integer
(
SOUT_CFG_PREFIX
"late"
,
0
,
NULL
,
"late (ms)"
,
""
,
VLC_TRUE
);
add_bool
(
SOUT_CFG_PREFIX
"raw"
,
0
,
NULL
,
"raw"
,
""
,
VLC_TRUE
);
set_capability
(
"sout access"
,
100
);
set_capability
(
"sout access"
,
100
);
add_shortcut
(
"udp"
);
add_shortcut
(
"udp"
);
add_shortcut
(
"rtp"
);
// Will work only with ts muxer
add_shortcut
(
"rtp"
);
// Will work only with ts muxer
...
@@ -76,6 +82,16 @@ vlc_module_end();
...
@@ -76,6 +82,16 @@ vlc_module_end();
/*****************************************************************************
/*****************************************************************************
* Exported prototypes
* Exported prototypes
*****************************************************************************/
*****************************************************************************/
static
const
char
*
ppsz_sout_options
[]
=
{
"caching"
,
"ttl"
,
"group"
,
"late"
,
"raw"
,
NULL
};
static
int
Write
(
sout_access_out_t
*
,
block_t
*
);
static
int
Write
(
sout_access_out_t
*
,
block_t
*
);
static
int
WriteRaw
(
sout_access_out_t
*
,
block_t
*
);
static
int
WriteRaw
(
sout_access_out_t
*
,
block_t
*
);
static
int
Seek
(
sout_access_out_t
*
,
off_t
);
static
int
Seek
(
sout_access_out_t
*
,
off_t
);
...
@@ -133,7 +149,8 @@ static int Open( vlc_object_t *p_this )
...
@@ -133,7 +149,8 @@ static int Open( vlc_object_t *p_this )
network_socket_t
socket_desc
;
network_socket_t
socket_desc
;
vlc_value_t
val
;
vlc_value_t
val
;
char
*
psz_val
;
sout_ParseCfg
(
p_access
,
SOUT_CFG_PREFIX
,
ppsz_sout_options
,
p_access
->
p_cfg
);
if
(
!
(
p_sys
=
p_access
->
p_sys
=
if
(
!
(
p_sys
=
p_access
->
p_sys
=
malloc
(
sizeof
(
sout_access_out_sys_t
)
)
)
)
malloc
(
sizeof
(
sout_access_out_sys_t
)
)
)
)
...
@@ -200,11 +217,10 @@ static int Open( vlc_object_t *p_this )
...
@@ -200,11 +217,10 @@ static int Open( vlc_object_t *p_this )
socket_desc
.
i_server_port
=
i_dst_port
;
socket_desc
.
i_server_port
=
i_dst_port
;
socket_desc
.
psz_bind_addr
=
""
;
socket_desc
.
psz_bind_addr
=
""
;
socket_desc
.
i_bind_port
=
0
;
socket_desc
.
i_bind_port
=
0
;
socket_desc
.
i_ttl
=
0
;
if
(
(
psz_val
=
sout_cfg_find_value
(
p_access
->
p_cfg
,
"ttl"
)
)
)
var_Get
(
p_access
,
SOUT_CFG_PREFIX
"ttl"
,
&
val
);
{
socket_desc
.
i_ttl
=
val
.
i_int
;
socket_desc
.
i_ttl
=
atoi
(
psz_val
);
}
p_sys
->
p_thread
->
p_private
=
(
void
*
)
&
socket_desc
;
p_sys
->
p_thread
->
p_private
=
(
void
*
)
&
socket_desc
;
if
(
!
(
p_network
=
module_Need
(
p_sys
->
p_thread
,
"network"
,
NULL
,
0
)
)
)
if
(
!
(
p_network
=
module_Need
(
p_sys
->
p_thread
,
"network"
,
NULL
,
0
)
)
)
{
{
...
@@ -215,27 +231,14 @@ static int Open( vlc_object_t *p_this )
...
@@ -215,27 +231,14 @@ static int Open( vlc_object_t *p_this )
p_sys
->
p_thread
->
i_handle
=
socket_desc
.
i_handle
;
p_sys
->
p_thread
->
i_handle
=
socket_desc
.
i_handle
;
var_Create
(
p_this
,
"udp-sout-caching"
,
var_Get
(
p_access
,
SOUT_CFG_PREFIX
"caching"
,
&
val
);
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
p_sys
->
p_thread
->
i_caching
=
(
int64_t
)
val
.
i_int
*
1000
;
var_Get
(
p_this
,
"udp-sout-caching"
,
&
val
);
p_sys
->
p_thread
->
i_caching
=
val
.
i_int
*
1000
;
if
(
(
psz_val
=
sout_cfg_find_value
(
p_access
->
p_cfg
,
"caching"
)
)
)
{
p_sys
->
p_thread
->
i_caching
=
atoll
(
psz_val
)
*
1000
;
}
p_sys
->
p_thread
->
i_group
=
1
;
if
(
(
psz_val
=
sout_cfg_find_value
(
p_access
->
p_cfg
,
"group"
)
)
)
{
p_sys
->
p_thread
->
i_group
=
atoi
(
psz_val
);
}
p_sys
->
p_thread
->
i_late
=
0
;
var_Get
(
p_access
,
SOUT_CFG_PREFIX
"group"
,
&
val
);
if
(
(
psz_val
=
sout_cfg_find_value
(
p_access
->
p_cfg
,
"late"
)
)
)
p_sys
->
p_thread
->
i_group
=
val
.
i_int
;
{
p_sys
->
p_thread
->
i_late
=
atoll
(
psz_val
)
*
1000
;
}
var_Get
(
p_access
,
SOUT_CFG_PREFIX
"late"
,
&
val
);
p_sys
->
p_thread
->
i_late
=
(
int64_t
)
val
.
i_int
*
1000
;
p_sys
->
i_mtu
=
socket_desc
.
i_mtu
;
p_sys
->
i_mtu
=
socket_desc
.
i_mtu
;
...
@@ -257,7 +260,8 @@ static int Open( vlc_object_t *p_this )
...
@@ -257,7 +260,8 @@ static int Open( vlc_object_t *p_this )
p_sys
->
i_sequence_number
=
rand
()
&
0xffff
;
p_sys
->
i_sequence_number
=
rand
()
&
0xffff
;
p_sys
->
i_ssrc
=
rand
()
&
0xffffffff
;
p_sys
->
i_ssrc
=
rand
()
&
0xffffffff
;
if
(
sout_cfg_find
(
p_access
->
p_cfg
,
"raw"
)
)
var_Get
(
p_access
,
SOUT_CFG_PREFIX
"raw"
,
&
val
);
if
(
val
.
b_bool
)
{
{
p_access
->
pf_write
=
WriteRaw
;
p_access
->
pf_write
=
WriteRaw
;
}
}
...
...
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