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/call/video_receive_stream.h b/call/video_receive_stream.h
index 071e1f2..34d217f 100644
--- a/call/video_receive_stream.h
+++ b/call/video_receive_stream.h
@@ -17,6 +17,7 @@
#include <vector>
#include "api/call/transport.h"
+#include "api/crypto/cryptooptions.h"
#include "api/rtp_headers.h"
#include "api/rtpparameters.h"
#include "api/rtpreceiverinterface.h"
@@ -30,6 +31,7 @@
namespace webrtc {
+class FrameDecryptorInterface;
class RtpPacketSinkInterface;
class VideoDecoderFactory;
@@ -214,6 +216,14 @@
// TODO(nisse): Used with VideoDecoderFactory::LegacyCreateVideoDecoder.
// Delete when that method is retired.
std::string stream_id;
+
+ // An optional custom frame decryptor that allows the entire frame to be
+ // decrypted in whatever way the caller choses. This is not required by
+ // default.
+ rtc::scoped_refptr<webrtc::FrameDecryptorInterface> frame_decryptor;
+
+ // Per PeerConnection cryptography options.
+ CryptoOptions crypto_options;
};
// Starts stream activity.