From e43dcd999644b4b536f0e43fd15d7e262d4dd2c1 Mon Sep 17 00:00:00 2001 From: Jonas Holmberg Date: Thu, 25 Aug 2016 15:52:36 +0200 Subject: [PATCH] rtph265pay: Set RTP marker bit Set the RTP marker bit on the last RTP packet of an H.265 access unit. https://bugzilla.gnome.org/show_bug.cgi?id=770394 --- gst/rtp/gstrtph265pay.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/gst/rtp/gstrtph265pay.c b/gst/rtp/gstrtph265pay.c index 10898b8..8e9a887 100644 --- a/gst/rtp/gstrtph265pay.c +++ b/gst/rtp/gstrtph265pay.c @@ -109,7 +109,7 @@ enum PROP_CONFIG_INTERVAL }; -#define IS_ACCESS_UNIT(x) (((x) > 0x00) && ((x) < 0x06)) +#define IS_ACCESS_UNIT(x) (((x) >= 0x00) && ((x) < 0x20)) static void gst_rtp_h265_pay_finalize (GObject * object); @@ -963,8 +963,6 @@ gst_rtp_h265_pay_payload_nal (GstRTPBasePayload * basepayload, packet_len = gst_rtp_buffer_calc_packet_len (size, 0, 0); - GST_FIXME_OBJECT (rtph265pay, "Set RTP marker bit appropriately"); - if (packet_len < mtu) { GST_DEBUG_OBJECT (rtph265pay, "NAL Unit fit in one packet datasize=%d mtu=%d", size, mtu); @@ -977,10 +975,10 @@ gst_rtp_h265_pay_payload_nal (GstRTPBasePayload * basepayload, gst_rtp_buffer_map (outbuf, GST_MAP_WRITE, &rtp); - /* FIXME : only set the marker bit on packets containing access units */ - /* if (IS_ACCESS_UNIT (nalType) && end_of_au) { - gst_rtp_buffer_set_marker (&rtp, 1); - } */ + /* only set the marker bit on packets containing access units */ + if (IS_ACCESS_UNIT (nalType) && end_of_au) { + gst_rtp_buffer_set_marker (&rtp, 1); + } /* timestamp the outbuffer */ GST_BUFFER_PTS (outbuf) = pts; @@ -1045,10 +1043,10 @@ gst_rtp_h265_pay_payload_nal (GstRTPBasePayload * basepayload, payload[0] = (nalHeader[0] & 0x81) | (49 << 1); payload[1] = nalHeader[1]; - /* FIXME - set RTP marker bit appropriately */ - /* if (IS_ACCESS_UNIT (nalType)) { - gst_rtp_buffer_set_marker (&rtp, end && end_of_au); - } */ + /* set the marker bit on the last packet of an access unit */ + if (IS_ACCESS_UNIT (nalType)) { + gst_rtp_buffer_set_marker (&rtp, end && end_of_au); + } /* FU Header */ payload[2] = (start << 7) | (end << 6) | (nalType & 0x3f); -- 2.7.4