|
|
@ -109,6 +109,8 @@ public class CameraView extends FrameLayout implements LifecycleObserver { |
|
|
|
VideoCodec codec = VideoCodec.fromValue(a.getInteger(R.styleable.CameraView_cameraVideoCodec, VideoCodec.DEFAULT.value())); |
|
|
|
VideoCodec codec = VideoCodec.fromValue(a.getInteger(R.styleable.CameraView_cameraVideoCodec, VideoCodec.DEFAULT.value())); |
|
|
|
long videoMaxSize = (long) a.getFloat(R.styleable.CameraView_cameraVideoMaxSize, 0); |
|
|
|
long videoMaxSize = (long) a.getFloat(R.styleable.CameraView_cameraVideoMaxSize, 0); |
|
|
|
int videoMaxDuration = a.getInteger(R.styleable.CameraView_cameraVideoMaxDuration, 0); |
|
|
|
int videoMaxDuration = a.getInteger(R.styleable.CameraView_cameraVideoMaxDuration, 0); |
|
|
|
|
|
|
|
int videoBitRate = a.getInteger(R.styleable.CameraView_cameraVideoBitRate, 0); |
|
|
|
|
|
|
|
int audioBitRate = a.getInteger(R.styleable.CameraView_cameraAudioBitRate, 0); |
|
|
|
|
|
|
|
|
|
|
|
// Picture size selector
|
|
|
|
// Picture size selector
|
|
|
|
List<SizeSelector> pictureConstraints = new ArrayList<>(3); |
|
|
|
List<SizeSelector> pictureConstraints = new ArrayList<>(3); |
|
|
@ -207,11 +209,13 @@ public class CameraView extends FrameLayout implements LifecycleObserver { |
|
|
|
setGrid(grid); |
|
|
|
setGrid(grid); |
|
|
|
setHdr(hdr); |
|
|
|
setHdr(hdr); |
|
|
|
setAudio(audio); |
|
|
|
setAudio(audio); |
|
|
|
|
|
|
|
setAudioBitRate(audioBitRate); |
|
|
|
setPictureSize(pictureSelector); |
|
|
|
setPictureSize(pictureSelector); |
|
|
|
setVideoSize(videoSelector); |
|
|
|
setVideoSize(videoSelector); |
|
|
|
setVideoCodec(codec); |
|
|
|
setVideoCodec(codec); |
|
|
|
setVideoMaxSize(videoMaxSize); |
|
|
|
setVideoMaxSize(videoMaxSize); |
|
|
|
setVideoMaxDuration(videoMaxDuration); |
|
|
|
setVideoMaxDuration(videoMaxDuration); |
|
|
|
|
|
|
|
setVideoBitRate(videoBitRate); |
|
|
|
|
|
|
|
|
|
|
|
// Apply gestures
|
|
|
|
// Apply gestures
|
|
|
|
mapGesture(Gesture.TAP, tapGesture); |
|
|
|
mapGesture(Gesture.TAP, tapGesture); |
|
|
@ -1090,6 +1094,26 @@ public class CameraView extends FrameLayout implements LifecycleObserver { |
|
|
|
mCameraController.setVideoSizeSelector(selector); |
|
|
|
mCameraController.setVideoSizeSelector(selector); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Sets the bit rate in bits per second for video capturing. |
|
|
|
|
|
|
|
* Will be used by both {@link #takeVideo(File)} and {@link #takeVideoSnapshot(File)}. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param bitRate desired bit rate |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public void setVideoBitRate(int bitRate) { |
|
|
|
|
|
|
|
mCameraController.setVideoBitRate(bitRate); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Sets the bit rate in bits per second for audio capturing. |
|
|
|
|
|
|
|
* Will be used by both {@link #takeVideo(File)} and {@link #takeVideoSnapshot(File)}. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param bitRate desired bit rate |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public void setAudioBitRate(int bitRate) { |
|
|
|
|
|
|
|
mCameraController.setAudioBitRate(bitRate); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Adds a {@link CameraListener} instance to be notified of all |
|
|
|
* Adds a {@link CameraListener} instance to be notified of all |
|
|
|