Adds the Java interface points for FrameEncryptor/FrameDecryptor.
This changes adds the API surface for injecting the FrameEncryptor and FrameDecryptor from Java.
This assumes that the API User will be able to provide native implementations of both the Encryptor
and Decryptor. Optional Java implementations may come later but due to the significant performance
issues around copying every frame across the JNI boundary it doesn't seem like a good idea to support
a non native backed implementation for now.
Bug: webrtc:9681
Change-Id: Ib4471e69fdf0a99705f824de652c621637b92326
Reviewed-on: https://webrtc-review.googlesource.com/96865
Commit-Queue: Benjamin Wright <benwright@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Emad Omara <emadomara@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24610}
diff --git a/sdk/android/api/org/webrtc/RtpReceiver.java b/sdk/android/api/org/webrtc/RtpReceiver.java
index 193820b..4da7537 100644
--- a/sdk/android/api/org/webrtc/RtpReceiver.java
+++ b/sdk/android/api/org/webrtc/RtpReceiver.java
@@ -69,6 +69,10 @@
nativeObserver = nativeSetObserver(nativeRtpReceiver, observer);
}
+ public void setFrameDecryptor(FrameDecryptor frameDecryptor) {
+ nativeSetFrameDecryptor(nativeRtpReceiver, frameDecryptor.getNativeFrameDecryptor());
+ }
+
// This should increment the reference count of the track.
// Will be released in dispose().
private static native long nativeGetTrack(long rtpReceiver);
@@ -77,4 +81,5 @@
private static native String nativeGetId(long rtpReceiver);
private static native long nativeSetObserver(long rtpReceiver, Observer observer);
private static native void nativeUnsetObserver(long rtpReceiver, long nativeObserver);
+ private static native void nativeSetFrameDecryptor(long rtpReceiver, long nativeFrameDecryptor);
};