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

@ -129,5 +129,14 @@ static void JNI_RtpReceiver_UnsetObserver(JNIEnv* jni,
}
}
static void JNI_RtpReceiver_SetFrameDecryptor(JNIEnv* jni,
const JavaParamRef<jclass>&,
jlong j_rtp_sender_pointer,
jlong j_frame_decryptor_pointer) {
reinterpret_cast<RtpReceiverInterface*>(j_rtp_sender_pointer)
->SetFrameDecryptor(reinterpret_cast<FrameDecryptorInterface*>(
j_frame_decryptor_pointer));
}
} // namespace jni
} // namespace webrtc

View File

@ -87,5 +87,14 @@ ScopedJavaLocalRef<jstring> JNI_RtpSender_GetId(JNIEnv* jni,
jni, reinterpret_cast<RtpSenderInterface*>(j_rtp_sender_pointer)->id());
}
static void JNI_RtpSender_SetFrameEncryptor(JNIEnv* jni,
const JavaParamRef<jclass>&,
jlong j_rtp_sender_pointer,
jlong j_frame_encryptor_pointer) {
reinterpret_cast<RtpSenderInterface*>(j_rtp_sender_pointer)
->SetFrameEncryptor(reinterpret_cast<FrameEncryptorInterface*>(
j_frame_encryptor_pointer));
}
} // namespace jni
} // namespace webrtc