Commit 758377a2 authored by Samuel Pitoiset's avatar Samuel Pitoiset Committed by Martin Storsjö

rtmp: Add a new option 'rtmp_pageurl'

This option specifies the URL of the web page in which the media
was embedded.
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent 98df48db
...@@ -229,6 +229,10 @@ playpath. If a live stream of that name is not found, it plays the ...@@ -229,6 +229,10 @@ playpath. If a live stream of that name is not found, it plays the
recorded stream. The other possible values are @code{live} and recorded stream. The other possible values are @code{live} and
@code{recorded}. @code{recorded}.
@item rtmp_pageurl
URL of the web page in which the media was embedded. By default no
value will be sent.
@item rtmp_playpath @item rtmp_playpath
Stream identifier to play or to publish. This option overrides the Stream identifier to play or to publish. This option overrides the
parameter specified in the URI. parameter specified in the URI.
......
...@@ -90,6 +90,7 @@ typedef struct RTMPContext { ...@@ -90,6 +90,7 @@ typedef struct RTMPContext {
char* tcurl; ///< url of the target stream char* tcurl; ///< url of the target stream
char* flashver; ///< version of the flash plugin char* flashver; ///< version of the flash plugin
char* swfurl; ///< url of the swf player char* swfurl; ///< url of the swf player
char* pageurl; ///< url of the web page
int server_bw; ///< server bandwidth int server_bw; ///< server bandwidth
int client_buffer_time; ///< client buffer time in ms int client_buffer_time; ///< client buffer time in ms
int flush_interval; ///< number of packets flushed in the same request (RTMPT only) int flush_interval; ///< number of packets flushed in the same request (RTMPT only)
...@@ -232,6 +233,11 @@ static int gen_connect(URLContext *s, RTMPContext *rt) ...@@ -232,6 +233,11 @@ static int gen_connect(URLContext *s, RTMPContext *rt)
ff_amf_write_number(&p, 252.0); ff_amf_write_number(&p, 252.0);
ff_amf_write_field_name(&p, "videoFunction"); ff_amf_write_field_name(&p, "videoFunction");
ff_amf_write_number(&p, 1.0); ff_amf_write_number(&p, 1.0);
if (rt->pageurl) {
ff_amf_write_field_name(&p, "pageUrl");
ff_amf_write_string(&p, rt->pageurl);
}
} }
ff_amf_write_object_end(&p); ff_amf_write_object_end(&p);
...@@ -1498,6 +1504,7 @@ static const AVOption rtmp_options[] = { ...@@ -1498,6 +1504,7 @@ static const AVOption rtmp_options[] = {
{"any", "both", 0, AV_OPT_TYPE_CONST, {-2}, 0, 0, DEC, "rtmp_live"}, {"any", "both", 0, AV_OPT_TYPE_CONST, {-2}, 0, 0, DEC, "rtmp_live"},
{"live", "live stream", 0, AV_OPT_TYPE_CONST, {-1}, 0, 0, DEC, "rtmp_live"}, {"live", "live stream", 0, AV_OPT_TYPE_CONST, {-1}, 0, 0, DEC, "rtmp_live"},
{"recorded", "recorded stream", 0, AV_OPT_TYPE_CONST, {0}, 0, 0, DEC, "rtmp_live"}, {"recorded", "recorded stream", 0, AV_OPT_TYPE_CONST, {0}, 0, 0, DEC, "rtmp_live"},
{"rtmp_pageurl", "URL of the web page in which the media was embedded. By default no value will be sent.", OFFSET(pageurl), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC},
{"rtmp_playpath", "Stream identifier to play or to publish", OFFSET(playpath), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC}, {"rtmp_playpath", "Stream identifier to play or to publish", OFFSET(playpath), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
{"rtmp_swfurl", "URL of the SWF player. By default no value will be sent", OFFSET(swfurl), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC}, {"rtmp_swfurl", "URL of the SWF player. By default no value will be sent", OFFSET(swfurl), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
{"rtmp_tcurl", "URL of the target stream. Defaults to proto://host[:port]/app.", OFFSET(tcurl), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC}, {"rtmp_tcurl", "URL of the target stream. Defaults to proto://host[:port]/app.", OFFSET(tcurl), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment