Add a check for CameraCapturer being initialized before calling startCapture.

BUG=webrtc:6945
R=magjed@webrtc.org

Review-Url: https://codereview.webrtc.org/2621633002
Cr-Commit-Position: refs/heads/master@{#15988}
This commit is contained in:
sakal 2017-01-10 04:30:31 -08:00 committed by Commit bot
parent 0d1b2b6880
commit e996a99721

View File

@ -13,7 +13,6 @@ package org.webrtc;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import java.util.Arrays;
@SuppressWarnings("deprecation")
@ -258,6 +257,9 @@ public abstract class CameraCapturer implements CameraVideoCapturer {
@Override
public void startCapture(int width, int height, int framerate) {
Logging.d(TAG, "startCapture: " + width + "x" + height + "@" + framerate);
if (applicationContext == null) {
throw new RuntimeException("CameraCapturer must be initialized before calling startCapture.");
}
synchronized (stateLock) {
if (sessionOpening || currentSession != null) {