<html><head></head><body>Hi,<br><br>This looks like completely pointless code complexity. No thanks.<br><br><div class="gmail_quote">Le 13 janvier 2020 10:08:52 GMT+02:00, Alessandro Bietresato <alessandro.bietresato@telefin.it> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">This patch allows to configure rtp payload type<br>for dynamic rtp via the "dynamic-payload-type" parameter (defaults to 96)<hr> modules/stream_out/rtp.c | 18 +++++++++++++++++-<br> modules/stream_out/rtp.h | 1 +<br> modules/stream_out/rtpfmt.c | 2 +-<br> 3 files changed, 19 insertions(+), 2 deletions(-)<br><br>diff --git a/modules/stream_out/rtp.c b/modules/stream_out/rtp.c<br>index d4c7460477..ad52b811f5 100644<br>--- a/modules/stream_out/rtp.c<br>+++ b/modules/stream_out/rtp.c<br>@@ -177,6 +177,9 @@ static const char *const ppsz_protocols[] = {<br> #define RTSP_PASS_LONGTEXT N_("Password that will be " \<br> "requested to access the stream." )<br> <br>+#define DYNAMIC_PAYLOAD_TYPE_TEXT N_("Dynamic rtp payload type")<br>+#define DYNAMIC_PAYLOAD_TYPE_LONGTEXT N_( \<br>+ "Payload type for dynamic rtp, defaults to 96" )<br> static int Open ( vlc_object_t * );<br> static void Close( vlc_object_t * );<br> <br>@@ -227,6 +230,8 @@ vlc_module_begin ()<br> RTCP_MUX_TEXT, RTCP_MUX_LONGTEXT, false )<br> add_integer( SOUT_CFG_PREFIX "caching", MS_FROM_VLC_TICK(DEFAULT_PTS_DELAY),<br> CACHING_TEXT, CACHING_LONGTEXT, true )<br>+ add_integer( SOUT_CFG_PREFIX "dynamic-payload-type", 96,<br>+ DYNAMIC_PAYLOAD_TYPE_TEXT, DYNAMIC_PAYLOAD_TYPE_LONGTEXT, true )<br> <br> #ifdef HAVE_SRTP<br> add_string( SOUT_CFG_PREFIX "key", "",<br>@@ -262,7 +267,7 @@ vlc_module_end ()<br> static const char *const ppsz_sout_options[] = {<br> "dst", "name", "cat", "port", "port-audio", "port-video", "*sdp", "ttl",<br> "mux", "sap", "description", "url", "email",<br>- "proto", "rtcp-mux", "caching",<br>+ "proto", "rtcp-mux", "caching", "dynamic-payload-type",<br> #ifdef HAVE_SRTP<br> "key", "salt",<br> #endif<br>@@ -321,6 +326,7 @@ typedef struct<br> uint16_t i_port;<br> uint16_t i_port_audio;<br> uint16_t i_port_video;<br>+ uint16_t i_dynamic_payload_type;<br> uint8_t proto;<br> bool rtcp_mux;<br> bool b_latm;<br>@@ -408,6 +414,7 @@ static int Open( vlc_object_t *p_this )<br> p_sys->i_port_audio = var_GetInteger( p_stream, SOUT_CFG_PREFIX "port-audio" );<br> p_sys->i_port_video = var_GetInteger( p_stream, SOUT_CFG_PREFIX "port-video" );<br> p_sys->rtcp_mux = var_GetBool( p_stream, SOUT_CFG_PREFIX "rtcp-mux" );<br>+ p_sys->i_dynamic_payload_type = var_GetInteger( p_stream, SOUT_CFG_PREFIX "dynamic-payload-type" );<br> <br> if( p_sys->i_port_audio && p_sys->i_port_video == p_sys->i_port_audio )<br> {<br>@@ -1812,3 +1819,12 @@ void rtp_get_video_geometry( sout_stream_id_sys_t *id, int *width, int *height )<br> int ret = sscanf( id->rtp_fmt.fmtp, "%*s width=%d; height=%d; ", width, height );<br> assert( ret == 2 );<br> }<br>+<br>+uint16_t rtp_get_dynamic_payload_type( vlc_object_t *obj )<br>+{<br>+ sout_stream_t *p_stream = (sout_stream_t*)obj;<br>+ assert(p_stream != NULL);<br>+ sout_stream_sys_t *p_sys = p_stream->p_sys;<br>+ assert(p_sys != NULL);<br>+ return p_sys->i_dynamic_payload_type;<br>+}<br>diff --git a/modules/stream_out/rtp.h b/modules/stream_out/rtp.h<br>index 2b1838f679..650ee8b6fd 100644<br>--- a/modules/stream_out/rtp.h<br>+++ b/modules/stream_out/rtp.h<br>@@ -92,6 +92,7 @@ int rtp_get_fmt( vlc_object_t *obj, const es_format_t *p_fmt, const char *mux,<br> /* Only used by rtp_packetize_rawvideo */<br> void rtp_get_video_geometry( sout_stream_id_sys_t *id, int *width, int *height );<br> uint16_t rtp_get_extended_sequence( sout_stream_id_sys_t *id );<br>+uint16_t rtp_get_dynamic_payload_type( vlc_object_t *obj );<br> <br> /* VoD */<br> int OpenVoD ( vlc_object_t * );<br>diff --git a/modules/stream_out/rtpfmt.c b/modules/stream_out/rtpfmt.c<br>index 356abd4eb6..6e09305860 100644<br>--- a/modules/stream_out/rtpfmt.c<br>+++ b/modules/stream_out/rtpfmt.c<br>@@ -173,7 +173,7 @@ int rtp_get_fmt( vlc_object_t *obj, const es_format_t *p_fmt, const char *mux,<br> /* Dynamic payload type. Payload types are scoped to the RTP<br> * session, and we put each ES in its own session, so no risk of<br> * conflict. */<br>- rtp_fmt->payload_type = 96;<br>+ rtp_fmt->payload_type = rtp_get_dynamic_payload_type(obj);<br> rtp_fmt->cat = mux != NULL ? VIDEO_ES : p_fmt->i_cat;<br> if( rtp_fmt->cat == AUDIO_ES )<br> {</pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>