diff --git a/aws-android-sdk-kinesisvideo/src/main/java/com/amazonaws/mobileconnectors/kinesisvideo/mediasource/android/AndroidCameraMediaSource.java b/aws-android-sdk-kinesisvideo/src/main/java/com/amazonaws/mobileconnectors/kinesisvideo/mediasource/android/AndroidCameraMediaSource.java index 3ee16dbe2d..0122fb14d1 100644 --- a/aws-android-sdk-kinesisvideo/src/main/java/com/amazonaws/mobileconnectors/kinesisvideo/mediasource/android/AndroidCameraMediaSource.java +++ b/aws-android-sdk-kinesisvideo/src/main/java/com/amazonaws/mobileconnectors/kinesisvideo/mediasource/android/AndroidCameraMediaSource.java @@ -18,6 +18,7 @@ package com.amazonaws.mobileconnectors.kinesisvideo.mediasource.android; import java.util.Arrays; +import java.util.LinkedList; import java.util.List; import android.content.Context; @@ -73,7 +74,7 @@ public class AndroidCameraMediaSource implements MediaSource { private CameraFramesSource mCameraFramesSource; private EncodingCancellationToken mEncodingCancellationToken; - private List mPreivewSurfaces; + private List mPreviewSurfaces; private MediaSourceState mMediaSourceState; private CameraMediaSourceConfiguration mMediaSourceConfiguration; @@ -93,10 +94,11 @@ public AndroidCameraMediaSource(final String streamName, final Context context) mContext = context; mStreamName = streamName; mEncodingCancellationToken = new EncodingCancellationToken(); + mPreviewSurfaces = new LinkedList<>(); } public void setPreviewSurfaces(final Surface ... surfaces) { - mPreivewSurfaces = Arrays.asList(surfaces); + mPreviewSurfaces = Arrays.asList(surfaces); } private CameraFramesSource createFramesSource(final ImageReader imageReader) { @@ -223,7 +225,7 @@ private void startEncoding() { mCameraFramesSource.startEncoding( mContext, - mPreivewSurfaces, + mPreviewSurfaces, mMediaSourceConfiguration.getCameraId()); }