]> git.sesse.net Git - vlc/commitdiff
Enable OPUS RTP packetization
authorAndrey Utkin <andrey.krieger.utkin@gmail.com>
Sun, 8 Dec 2013 02:25:29 +0000 (04:25 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 8 Dec 2013 12:38:28 +0000 (13:38 +0100)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/stream_out/rtpfmt.c

index aa4bcb141b860f766d6554ec1527762b9d47df76..94480a45e66c80b212fc000cc660f1cb108418cf 100644 (file)
@@ -501,6 +501,21 @@ int rtp_get_fmt( vlc_object_t *obj, es_format_t *p_fmt, const char *mux,
             rtp_fmt->ptname = "GSM";
             rtp_fmt->pf_packetize = rtp_packetize_split;
             break;
+        case VLC_CODEC_OPUS:
+            if (p_fmt->audio.i_channels > 2)
+            {
+                msg_Err( obj, "Multistream opus not supported in RTP"
+                         " (having %d channels input)",
+                         p_fmt->audio.i_channels );
+                return VLC_EGENERIC;
+            }
+            rtp_fmt->ptname = "opus";
+            rtp_fmt->pf_packetize = rtp_packetize_split;
+            rtp_fmt->clock_rate = 48000;
+            rtp_fmt->channels = 2;
+            if (p_fmt->audio.i_channels == 2)
+                rtp_fmt->fmtp = strdup( "sprop-stereo=1" );
+            break;
 
         default:
             msg_Err( obj, "cannot add this stream (unsupported "