|
|
|
@ -40,6 +40,7 @@ import com.otaliastudios.cameraview.controls.Flash; |
|
|
|
|
import com.otaliastudios.cameraview.controls.Grid; |
|
|
|
|
import com.otaliastudios.cameraview.controls.Hdr; |
|
|
|
|
import com.otaliastudios.cameraview.controls.Mode; |
|
|
|
|
import com.otaliastudios.cameraview.controls.PictureFormat; |
|
|
|
|
import com.otaliastudios.cameraview.controls.Preview; |
|
|
|
|
import com.otaliastudios.cameraview.controls.VideoCodec; |
|
|
|
|
import com.otaliastudios.cameraview.controls.WhiteBalance; |
|
|
|
@ -246,6 +247,7 @@ public class CameraView extends FrameLayout implements LifecycleObserver { |
|
|
|
|
setPictureSize(sizeSelectors.getPictureSizeSelector()); |
|
|
|
|
setPictureMetering(pictureMetering); |
|
|
|
|
setPictureSnapshotMetering(pictureSnapshotMetering); |
|
|
|
|
setPictureFormat(controls.getPictureFormat()); |
|
|
|
|
setVideoSize(sizeSelectors.getVideoSizeSelector()); |
|
|
|
|
setVideoCodec(controls.getVideoCodec()); |
|
|
|
|
setVideoMaxSize(videoMaxSize); |
|
|
|
@ -847,6 +849,8 @@ public class CameraView extends FrameLayout implements LifecycleObserver { |
|
|
|
|
setPreview((Preview) control); |
|
|
|
|
} else if (control instanceof Engine) { |
|
|
|
|
setEngine((Engine) control); |
|
|
|
|
} else if (control instanceof PictureFormat) { |
|
|
|
|
setPictureFormat((PictureFormat) control); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -881,6 +885,8 @@ public class CameraView extends FrameLayout implements LifecycleObserver { |
|
|
|
|
return (T) getPreview(); |
|
|
|
|
} else if (controlClass == Engine.class) { |
|
|
|
|
return (T) getEngine(); |
|
|
|
|
} else if (controlClass == PictureFormat.class) { |
|
|
|
|
return (T) getPictureFormat(); |
|
|
|
|
} else { |
|
|
|
|
throw new IllegalArgumentException("Unknown control class: " + controlClass); |
|
|
|
|
} |
|
|
|
@ -948,6 +954,7 @@ public class CameraView extends FrameLayout implements LifecycleObserver { |
|
|
|
|
setAudio(oldEngine.getAudio()); |
|
|
|
|
setAudioBitRate(oldEngine.getAudioBitRate()); |
|
|
|
|
setPictureSize(oldEngine.getPictureSizeSelector()); |
|
|
|
|
setPictureFormat(oldEngine.getPictureFormat()); |
|
|
|
|
setVideoSize(oldEngine.getVideoSizeSelector()); |
|
|
|
|
setVideoCodec(oldEngine.getVideoCodec()); |
|
|
|
|
setVideoMaxSize(oldEngine.getVideoMaxSize()); |
|
|
|
@ -1418,6 +1425,29 @@ public class CameraView extends FrameLayout implements LifecycleObserver { |
|
|
|
|
return mCameraEngine.getPictureSnapshotMetering(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Sets the format for pictures taken with {@link #takePicture()}. This format does not apply |
|
|
|
|
* to picture snapshots taken with {@link #takePictureSnapshot()}. |
|
|
|
|
* The {@link PictureFormat#JPEG} is always supported - for other values, please check |
|
|
|
|
* the {@link CameraOptions#getSupportedPictureFormats()} value. |
|
|
|
|
* |
|
|
|
|
* @param pictureFormat new format |
|
|
|
|
*/ |
|
|
|
|
public void setPictureFormat(@NonNull PictureFormat pictureFormat) { |
|
|
|
|
mCameraEngine.setPictureFormat(pictureFormat); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the current picture format. |
|
|
|
|
* @see #setPictureFormat(PictureFormat) |
|
|
|
|
* @return the picture format |
|
|
|
|
*/ |
|
|
|
|
@NonNull |
|
|
|
|
public PictureFormat getPictureFormat() { |
|
|
|
|
return mCameraEngine.getPictureFormat(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Sets a capture size selector for video mode. |
|
|
|
|
* The {@link SizeSelector} will be invoked with the list of available sizes, and the first |
|
|
|
|