Commit Graph

439 Commits

Author SHA1 Message Date
6c1ccd8db7 fix getting video quality 2022-07-13 02:13:02 +01:00
7a55969e6d update commons and camerax 2022-07-13 02:11:38 +01:00
210f3e35c0 use the resolution index instead of the qualities
- store and use the resolution index in Config class for video capture
2022-07-13 01:38:54 +01:00
d8ea6d5175 pass rotated resolution to ImageCaptureUsecase
- filter supported resolutions so 0MP resolutions are not selected. CameraX cannot apply these resolutions
2022-07-13 00:54:14 +01:00
d3d67ec4a4 remove exif info after image capture if user config.savePhotoMetadata == false 2022-07-12 22:15:44 +01:00
e1f292692a properly ensure RECORD_AUDIO permission is requested during camera initialisation
- 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
2022-07-10 18:57:01 +01:00
d5e1d61d02 fix passing bitmap thumbnail after IMAGE_CAPTURE intent
- 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
2022-07-09 02:55:41 +01:00
74e2656831 try to handle changing video quality and image resolution
- 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.
2022-07-08 00:12:03 +01:00
889a384f21 handle 3rd party image/video capture intents
- 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
2022-06-30 00:23:41 +01:00
f43cd4f939 handle some camera errors
- add CameraErrorHandler to handle
  - errors during camera lifecycle
  - when capturing images
  - when recording videos
2022-06-26 21:54:32 +01:00
b10d8639fd handle torch state in video capture
- set initial torch state to off
- enable/disable the torch when flash mode is on/off in video mode
2022-06-26 11:12:43 +01:00
79f9267383 handle storage location
- add MediaOutputHelper
   - to create OutputStream for photos
   - to create FileDescriptor for videos (currently requires API 26+)
2022-06-26 10:58:17 +01:00
79cbe55a7f Merge branch 'master' into feat/camera-x 2022-06-25 23:33:12 +01:00
d168040722 replace property getters with actual functions in CameraXPreview 2022-06-25 23:25:20 +01:00
916121ffc9 store/restore last used camera lens 2022-06-25 23:21:51 +01:00
fe3710510d add pinch to zoom support 2022-06-25 22:42:47 +01:00
b44b6a9b2b update focus and unbind useCase
- 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
2022-06-25 21:42:15 +01:00
f0030670cf add basic support for focus and metering 2022-06-25 17:51:13 +01:00
1f3dd341d0 add flipping horizontally and photo quality 2022-06-25 17:14:49 +01:00
c398370446 handle playing media sounds
- add MediaSoundHelper to separate logic for playing media action sounds
- add support for playing media action sounds (shutter, start and stop recording) in CameraXPreview
2022-06-25 16:39:29 +01:00
074351b88f add initial camera-x implementation
- 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
2022-06-25 15:43:39 +01:00
dfe9a0d051 updating some casual things 2022-06-22 23:32:14 +02:00
0cdf08b45f removing 2 more settings 2022-04-20 22:28:44 +02:00
16bed1a1b0 removing the FocusBeforeCapture setting 2022-04-20 22:19:57 +02:00
b9dd068495 use the new design at Settings 2022-04-20 21:58:44 +02:00
196f477d3e lets set the minimal required OS version to Android 10 2022-04-20 21:20:40 +02:00
77458cc759 updating commons 2022-04-20 21:17:05 +02:00
d717fe299c updating target SDK to 31 and some small things 2022-04-20 21:13:57 +02:00
baa128e11a updating commons, kotlin and gradle 2021-04-15 22:48:00 +02:00
7636f8ea90 require Simple Thank You purchase for customizing colors 2020-12-29 18:54:30 +01:00
f7e0b711cb catch more exceptions at toggling to recording mode 2020-12-29 17:45:03 +01:00
a713f8aba6 use a background thread for closing the camera on pause 2020-12-29 17:38:47 +01:00
9928ed46c1 adding some crashfixes 2020-11-07 19:48:46 +01:00
9734743705 do not show the New apps popup anymore 2020-11-07 19:48:31 +01:00
42971cc80d catch exceptions thrown at focusing an area 2020-09-19 18:57:17 +02:00
c35e755488 show a dialog about new apps to some users 2020-05-16 19:51:46 +02:00
619366807b catching an exceptions at focusing some area 2020-05-16 17:39:13 +02:00
b07afb2906 catch all exceptions thrown at getting camera characteristics 2020-05-16 17:35:44 +02:00
7c0924b2fd fix recording videos on some SD cards 2020-04-22 09:49:08 +02:00
af049de119 store camera characteristics in a variable, dont always refetch it 2020-04-21 23:10:48 +02:00
8de7262aa4 fix #242, rewriting gesture zooming 2020-04-21 22:58:09 +02:00
ca273da40e rely on GestureDetector at detecting focus clicks 2020-04-21 22:33:25 +02:00
fab62ee3b8 fix saving files on some SD cards 2020-04-21 22:21:27 +02:00
4040fe8c0a use some helper extensions from Commons 2020-04-21 22:10:49 +02:00
15ca2195f8 updating commons, gradle, kotlin 2020-04-21 22:04:38 +02:00
6c60721552 always show the Purchase Simple Thank You button at the settings 2020-02-16 22:21:16 +01:00
51c55811d6 do some preparations for target SDK 29 2020-02-16 22:19:49 +01:00
07b45d0f96 removing some error messages 2019-10-28 23:07:50 +01:00
bb83a47f4d Try selecting compatible preview sizes even if the aspect ratio doesn't match 2019-10-02 10:36:41 +02:00
7e4985d629 fix #145, blink in a black screen at photo capturing 2019-09-03 11:26:52 +02:00