Create the Java Wrapper of RtpReceiverObserverInterface.

Create the RtpReceiver.Observer which is a Java wrapper over the webrtc::RtpReceiverObserverInterface.
The callback function onFirstPacketReceived will be called whenever the first audio or video packet it received.

BUG=webrtc:6742

Review-Url: https://codereview.webrtc.org/2531333003
Cr-Commit-Position: refs/heads/master@{#15464}
This commit is contained in:
zhihuang
2016-12-07 10:36:40 -08:00
committed by Commit bot
parent dd33e63378
commit c4adabf967
8 changed files with 161 additions and 10 deletions

View File

@ -166,6 +166,16 @@ jfieldID GetFieldID(
return f;
}
jfieldID GetStaticFieldID(JNIEnv* jni,
jclass c,
const char* name,
const char* signature) {
jfieldID f = jni->GetStaticFieldID(c, name, signature);
CHECK_EXCEPTION(jni) << "error during GetStaticFieldID";
RTC_CHECK(f) << name << ", " << signature;
return f;
}
jclass GetObjectClass(JNIEnv* jni, jobject object) {
jclass c = jni->GetObjectClass(object);
CHECK_EXCEPTION(jni) << "error during GetObjectClass";
@ -180,6 +190,13 @@ jobject GetObjectField(JNIEnv* jni, jobject object, jfieldID id) {
return o;
}
jobject GetStaticObjectField(JNIEnv* jni, jclass c, jfieldID id) {
jobject o = jni->GetStaticObjectField(c, id);
CHECK_EXCEPTION(jni) << "error during GetStaticObjectField";
RTC_CHECK(!IsNull(jni, o)) << "GetStaticObjectField returned NULL";
return o;
}
jobject GetNullableObjectField(JNIEnv* jni, jobject object, jfieldID id) {
jobject o = jni->GetObjectField(object, id);
CHECK_EXCEPTION(jni) << "error during GetObjectField";