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}
This commit is contained in:
Benjamin Wright
2018-09-06 12:05:18 -07:00
committed by Commit Bot
parent c003a1f067
commit ea8b6f95c7
7 changed files with 83 additions and 1 deletions

View File

@ -69,6 +69,10 @@ public class RtpReceiver {
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 @@ public class RtpReceiver {
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);
};