From 30a5987c9ec3387581726de291ebcbcd316302dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 7 Aug 2024 10:53:25 +0300 Subject: [PATCH] rtp: mp4gpay: Don't set seqnum-base on the caps This is supposed to be set by another layer, e.g. rtspsrc. Part-of: --- net/rtp/src/mp4g/pay/imp.rs | 1 - net/rtp/src/mp4g/tests.rs | 20 ++++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/net/rtp/src/mp4g/pay/imp.rs b/net/rtp/src/mp4g/pay/imp.rs index 719e4f15..b1f318b0 100644 --- a/net/rtp/src/mp4g/pay/imp.rs +++ b/net/rtp/src/mp4g/pay/imp.rs @@ -347,7 +347,6 @@ impl RtpBasePay2Impl for RtpMpeg4GenericPay { let codec_data_str = hex::encode(&codec_data); let caps_builder = gst::Caps::builder("application/x-rtp") - .field("seqnum-base", self.obj().property::("seqnum") + 1) .field("mpegversion", 4i32) .field("encoding-name", "MPEG4-GENERIC") .field("config", codec_data_str); diff --git a/net/rtp/src/mp4g/tests.rs b/net/rtp/src/mp4g/tests.rs index b2020778..dca93c65 100644 --- a/net/rtp/src/mp4g/tests.rs +++ b/net/rtp/src/mp4g/tests.rs @@ -19,8 +19,8 @@ fn aac_hbr_not_fragmented() { let src = "audiotestsrc num-buffers=100 ! audio/x-raw,rate=48000,channels=2 ! fdkaacenc ! aacparse"; - let pay = "rtpmp4gpay2"; - let depay = "rtpmp4gdepay2"; + let pay = "rtpmp4gpay2 seqnum-offset=1"; + let depay = "capsfilter caps=application/x-rtp,seqnum-base=(uint)1 ! rtpmp4gdepay2"; let mut expected_pay = Vec::with_capacity(102); for i in 0..102 { @@ -68,8 +68,8 @@ fn aac_hbr_fragmented() { let src = "audiotestsrc num-buffers=100 ! audio/x-raw,rate=48000,channels=1 ! fdkaacenc ! aacparse"; - let pay = "rtpmp4gpay2 mtu=288"; - let depay = "rtpmp4gdepay2"; + let pay = "rtpmp4gpay2 mtu=288 seqnum-offset=1"; + let depay = "capsfilter caps=application/x-rtp,seqnum-base=(uint)1 ! rtpmp4gdepay2"; let mut expected_pay = Vec::with_capacity(102); for i in 0..102 { @@ -183,8 +183,8 @@ fn generic_not_fragmented() { buffers.push(buffer); } - let pay = format!("rtpmp4gpay2 mtu={MTU}"); - let depay = "rtpmp4gdepay2"; + let pay = format!("rtpmp4gpay2 mtu={MTU} seqnum-offset=1"); + let depay = "capsfilter caps=application/x-rtp,seqnum-base=(uint)1 ! rtpmp4gdepay2"; let mut expected_pay = Vec::with_capacity(BUFFER_NB); for i in 0..PACKETS_PER_BUFFER { @@ -296,8 +296,8 @@ fn generic_fragmented() { buffers.push(buffer); } - let pay = format!("rtpmp4gpay2 mtu={MTU}"); - let depay = "rtpmp4gdepay2"; + let pay = format!("rtpmp4gpay2 mtu={MTU} seqnum-offset=1"); + let depay = "capsfilter caps=application/x-rtp,seqnum-base=(uint)1 ! rtpmp4gdepay2"; let mut expected_pay = Vec::with_capacity(BUFFER_NB); for i in 0..BUFFER_NB { @@ -422,8 +422,8 @@ fn generic_variable_au_size() { buffers.push(buffer); } - let pay = format!("rtpmp4gpay2 mtu={MTU}"); - let depay = "rtpmp4gdepay2"; + let pay = format!("rtpmp4gpay2 mtu={MTU} seqnum-offset=1"); + let depay = "capsfilter caps=application/x-rtp,seqnum-base=(uint)1 ! rtpmp4gdepay2"; let mut expected_pay = Vec::with_capacity(AU_NB); let mut pending_size = 0;