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

Unified Diff: webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java

Issue 2013433003: WIP: Android Camera2 capture implementation (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix CaptureFormat jni parsing Created 4 years, 7 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
« no previous file with comments | « webrtc/examples/androidapp/src/org/appspot/apprtc/CaptureQualityController.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java
diff --git a/webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java b/webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java
index 94b66a769f51069a6388a3aba9cc34df58eed8fc..95cf8936dd2003315da06a0b60eb77c56c59a22f 100644
--- a/webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java
+++ b/webrtc/examples/androidapp/src/org/appspot/apprtc/PeerConnectionClient.java
@@ -33,7 +33,10 @@ import org.webrtc.SdpObserver;
import org.webrtc.SessionDescription;
import org.webrtc.StatsObserver;
import org.webrtc.StatsReport;
+import org.webrtc.CameraVideoCapturer;
+import org.webrtc.VideoCapturer;
import org.webrtc.VideoCapturerAndroid;
+import org.webrtc.VideoCapturerAndroid2;
import org.webrtc.VideoRenderer;
import org.webrtc.VideoSource;
import org.webrtc.VideoTrack;
@@ -93,6 +96,7 @@ public class PeerConnectionClient {
private final SDPObserver sdpObserver = new SDPObserver();
private final ScheduledExecutorService executor;
+ private Context context;
private PeerConnectionFactory factory;
private PeerConnection peerConnection;
PeerConnectionFactory.Options options = null;
@@ -121,7 +125,7 @@ public class PeerConnectionClient {
private SessionDescription localSdp; // either offer or answer SDP
private MediaStream mediaStream;
private int numberOfCameras;
- private VideoCapturerAndroid videoCapturer;
+ private CameraVideoCapturer videoCapturer;
// enableVideo is set to true if video should be rendered and sent.
private boolean renderVideo;
private VideoTrack localVideoTrack;
@@ -247,6 +251,7 @@ public class PeerConnectionClient {
this.events = events;
videoCallEnabled = peerConnectionParameters.videoCallEnabled;
// Reset variables to initial states.
+ this.context = null;
factory = null;
peerConnection = null;
preferIsac = false;
@@ -359,6 +364,7 @@ public class PeerConnectionClient {
if (options != null) {
Log.d(TAG, "Factory networkIgnoreMask option: " + options.networkIgnoreMask);
}
+ this.context = context;
factory = new PeerConnectionFactory(options);
Log.d(TAG, "Peer connection factory created.");
}
@@ -497,8 +503,7 @@ public class PeerConnectionClient {
cameraDeviceName = frontCameraDeviceName;
}
Log.d(TAG, "Opening camera: " + cameraDeviceName);
- videoCapturer = VideoCapturerAndroid.create(cameraDeviceName, null,
- peerConnectionParameters.captureToTexture);
+ videoCapturer = new VideoCapturerAndroid2(context, "1", null);
if (videoCapturer == null) {
reportError("Failed to open camera");
return;
@@ -778,7 +783,7 @@ public class PeerConnectionClient {
return localAudioTrack;
}
- private VideoTrack createVideoTrack(VideoCapturerAndroid capturer) {
+ private VideoTrack createVideoTrack(VideoCapturer capturer) {
videoSource = factory.createVideoSource(capturer, videoConstraints);
localVideoTrack = factory.createVideoTrack(VIDEO_TRACK_ID, videoSource);
« no previous file with comments | « webrtc/examples/androidapp/src/org/appspot/apprtc/CaptureQualityController.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698