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
f78545dd
Commit
f78545dd
authored
Jul 08, 2009
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtmp: add an option to let the user set swfUrl and pageUrl.
parent
af0ba144
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
6 deletions
+30
-6
modules/access/rtmp/access.c
modules/access/rtmp/access.c
+21
-0
modules/access/rtmp/rtmp_amf_flv.c
modules/access/rtmp/rtmp_amf_flv.c
+4
-4
modules/access/rtmp/rtmp_amf_flv.h
modules/access/rtmp/rtmp_amf_flv.h
+5
-2
No files found.
modules/access/rtmp/access.c
View file @
f78545dd
...
@@ -45,6 +45,16 @@
...
@@ -45,6 +45,16 @@
"Caching value for RTMP streams. This " \
"Caching value for RTMP streams. This " \
"value should be set in milliseconds." )
"value should be set in milliseconds." )
#define SWFURL_TEXT N_("Default SWF Referrer URL")
#define SWFURL_LONGTEXT N_("The SFW URL to use as referrer when connecting to"\
"the server. This is the SWF file that contained" \
"the stream.")
#define PAGEURL_TEXT N_("Page Referrer URL")
#define PAGEURL_LONGTEXT N_("Page URL to use as referrer when connecting to" \
"the server. This is the page housing the SWF" \
"file.")
static
int
Open
(
vlc_object_t
*
);
static
int
Open
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
static
void
Close
(
vlc_object_t
*
);
...
@@ -56,6 +66,10 @@ vlc_module_begin ()
...
@@ -56,6 +66,10 @@ vlc_module_begin ()
add_integer
(
"rtmp-caching"
,
DEFAULT_PTS_DELAY
/
1000
,
NULL
,
CACHING_TEXT
,
add_integer
(
"rtmp-caching"
,
DEFAULT_PTS_DELAY
/
1000
,
NULL
,
CACHING_TEXT
,
CACHING_LONGTEXT
,
true
)
CACHING_LONGTEXT
,
true
)
add_string
(
"rtmp-swfurl"
,
"file:///mac.flv"
,
NULL
,
SWFURL_TEXT
,
SWFURL_LONGTEXT
,
true
)
add_string
(
"rtmp-pageurl"
,
"file:///mac.html"
,
NULL
,
PAGEURL_TEXT
,
PAGEURL_LONGTEXT
,
true
)
set_capability
(
"access"
,
0
)
set_capability
(
"access"
,
0
)
set_callbacks
(
Open
,
Close
)
set_callbacks
(
Open
,
Close
)
...
@@ -123,6 +137,9 @@ static int Open( vlc_object_t *p_this )
...
@@ -123,6 +137,9 @@ static int Open( vlc_object_t *p_this )
p_sys
->
p_thread
->
psz_application
=
strndup
(
p_sys
->
p_thread
->
url
.
psz_path
+
1
,
length_path
-
length_media_name
-
2
);
p_sys
->
p_thread
->
psz_application
=
strndup
(
p_sys
->
p_thread
->
url
.
psz_path
+
1
,
length_path
-
length_media_name
-
2
);
p_sys
->
p_thread
->
psz_media
=
strdup
(
p_sys
->
p_thread
->
url
.
psz_path
+
(
length_path
-
length_media_name
)
);
p_sys
->
p_thread
->
psz_media
=
strdup
(
p_sys
->
p_thread
->
url
.
psz_path
+
(
length_path
-
length_media_name
)
);
p_sys
->
p_thread
->
psz_swf_url
=
var_CreateGetString
(
p_access
,
"rtmp-swfurl"
);
p_sys
->
p_thread
->
psz_page_url
=
var_CreateGetString
(
p_access
,
"rtmp-pageurl"
);
msg_Dbg
(
p_access
,
"rtmp: host='%s' port=%d path='%s'"
,
msg_Dbg
(
p_access
,
"rtmp: host='%s' port=%d path='%s'"
,
p_sys
->
p_thread
->
url
.
psz_host
,
p_sys
->
p_thread
->
url
.
i_port
,
p_sys
->
p_thread
->
url
.
psz_path
);
p_sys
->
p_thread
->
url
.
psz_host
,
p_sys
->
p_thread
->
url
.
i_port
,
p_sys
->
p_thread
->
url
.
psz_path
);
...
@@ -248,6 +265,8 @@ error2:
...
@@ -248,6 +265,8 @@ error2:
free
(
p_sys
->
p_thread
->
psz_application
);
free
(
p_sys
->
p_thread
->
psz_application
);
free
(
p_sys
->
p_thread
->
psz_media
);
free
(
p_sys
->
p_thread
->
psz_media
);
free
(
p_sys
->
p_thread
->
psz_swf_url
);
free
(
p_sys
->
p_thread
->
psz_page_url
);
net_Close
(
p_sys
->
p_thread
->
fd
);
net_Close
(
p_sys
->
p_thread
->
fd
);
error:
error:
...
@@ -298,6 +317,8 @@ static void Close( vlc_object_t * p_this )
...
@@ -298,6 +317,8 @@ static void Close( vlc_object_t * p_this )
vlc_UrlClean
(
&
p_sys
->
p_thread
->
url
);
vlc_UrlClean
(
&
p_sys
->
p_thread
->
url
);
free
(
p_sys
->
p_thread
->
psz_application
);
free
(
p_sys
->
p_thread
->
psz_application
);
free
(
p_sys
->
p_thread
->
psz_media
);
free
(
p_sys
->
p_thread
->
psz_media
);
free
(
p_sys
->
p_thread
->
psz_swf_url
);
free
(
p_sys
->
p_thread
->
psz_page_url
);
vlc_object_detach
(
p_sys
->
p_thread
);
vlc_object_detach
(
p_sys
->
p_thread
);
vlc_object_release
(
p_sys
->
p_thread
);
vlc_object_release
(
p_sys
->
p_thread
);
...
...
modules/access/rtmp/rtmp_amf_flv.c
View file @
f78545dd
...
@@ -430,10 +430,10 @@ rtmp_connect_active( rtmp_control_thread_t *p_thread )
...
@@ -430,10 +430,10 @@ rtmp_connect_active( rtmp_control_thread_t *p_thread )
free
(
tmp_buffer
);
free
(
tmp_buffer
);
tmp_buffer
=
amf_encode_object_variable
(
"swfUrl"
,
tmp_buffer
=
amf_encode_object_variable
(
"swfUrl"
,
AMF_DATATYPE_STRING
,
"file:///mac.flv"
);
AMF_DATATYPE_STRING
,
p_thread
->
psz_swf_url
);
rtmp_body_append
(
rtmp_body
,
tmp_buffer
,
rtmp_body_append
(
rtmp_body
,
tmp_buffer
,
AMF_DATATYPE_SIZE_OBJECT_VARIABLE
+
strlen
(
"swfUrl"
)
+
AMF_DATATYPE_SIZE_OBJECT_VARIABLE
+
strlen
(
"swfUrl"
)
+
AMF_DATATYPE_SIZE_STRING
+
strlen
(
"file:///mac.flv"
)
);
AMF_DATATYPE_SIZE_STRING
+
strlen
(
p_thread
->
psz_swf_url
)
);
free
(
tmp_buffer
);
free
(
tmp_buffer
);
if
(
asprintf
(
&
tmp_url
,
"rtmp://%s"
,
p_thread
->
url
.
psz_buffer
)
==
-
1
)
if
(
asprintf
(
&
tmp_url
,
"rtmp://%s"
,
p_thread
->
url
.
psz_buffer
)
==
-
1
)
...
@@ -479,10 +479,10 @@ rtmp_connect_active( rtmp_control_thread_t *p_thread )
...
@@ -479,10 +479,10 @@ rtmp_connect_active( rtmp_control_thread_t *p_thread )
free
(
tmp_buffer
);
free
(
tmp_buffer
);
tmp_buffer
=
amf_encode_object_variable
(
"pageUrl"
,
tmp_buffer
=
amf_encode_object_variable
(
"pageUrl"
,
AMF_DATATYPE_STRING
,
"file:///mac.html"
);
AMF_DATATYPE_STRING
,
p_thread
->
psz_page_url
);
rtmp_body_append
(
rtmp_body
,
tmp_buffer
,
rtmp_body_append
(
rtmp_body
,
tmp_buffer
,
AMF_DATATYPE_SIZE_OBJECT_VARIABLE
+
strlen
(
"pageUrl"
)
+
AMF_DATATYPE_SIZE_OBJECT_VARIABLE
+
strlen
(
"pageUrl"
)
+
AMF_DATATYPE_SIZE_STRING
+
strlen
(
"file:///mac.html"
)
);
AMF_DATATYPE_SIZE_STRING
+
strlen
(
p_thread
->
psz_page_url
)
);
free
(
tmp_buffer
);
free
(
tmp_buffer
);
tmp_buffer
=
amf_encode_object_variable
(
"objectEncoding"
,
tmp_buffer
=
amf_encode_object_variable
(
"objectEncoding"
,
...
...
modules/access/rtmp/rtmp_amf_flv.h
View file @
f78545dd
...
@@ -58,6 +58,9 @@ struct rtmp_control_thread_t
...
@@ -58,6 +58,9 @@ struct rtmp_control_thread_t
char
*
psz_application
;
char
*
psz_application
;
char
*
psz_media
;
char
*
psz_media
;
char
*
psz_swf_url
;
char
*
psz_page_url
;
block_fifo_t
*
p_fifo_input
;
block_fifo_t
*
p_fifo_input
;
block_fifo_t
*
p_empty_blocks
;
block_fifo_t
*
p_empty_blocks
;
...
...
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