From b7b71e6974a5eade83b3edbc47c9a7e77c24b6f8 Mon Sep 17 00:00:00 2001 From: Havard Graff Date: Mon, 1 Feb 2021 10:36:42 +0100 Subject: [PATCH] rtprtxsend: mark RTX buffers with GST_RTP_BUFFER_FLAG_RETRANSMISSION It is useful for elements downstream from rtxsend to know if the RTP buffer they are dealing with is an RTX buffer or not. Part-of: --- subprojects/gst-plugins-good/gst/rtpmanager/gstrtprtxsend.c | 3 +++ subprojects/gst-plugins-good/tests/check/elements/rtprtx.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/subprojects/gst-plugins-good/gst/rtpmanager/gstrtprtxsend.c b/subprojects/gst-plugins-good/gst/rtpmanager/gstrtprtxsend.c index adad57c..5e92e25 100644 --- a/subprojects/gst-plugins-good/gst/rtpmanager/gstrtprtxsend.c +++ b/subprojects/gst-plugins-good/gst/rtpmanager/gstrtprtxsend.c @@ -734,6 +734,9 @@ gst_rtp_rtx_buffer_new (GstRtpRtxSend * rtx, GstBuffer * buffer) /* Copy over timestamps */ gst_buffer_copy_into (new_buffer, buffer, GST_BUFFER_COPY_TIMESTAMPS, 0, -1); + /* mark this is a RETRANSMISSION buffer */ + GST_BUFFER_FLAG_SET (new_buffer, GST_RTP_BUFFER_FLAG_RETRANSMISSION); + return new_buffer; } diff --git a/subprojects/gst-plugins-good/tests/check/elements/rtprtx.c b/subprojects/gst-plugins-good/tests/check/elements/rtprtx.c index 6206574..4eec054 100644 --- a/subprojects/gst-plugins-good/tests/check/elements/rtprtx.c +++ b/subprojects/gst-plugins-good/tests/check/elements/rtprtx.c @@ -33,6 +33,8 @@ } else { \ fail_unless_equals_int (GST_READ_UINT16_BE (gst_rtp_buffer_get_payload \ (&_rtp)), expected_seqnum); \ + fail_unless (GST_BUFFER_FLAG_IS_SET (buf, \ + GST_RTP_BUFFER_FLAG_RETRANSMISSION)); \ } \ gst_rtp_buffer_unmap (&_rtp); \ } G_STMT_END -- 2.7.4