feat: Use yuv by default if no pixelFormat is set (#2441)
This commit is contained in:
@@ -470,6 +470,7 @@ export class Camera extends React.PureComponent<CameraProps, CameraState> {
|
||||
}
|
||||
|
||||
const shouldEnableBufferCompression = props.video === true && frameProcessor == null
|
||||
const pixelFormat = props.pixelFormat ?? (frameProcessor == null ? 'yuv' : 'native')
|
||||
const torch = this.state.isRecordingWithFlash ? 'on' : props.torch
|
||||
|
||||
return (
|
||||
@@ -487,6 +488,7 @@ export class Camera extends React.PureComponent<CameraProps, CameraState> {
|
||||
codeScannerOptions={codeScanner}
|
||||
enableFrameProcessor={frameProcessor != null}
|
||||
enableBufferCompression={props.enableBufferCompression ?? shouldEnableBufferCompression}
|
||||
pixelFormat={pixelFormat}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user