webrtcbin: ensure RTX entry for all formats

Properly implement RFC 4588 by ensuring each media format
has its own RTX payload type with unique 'apt' parameter,
rather than only mapping the first format.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8663>
This commit is contained in:
Artem Martus 2025-03-29 19:03:13 +02:00 committed by GStreamer Marge Bot
parent 3ac5bb2d36
commit 36c983ccd5
2 changed files with 8 additions and 8 deletions

View File

@ -3065,11 +3065,9 @@ _pick_rtx_payload_types (GstWebRTCBin * webrtc, WebRTCTransceiver * trans,
{
gboolean ret = TRUE;
if (trans->local_rtx_ssrc_map)
gst_structure_free (trans->local_rtx_ssrc_map);
trans->local_rtx_ssrc_map =
gst_structure_new_empty ("application/x-rtp-ssrc-map");
if (!trans->local_rtx_ssrc_map)
trans->local_rtx_ssrc_map =
gst_structure_new_empty ("application/x-rtp-ssrc-map");
if (trans->do_nack) {
struct media_payload_map_item *item;
@ -3640,8 +3638,9 @@ sdp_media_from_transceiver (GstWebRTCBin * webrtc, GstSDPMedia * media,
gst_clear_structure (&extmap);
{
const GstStructure *s = gst_caps_get_structure (caps, 0);
// create rtx entry for each format type
for (i = 0; i < gst_caps_get_size (caps); i++) {
const GstStructure *s = gst_caps_get_structure (caps, i);
gint clockrate = -1;
gint rtx_target_pt;
guint rtx_target_ssrc = -1;

View File

@ -6510,7 +6510,8 @@ GST_START_TEST (test_video_rtx_no_duplicate_payloads)
VAL_SDP_INIT (no_duplicate_payloads, on_sdp_media_no_duplicate_payloads,
NULL, NULL);
guint media_format_count[] = { 3 };
// two formats for VP8 and H264 and two for VP8-RTX + H264-RTX
guint media_format_count[] = { 4 };
VAL_SDP_INIT (media_formats, on_sdp_media_count_formats,
media_format_count, &no_duplicate_payloads);
VAL_SDP_INIT (count, _count_num_sdp_media, GUINT_TO_POINTER (1),