Index: webrtc/sdk/android/src/jni/jni_common.cc |
diff --git a/webrtc/sdk/android/src/jni/pc/mediasource_jni.cc b/webrtc/sdk/android/src/jni/jni_common.cc |
similarity index 50% |
copy from webrtc/sdk/android/src/jni/pc/mediasource_jni.cc |
copy to webrtc/sdk/android/src/jni/jni_common.cc |
index 6e3150d3fbeb7939337aa7700a76c071393ba918..3a34ba372831f107f0310eff9cc63c8678caa468 100644 |
--- a/webrtc/sdk/android/src/jni/pc/mediasource_jni.cc |
+++ b/webrtc/sdk/android/src/jni/jni_common.cc |
@@ -8,23 +8,27 @@ |
* be found in the AUTHORS file in the root of the source tree. |
*/ |
-#include "webrtc/api/mediastreaminterface.h" |
+#include "webrtc/rtc_base/refcount.h" |
#include "webrtc/sdk/android/src/jni/jni_helpers.h" |
namespace webrtc_jni { |
-JNI_FUNCTION_DECLARATION(void, MediaSource_free, JNIEnv*, jclass, jlong j_p) { |
- reinterpret_cast<rtc::RefCountInterface*>(j_p)->Release(); |
+JNI_FUNCTION_DECLARATION(void, |
+ JniCommon_nativeAddRef, |
+ JNIEnv* jni, |
+ jclass, |
+ jlong j_native_ref_counted_pointer) { |
+ reinterpret_cast<rtc::RefCountInterface*>(j_native_ref_counted_pointer) |
+ ->AddRef(); |
} |
-JNI_FUNCTION_DECLARATION(jobject, |
- MediaSource_nativeState, |
+JNI_FUNCTION_DECLARATION(void, |
+ JniCommon_nativeReleaseRef, |
JNIEnv* jni, |
jclass, |
- jlong j_p) { |
- rtc::scoped_refptr<webrtc::MediaSourceInterface> p( |
- reinterpret_cast<webrtc::MediaSourceInterface*>(j_p)); |
- return JavaEnumFromIndexAndClassName(jni, "MediaSource$State", p->state()); |
+ jlong j_native_ref_counted_pointer) { |
+ reinterpret_cast<rtc::RefCountInterface*>(j_native_ref_counted_pointer) |
+ ->Release(); |
} |
} // namespace webrtc_jni |