Add writing and parsing of the `abs-capture-time` RTP header extension.
This change adds the writing and parsing of the `abs-capture-time` RTP header extension defined at:
http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time
We are still missing the code to:
- Negotiate the header extension.
- Collect capture time for audio and video and have the info sent with the header extension.
- Receive the header extension and use its info.
Bug: webrtc:10739
Change-Id: I75af492e994367f45a5bdc110af199900327b126
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144221
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Chen Xing <chxg@google.com>
Cr-Commit-Position: refs/heads/master@{#28468}
diff --git a/modules/rtp_rtcp/source/rtp_header_extensions.h b/modules/rtp_rtcp/source/rtp_header_extensions.h
index 7c3b38b..5cf6c4f 100644
--- a/modules/rtp_rtcp/source/rtp_header_extensions.h
+++ b/modules/rtp_rtcp/source/rtp_header_extensions.h
@@ -42,6 +42,23 @@
}
};
+class AbsoluteCaptureTimeExtension {
+ public:
+ using value_type = AbsoluteCaptureTime;
+ static constexpr RTPExtensionType kId = kRtpExtensionAbsoluteCaptureTime;
+ static constexpr uint8_t kValueSizeBytes = 16;
+ static constexpr uint8_t kValueSizeBytesWithoutEstimatedCaptureClockOffset =
+ 8;
+ static constexpr const char kUri[] =
+ "http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time";
+
+ static bool Parse(rtc::ArrayView<const uint8_t> data,
+ AbsoluteCaptureTime* extension);
+ static size_t ValueSize(const AbsoluteCaptureTime& extension);
+ static bool Write(rtc::ArrayView<uint8_t> data,
+ const AbsoluteCaptureTime& extension);
+};
+
class AudioLevel {
public:
static constexpr RTPExtensionType kId = kRtpExtensionAudioLevel;