Enable End-to-End Encrypted Video Frames.
This change integrates the FrameDecryptorInterface and the FrameEncryptorInterface into
the video send and receive path. If a FrameEncryptorInterface is set on an outgoing video RTPSender
then each outgoing video frame will first pass through the provided FrameEncryptor which
will have a chance to modify the payload contents for the purposes of encryption. In addition to
this the new GenericFrameDescriptor will be added as additional data.
If a FrameDecryptorInterface is set on an incoming video RtpReceiver then each incoming
video payload will first pass through the provided FrameDecryptor which have a chance to
modify the payload contents for the purpose of decryption.
Bug: webrtc:9795
Change-Id: I9f743ce0cb63df0cf070f6144be7ada078b4e5d2
Reviewed-on: https://webrtc-review.googlesource.com/c/103920
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Benjamin Wright <benwright@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25258}
diff --git a/modules/video_coding/encoded_frame.h b/modules/video_coding/encoded_frame.h
index dae383c..c7efd40 100644
--- a/modules/video_coding/encoded_frame.h
+++ b/modules/video_coding/encoded_frame.h
@@ -61,10 +61,20 @@
*/
const uint8_t* Buffer() const { return _buffer; }
/**
+ * Get pointer to frame buffer that can be mutated.
+ */
+ uint8_t* MutableBuffer() { return _buffer; }
+ /**
* Get frame length
*/
size_t Length() const { return _length; }
-
+ /**
+ * Set frame length
+ */
+ void SetLength(size_t length) {
+ RTC_DCHECK(length <= _size);
+ _length = length;
+ }
/**
* Frame RTP timestamp (90kHz)
*/