Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Unified Diff: webrtc/api/android/java/src/org/webrtc/PeerConnectionFactory.java

Issue 2127893002: AndroidVideoTrackSource implementation (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@magjed-init
Patch Set: Change videoSourceStopped to videoCapturerStopped. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/api/android/java/src/org/webrtc/PeerConnectionFactory.java
diff --git a/webrtc/api/android/java/src/org/webrtc/PeerConnectionFactory.java b/webrtc/api/android/java/src/org/webrtc/PeerConnectionFactory.java
index 2edd56e8413d2b17601a7ab8e4929e608cf6747f..e1b4a6e468fe64cba4faaa0621abe9a5fbca6cd5 100644
--- a/webrtc/api/android/java/src/org/webrtc/PeerConnectionFactory.java
+++ b/webrtc/api/android/java/src/org/webrtc/PeerConnectionFactory.java
@@ -121,6 +121,18 @@ public class PeerConnectionFactory {
eglContext, capturer, constraints));
}
+ public VideoSource createVideoSource(
+ VideoCapturer capturer) {
magjed_webrtc 2016/07/19 12:57:46 nit: This argument fits on the previous line.
sakal 2016/07/19 13:46:23 Done.
+ final EglBase.Context eglContext =
+ localEglbase == null ? null : localEglbase.getEglBaseContext();
+ long nativeAndroidVideoTrackSource = nativeCreateVideoSource2(nativeFactory, eglContext);
+ VideoCapturer.CapturerObserver capturerObserver
+ = new VideoCapturer.AndroidVideoTrackSourceObserver(nativeAndroidVideoTrackSource);
+ nativeInitializeVideoCapturer(nativeFactory, capturer, nativeAndroidVideoTrackSource,
+ capturerObserver);
+ return new VideoSource(nativeAndroidVideoTrackSource);
+ }
+
public VideoTrack createVideoTrack(String id, VideoSource source) {
return new VideoTrack(nativeCreateVideoTrack(
nativeFactory, id, source.nativeSource));
@@ -239,6 +251,13 @@ public class PeerConnectionFactory {
long nativeFactory, EglBase.Context eglContext, VideoCapturer videoCapturer,
MediaConstraints constraints);
+ private static native long nativeCreateVideoSource2(
+ long nativeFactory, EglBase.Context eglContext);
+
+ private static native void nativeInitializeVideoCapturer(
+ long native_factory, VideoCapturer j_video_capturer, long native_source,
+ VideoCapturer.CapturerObserver j_frame_observer);
+
private static native long nativeCreateVideoTrack(
long nativeFactory, String id, long nativeVideoSource);

Powered by Google App Engine
This is Rietveld 408576698