Update Android native API example to use real camera.
For simplicity, camera with index 0 is used. User also has to manually
give the permission to use the camera for the app.
Bug: webrtc:8769
Change-Id: I371f26f94d629411fd299671b4f3202e84556b80
Reviewed-on: https://webrtc-review.googlesource.com/76982
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Paulina Hensman <phensman@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23284}
diff --git a/examples/androidnativeapi/jni/androidcallclient.h b/examples/androidnativeapi/jni/androidcallclient.h
index 2815b9d..a0507e3 100644
--- a/examples/androidnativeapi/jni/androidcallclient.h
+++ b/examples/androidnativeapi/jni/androidcallclient.h
@@ -21,6 +21,7 @@
#include "rtc_base/scoped_ref_ptr.h"
#include "rtc_base/thread_checker.h"
#include "sdk/android/native_api/jni/scoped_java_ref.h"
+#include "sdk/android/native_api/video/videosource.h"
namespace webrtc_examples {
@@ -36,6 +37,10 @@
// A helper method for Java code to delete this object. Calls delete this.
void Delete(JNIEnv* env, const webrtc::JavaRef<jobject>& cls);
+ webrtc::ScopedJavaLocalRef<jobject> GetJavaVideoCapturerObserver(
+ JNIEnv* env,
+ const webrtc::JavaRef<jobject>& cls);
+
private:
class PCObserver;
@@ -60,7 +65,7 @@
RTC_GUARDED_BY(thread_checker_);
std::unique_ptr<rtc::VideoSinkInterface<webrtc::VideoFrame>> remote_sink_
RTC_GUARDED_BY(thread_checker_);
- rtc::scoped_refptr<webrtc::VideoTrackSourceInterface> video_source_
+ rtc::scoped_refptr<webrtc::JavaVideoTrackSourceInterface> video_source_
RTC_GUARDED_BY(thread_checker_);
rtc::CriticalSection pc_mutex_;