Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Branko Subasic via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: Branko Subasic <branko.subasic@axis.com>
Subject: [FFmpeg-devel] [PATCH] lavf: add the RTP base time to RTCPServerReport
Date: Mon, 23 Feb 2026 12:09:29 +0100
Message-ID: <f4558b38-539c-4c89-867c-898351cc6565@axis.com> (raw)

This is needed for the application to be able to calculate packet UTC
times. The RTCP packet is sent as side data to the next AVPacket, but
there is no way to know how the timestamps in the RTCP packet relates
to the pts or dts in the AVPacket.

Signed-off-by: Branko Subasic <branko@axis.com>
---
  libavcodec/defs.h    | 1 +
  libavformat/rtpdec.c | 1 +
  2 files changed, 2 insertions(+)

diff --git a/libavcodec/defs.h b/libavcodec/defs.h
index b13e983b13..c6a941e172 100644
--- a/libavcodec/defs.h
+++ b/libavcodec/defs.h
@@ -348,6 +348,7 @@ typedef struct AVRTCPSenderReport {
      uint32_t rtp_timestamp; ///< RTP time when the report was sent
      uint32_t sender_nb_packets; ///< Total number of packets sent
      uint32_t sender_nb_bytes; ///< Total number of bytes sent 
(excluding headers or padding)
+    uint32_t base_rtp_timestamp; //< Base RTP time, obtained from the 
RTP-Info header
  } AVRTCPSenderReport;
   /**
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
index 5872c0f59c..dddcb17d89 100644
--- a/libavformat/rtpdec.c
+++ b/libavformat/rtpdec.c
@@ -197,6 +197,7 @@ static int rtcp_parse_packet(RTPDemuxContext *s, 
const unsigned char *buf,
              s->last_sr.rtp_timestamp = AV_RB32(buf + 16);
              s->last_sr.sender_nb_packets = AV_RB32(buf + 20);
              s->last_sr.sender_nb_bytes = AV_RB32(buf + 24);
+            s->last_sr.base_rtp_timestamp = s->base_timestamp;
               s->pending_sr = 1;
              s->last_rtcp_reception_time = av_gettime_relative();
-- 
2.43.0

_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

                 reply	other threads:[~2026-02-24 22:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f4558b38-539c-4c89-867c-898351cc6565@axis.com \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=branko.subasic@axis.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git