Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for all device cameras #111

Closed
wants to merge 23 commits into from

Conversation

pcm2a
Copy link
Contributor

@pcm2a pcm2a commented Jan 15, 2019

This PR contains a few features that I wasn't sure if it made sense to split up. I also included some examples in the sampleApp CameraFragment. I can remove them if needed.

  • Starting any of the devices cameras, not just back/front. Useful when the user comes back and wants to start on the same facing direction.
    start(cameraId: Int)
  • Switching to the next camera, supporting all cameras
    camera.nextCamera()
  • Switching to any camera using the "facing" variable
    camera.facing = 2 would switch to camera 2
  • Retrieving a camera map that contains information about all of the cameras
    -- Retrieve camera ids by facing direction (all front or back cameras)
    -- Retrieve CameraCharacteristics by camera id
    -- Retrieve the direction a camera is facing by camera id

If a device has two back cameras the device's camera will have one toggle to change from front to back. When on the back camera there will be additional icons to switch between each back camera. An example would be an icon of a "regular" view and a "wide angle" view or a "zoom" view. The camera map will provide enough information to display all of this in the UI. Another example is the LG V40 that has three back cameras, with icons for wide angle, regular and zoom.

pcm2a and others added 2 commits January 14, 2019 23:42
- Ability to switch to any cameraId by setting camera.facing
- Api call to switch to the next camera id, looping through all cameras
- Ability to retrieve a CameraMap with information about all the cameras (by facing direction) and CameraCharacteristics
@pcm2a pcm2a requested a review from pvasa as a code owner January 15, 2019 06:25
@pcm2a
Copy link
Contributor Author

pcm2a commented Jan 15, 2019

Found a bug where switching camera modes can cause the camera to change because it is calling start() instead of start(cameraId).

pcm2a and others added 3 commits January 16, 2019 15:20
Development from head fork
# Conflicts:
#	cameraViewEx/src/main/api21/com/priyankvasa/android/cameraviewex/Camera2.kt
#	cameraViewEx/src/main/base/com/priyankvasa/android/cameraviewex/CameraInterface.kt
@pcm2a
Copy link
Contributor Author

pcm2a commented Jan 17, 2019

I have fixed the issue. So what was happening is if the user was on camera #2 and start() is called the chooseByFacing method would pick camera 0 or 1 and the camera would suddenly change. To fix this I call start(cameraId) from start and pass in camera.facing. I'm not sure the method chooseCameraIdByFacing is needed.

I also merged the latest in from develop.

pcm2a and others added 2 commits January 21, 2019 10:35
Development merge from head fork
# Conflicts:
#	cameraViewEx/src/main/base/com/priyankvasa/android/cameraviewex/CameraInterface.kt
#	cameraViewEx/src/main/java/com/priyankvasa/android/cameraviewex/CameraView.kt
@pcm2a
Copy link
Contributor Author

pcm2a commented Jan 21, 2019

I have merged in the latest from development

pcm2a and others added 2 commits January 29, 2019 22:28
# Conflicts:
#	cameraViewEx/src/main/api21/com/priyankvasa/android/cameraviewex/Camera2.kt
@pcm2a
Copy link
Contributor Author

pcm2a commented Jan 30, 2019

Updated this PR with the latest from the development branch.

@pvasa pvasa force-pushed the development branch 2 times, most recently from 7280f31 to f2e7cd9 Compare February 26, 2019 02:36
@pvasa pvasa force-pushed the development branch 3 times, most recently from 3aeec10 to a396a9f Compare March 5, 2019 03:09
@pvasa
Copy link
Owner

pvasa commented Mar 5, 2019

@pcm2a I am closing this PR to recreate development branch as it seems to be in bad state. I will reopen your PR against the new branch.

@pvasa pvasa closed this Mar 5, 2019
@pvasa pvasa changed the base branch from development to master March 5, 2019 03:20
@pvasa pvasa changed the base branch from master to development March 5, 2019 03:20
@pvasa pvasa reopened this Mar 5, 2019
@pvasa pvasa added enhancement New feature or request less priority The priority of this fix is less compared to other ongoing development requires investigation The changes requested in this PR requires further investigation/improvements labels Mar 5, 2019
@pvasa pvasa force-pushed the development branch 3 times, most recently from 127f0ae to 0ab1fb7 Compare March 22, 2019 03:29
@pvasa pvasa force-pushed the development branch 2 times, most recently from 5235e1e to c071065 Compare March 28, 2019 04:46
@pvasa pvasa force-pushed the development branch 4 times, most recently from 52286f5 to 5c7fd06 Compare April 6, 2019 17:54
@pcm2a pcm2a closed this Apr 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request less priority The priority of this fix is less compared to other ongoing development requires investigation The changes requested in this PR requires further investigation/improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants