- since allowBackup is set to true in the manifest,
- it is possible for the app to be launch after a fresh install with mIsInPhotoMode=true in MainActivity
- this commit ensure the audio permission is requested at this point
- if the user denies, then it is initialised in photo mode instead
- add a new BitmapOutput, returned from the MediaOutputHelper when no output URI is specified in an IMAGE_CAPTURE intent
- in this format, take the picture without actually saving it and return the bitmap
- this behaviour is consistent with the implementation described in the official Android docs https://developer.android.com/training/camera/photobasics#TaskPhotoView
- CameraX video allowed predefined buckets of qualities UHD, FHD, HD, SD (defined in VideoQuality enum),
the CameraXPreview is configured to use the highest quality and
CameraX will select the closest corresponding resolution supported by the device.
- tentatively add ChangeResolutionDialogX (which would be renamed back to ChangeResolutionDialog) to give user option to select photo resolution and video qualities
- add ImageQualityManager which performs the same operation for getting all resolutions supported by a device using the Camera2 API, as defined in the legacy CameraPreview
- add VideoQualityManager to manage saving/ getting user selected quality.
- in MediaOutputHelper,
- add support for specifying the output URI if present in the intent
- when the output URI is specified,
- for Image Capture, we return a `Bitmap` as a `data` extra and also the URI as the Intent data
- for Video Capture we return the `Uri` as the Intent data
- if no output URI is specified in the capture intent or if there is an error while trying to access the URI, use the default location with MediaStore, so we do not return inconsistent URIs (eg, SAF tree URIs)
- add CameraXInitializer to abstract CameraXPreview initialisation logic
- update to use the DisplayOrientedMeteringPointFactory
- add Auto Focus (AF) and Auto Exposure (AE) metering points
- unbind VideoCaptureUseCase when in photo mode
- unbind ImageCaptureUseCase when not in photo mode
- add MediaSoundHelper to separate logic for playing media action sounds
- add support for playing media action sounds (shutter, start and stop recording) in CameraXPreview
- add CameraXPreview
- basic support image capture
- basic support for video capture
- add CameraXPreviewListener to prevent coupling to MainActivity
- support switching camera, flash light modes
- modify MyPreview interface to add default implementation for methods not needed by the CameraXPreview