<!DOCTYPE html><html><head><title></title><style type="text/css">p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div>Sorry the for delay, I just merged your patch.<br></div><div><br></div><div>Best,<br></div><div>Thomas<br></div><div><br></div><div>On Tue, Nov 3, 2020, at 21:31, Ÿnérant wrote:<br></div><blockquote type="cite" id="qt" style=""><div dir="ltr"><div>Any news? Maybe I didn't comment on my patch:<br></div><div>This patch allows the use of the streamid option when using the SRT protocol.<br></div><div>For example, we can query the URL srt://localhost:9710?streamid=demo<br></div><div>if a stream server is listening on localhost:9710 that supports multiple streams<br></div><div>on the same server. Like the others already implemented, this parameter can<br></div><div>be overwritten in the settings of the transport.<br></div><div><br></div><div>In a future patch, it may be good to support the full options.<br></div><div>The complete list can be found here:<br></div><div><a href="https://github.com/Haivision/srt/blob/master/docs/APISocketOptions.md#list-of-options">https://github.com/Haivision/srt/blob/master/docs/APISocketOptions.md#list-of-options</a><br></div><div>A human-friendly version of this list can be found in the ffmpeg documentation:<br></div><div><a href="https://ffmpeg.org/ffmpeg-all.html#srt">https://ffmpeg.org/ffmpeg-all.html#srt</a><br></div></div><div><br></div><div class="qt-gmail_quote"><div dir="ltr" class="qt-gmail_attr">Le mer. 28 oct. 2020 à 14:36, Yohann D'ANELLO <<a href="mailto:ynerant@crans.org">ynerant@crans.org</a>> a écrit :<br></div><blockquote class="qt-gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-color:rgb(204, 204, 204);border-left-style:solid;border-left-width:1px;padding-left:1ex;"><div>From: Yohann D'ANELLO <<a href="mailto:yohann.danello@gmail.com" target="_blank">yohann.danello@gmail.com</a>><br></div><div> <br></div><div> Signed-off-by: Yohann D'ANELLO <<a href="mailto:yohann.danello@gmail.com" target="_blank">yohann.danello@gmail.com</a>><br></div><div> ---<br></div><div> modules/access/srt.c | 18 ++++++++++++++++++<br></div><div> modules/access/srt_common.c | 4 ++++<br></div><div> modules/access/srt_common.h | 2 ++<br></div><div> modules/access_output/srt.c | 18 ++++++++++++++++++<br></div><div> 4 files changed, 42 insertions(+)<br></div><div> <br></div><div> diff --git a/modules/access/srt.c b/modules/access/srt.c<br></div><div> index d7ef51fccf..ae8ba2a84f 100644<br></div><div> --- a/modules/access/srt.c<br></div><div> +++ b/modules/access/srt.c<br></div><div> @@ -97,6 +97,8 @@ static bool srt_schedule_reconnect(stream_t *p_stream)<br></div><div> int stat;<br></div><div> char *psz_passphrase = var_InheritString( p_stream, SRT_PARAM_PASSPHRASE );<br></div><div> bool passphrase_needs_free = true;<br></div><div> + char *psz_streamid = var_InheritString( p_stream, SRT_PARAM_STREAMID );<br></div><div> + bool streamid_needs_free = true;<br></div><div> char *url = NULL;<br></div><div> srt_params_t params;<br></div><div> struct addrinfo hints = {<br></div><div> @@ -145,6 +147,11 @@ static bool srt_schedule_reconnect(stream_t *p_stream)<br></div><div> passphrase_needs_free = false;<br></div><div> psz_passphrase = (char *) params.passphrase;<br></div><div> }<br></div><div> + if (params.streamid != NULL ) {<br></div><div> + free( psz_streamid );<br></div><div> + streamid_needs_free = false;<br></div><div> + psz_streamid = (char *) params.streamid;<br></div><div> + }<br></div><div> }<br></div><div> }<br></div><div> <br></div><div> @@ -177,6 +184,12 @@ static bool srt_schedule_reconnect(stream_t *p_stream)<br></div><div> SRTO_PASSPHRASE, psz_passphrase, strlen(psz_passphrase) );<br></div><div> }<br></div><div> <br></div><div> + /* set stream id */<br></div><div> + if (psz_streamid != NULL && psz_streamid[0] != '\0') {<br></div><div> + srt_set_socket_option( strm_obj, SRT_PARAM_STREAMID, p_sys->sock,<br></div><div> + SRTO_STREAMID, psz_streamid, strlen(psz_streamid) );<br></div><div> + }<br></div><div> +<br></div><div> /* set maximum payload size */<br></div><div> srt_set_socket_option( strm_obj, SRT_PARAM_PAYLOAD_SIZE, p_sys->sock,<br></div><div> SRTO_PAYLOADSIZE, &i_payload_size, sizeof(i_payload_size) );<br></div><div> @@ -211,6 +224,8 @@ out:<br></div><div> <br></div><div> if (passphrase_needs_free)<br></div><div> free( psz_passphrase );<br></div><div> + if (streamid_needs_free)<br></div><div> + free( psz_streamid );<br></div><div> freeaddrinfo( res );<br></div><div> free( url );<br></div><div> <br></div><div> @@ -429,6 +444,9 @@ vlc_module_begin ()<br></div><div> add_integer( SRT_PARAM_KEY_LENGTH, SRT_DEFAULT_KEY_LENGTH,<br></div><div> SRT_KEY_LENGTH_TEXT, SRT_KEY_LENGTH_TEXT, false )<br></div><div> change_integer_list( srt_key_lengths, srt_key_length_names )<br></div><div> + add_string(SRT_PARAM_STREAMID, "",<br></div><div> + N_(" SRT Stream ID"), NULL, false)<br></div><div> + change_safe()<br></div><div> <br></div><div> set_capability("access", 0)<br></div><div> add_shortcut("srt")<br></div><div> diff --git a/modules/access/srt_common.c b/modules/access/srt_common.c<br></div><div> index be6a9732cb..c1b6dc3751 100644<br></div><div> --- a/modules/access/srt_common.c<br></div><div> +++ b/modules/access/srt_common.c<br></div><div> @@ -107,6 +107,7 @@ bool srt_parse_url(char* url, srt_params_t* params)<br></div><div> params->key_length = -1;<br></div><div> params->payload_size = -1;<br></div><div> params->bandwidth_overhead_limit = -1;<br></div><div> + params->streamid = NULL;<br></div><div> <br></div><div> /* Parse URL parameters */<br></div><div> query = find( url, '?' );<br></div><div> @@ -127,6 +128,9 @@ bool srt_parse_url(char* url, srt_params_t* params)<br></div><div> } else if (strcmp( local_params[i].key, SRT_PARAM_PASSPHRASE )<br></div><div> == 0) {<br></div><div> params->passphrase = val;<br></div><div> + } else if (strcmp( local_params[i].key, SRT_PARAM_STREAMID )<br></div><div> + == 0) {<br></div><div> + params->streamid = val;<br></div><div> } else if (strcmp( local_params[i].key, SRT_PARAM_PAYLOAD_SIZE )<br></div><div> == 0) {<br></div><div> int temp = atoi( val );<br></div><div> diff --git a/modules/access/srt_common.h b/modules/access/srt_common.h<br></div><div> index c2322d5755..5f2a11a242 100644<br></div><div> --- a/modules/access/srt_common.h<br></div><div> +++ b/modules/access/srt_common.h<br></div><div> @@ -39,6 +39,7 @@<br></div><div> #define SRT_PARAM_CHUNK_SIZE "chunk-size"<br></div><div> #define SRT_PARAM_POLL_TIMEOUT "poll-timeout"<br></div><div> #define SRT_PARAM_KEY_LENGTH "key-length"<br></div><div> +#define SRT_PARAM_STREAMID "streamid"<br></div><div> <br></div><div> <br></div><div> #define SRT_DEFAULT_BANDWIDTH_OVERHEAD_LIMIT 25<br></div><div> @@ -68,6 +69,7 @@ typedef struct srt_params {<br></div><div> int key_length;<br></div><div> int payload_size;<br></div><div> int bandwidth_overhead_limit;<br></div><div> + const char* streamid;<br></div><div> } srt_params_t;<br></div><div> <br></div><div> bool srt_parse_url(char* url, srt_params_t* params);<br></div><div> diff --git a/modules/access_output/srt.c b/modules/access_output/srt.c<br></div><div> index 3d579eb1bd..afd11dc484 100644<br></div><div> --- a/modules/access_output/srt.c<br></div><div> +++ b/modules/access_output/srt.c<br></div><div> @@ -68,6 +68,8 @@ static bool srt_schedule_reconnect(sout_access_out_t *p_access)<br></div><div> int i_payload_size = var_InheritInteger( p_access, SRT_PARAM_PAYLOAD_SIZE );<br></div><div> char *psz_passphrase = var_InheritString( p_access, SRT_PARAM_PASSPHRASE );<br></div><div> bool passphrase_needs_free = true;<br></div><div> + char *psz_streamid = var_InheritString( p_access, SRT_PARAM_STREAMID );<br></div><div> + bool streamid_needs_free = true;<br></div><div> int i_max_bandwidth_limit =<br></div><div> var_InheritInteger( p_access, SRT_PARAM_BANDWIDTH_OVERHEAD_LIMIT );<br></div><div> char *url = NULL;<br></div><div> @@ -136,6 +138,11 @@ static bool srt_schedule_reconnect(sout_access_out_t *p_access)<br></div><div> passphrase_needs_free = false;<br></div><div> psz_passphrase = (char *) params.passphrase;<br></div><div> }<br></div><div> + if (params.streamid != NULL) {<br></div><div> + free( psz_streamid );<br></div><div> + streamid_needs_free = false;<br></div><div> + psz_streamid = (char *) params.streamid;<br></div><div> + }<br></div><div> }<br></div><div> }<br></div><div> <br></div><div> @@ -168,6 +175,12 @@ static bool srt_schedule_reconnect(sout_access_out_t *p_access)<br></div><div> SRTO_PASSPHRASE, psz_passphrase, strlen(psz_passphrase) );<br></div><div> }<br></div><div> <br></div><div> + /* set streamid */<br></div><div> + if (psz_streamid != NULL && psz_streamid[0] != '\0') {<br></div><div> + srt_set_socket_option( access_obj, SRT_PARAM_STREAMID, p_sys->sock,<br></div><div> + SRTO_STREAMID, psz_streamid, strlen(psz_streamid) );<br></div><div> + }<br></div><div> +<br></div><div> /* set maximumu payload size */<br></div><div> srt_set_socket_option( access_obj, SRT_PARAM_PAYLOAD_SIZE, p_sys->sock,<br></div><div> SRTO_PAYLOADSIZE, &i_payload_size, sizeof(i_payload_size) );<br></div><div> @@ -204,6 +217,8 @@ out:<br></div><div> <br></div><div> if (passphrase_needs_free)<br></div><div> free( psz_passphrase );<br></div><div> + if (streamid_needs_free)<br></div><div> + free( psz_streamid );<br></div><div> free( psz_dst_addr );<br></div><div> free( url );<br></div><div> freeaddrinfo( res );<br></div><div> @@ -444,6 +459,9 @@ vlc_module_begin()<br></div><div> add_integer( SRT_PARAM_KEY_LENGTH, SRT_DEFAULT_KEY_LENGTH, SRT_KEY_LENGTH_TEXT,<br></div><div> SRT_KEY_LENGTH_TEXT, false )<br></div><div> change_integer_list( srt_key_lengths, srt_key_length_names )<br></div><div> + add_string(SRT_PARAM_STREAMID, "",<br></div><div> + N_(" SRT Stream ID"), NULL, false)<br></div><div> + change_safe()<br></div><div> <br></div><div> set_capability( "sout access", 0 )<br></div><div> add_shortcut( "srt" )<br></div><div> -- <br></div><div> 2.29.1<br></div><div> <br></div></blockquote></div><div>_______________________________________________<br></div><div>vlc-devel mailing list<br></div><div>To unsubscribe or modify your subscription options:<br></div><div><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br></div></blockquote><div><br></div></body></html>