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

Migrate Android Camera to CameraX or Camera2 #61

Open
riderx opened this issue May 3, 2024 · 26 comments · May be fixed by #87
Open

Migrate Android Camera to CameraX or Camera2 #61

riderx opened this issue May 3, 2024 · 26 comments · May be fixed by #87

Comments

@riderx
Copy link
Contributor

riderx commented May 3, 2024

The plugin uses a deprecated lib to do its job, it could be nice to migrate it to the newest lib.
Any of the 2 options is great if All features work properly

@riderx
Copy link
Contributor Author

riderx commented May 3, 2024

/bounty $100

Copy link

algora-pbc bot commented May 3, 2024

💎 $100 bounty • Capgo

Steps to solve:

  1. Start working: Comment /attempt #61 with your implementation plan
  2. Submit work: Create a pull request including /claim #61 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

Additional notes:

ℹ️ If something is not clear ask before working on it, otherwise your chance to rework it is high
🎥 To claim you need to provide in your PR a demo video of the change
👨‍👩‍👧‍👦 Join the Discord to get help
📏 Check all Bounty rules

Thank you for contributing to Cap-go/camera-preview!

Add a bountyShare on socials

Attempt Started (GMT+0) Solution
🔴 @neo773 May 3, 2024, 6:49:40 PM WIP
🔴 @amaanlari May 13, 2024, 1:13:52 PM WIP
🟢 @asr2003 Jul 5, 2024, 4:45:53 AM #87

@neo773
Copy link

neo773 commented May 3, 2024

/attempt #61

Algora profile Completed bounties Tech Active attempts Options
@neo773    21 Capgo bounties
+ 94 bounties from 23 projects
TypeScript, Rust,
Go & more
Cancel attempt

@riderx
Copy link
Contributor Author

riderx commented May 3, 2024

@neo773 thanks for the reactivity, i updated the demo to make your life easier all features are available

@riderx riderx changed the title Migrate Android Camera to CameraX of Camera2 Migrate Android Camera to CameraX or Camera2 May 3, 2024
Copy link

algora-pbc bot commented May 8, 2024

@neo773: Reminder that in 5 days the bounty will become up for grabs, so please submit a pull request before then 🙏

@amaanlari
Copy link

amaanlari commented May 13, 2024

/attempt #61

Copy link

algora-pbc bot commented May 13, 2024

Note

The user @neo773 is already attempting to complete issue #61 and claim the bounty. We recommend checking in on @neo773's progress, and potentially collaborating, before starting a new solution.

Copy link

algora-pbc bot commented May 18, 2024

@amaanlari: Reminder that in 5 days the bounty will become up for grabs, so please submit a pull request before then 🙏

@asr2003
Copy link

asr2003 commented Jul 5, 2024

/attempt #61

Algora profile Completed bounties Tech Active attempts Options
@asr2003 1 bounty from 1 project
Java, JavaScript, Go,
HTML & more
Cancel attempt

@asr2003 asr2003 linked a pull request Jul 5, 2024 that will close this issue
Copy link

algora-pbc bot commented Jul 5, 2024

💡 @asr2003 submitted a pull request that claims the bounty. You can visit your bounty board to reward.

@dpa99c
Copy link

dpa99c commented Jul 6, 2024

as @forgr-owner mentions above, I have implemented the Camera 2 API in capacitor-community/camera-preview#339 - not sure how similar this repo is as don't have time to look right now but feel free to use as doesn't seem like my PR will be merged

@asr2003
Copy link

asr2003 commented Jul 6, 2024

Hi @dpa99c ,

I have taken implementation of CameraX in capacitor as reference and implemented here #87. Can you have a look at it and review them?

@dpa99c also I have small queries on your work, Can i get your discord id?

@riderx
Copy link
Contributor Author

riderx commented Jul 6, 2024

Thanks @dpa99c This repo is a fork of the original one you created the PR.
Since I'm personally banned from Capacitor I couldn't Fork it.
I just fixed, maintained and merged a lot of PR, so migrating is probably easy.
@asr2003 did a PR but cannot run Gradle on his machine.
So if you are up to helping him and review his implementation of your code, I can double the bounty and split it with both of you.
Clients of Capgo are looking for this change too

@asr2003
Copy link

asr2003 commented Jul 6, 2024

And to be in the same page we are implementing the CameraX which is already merged in the capacitor successfully.
@riderx If you double up the bounty(or maybe can tip in the PR) I will take help of my friend PC to install gradle in her MAC and test changes and will add the video of the changes in the PR

@dpa99c
Copy link

dpa99c commented Jul 7, 2024

Hi @dpa99c ,

I have taken implementation of CameraX in capacitor as reference and implemented here #87. Can you have a look at it and review them?

@dpa99c also I have small queries on your work, Can i get your discord id?

@asr2003 it seems your PR is a migration to CameraX API which is a replacement for legacy Camera API, which are both high-level abstractions of the camera hardware.

Whereas my PR directly uses the Camera2 API, which provides low-level access to the camera hardware.
In addition to fixing some outstanding issues, it opens the way for future enhancements such as selecting a specific lens to use when the logical camera consists of multiple lenses.

I'm not really familiar with the CameraX API (nor am I really interested in getting familiar with it) so I'm not really able to review your PR.
I believe it's possible to use Camera2 API functionality in a CameraX implementation via the Camera2Interop class but I don't have familiarity with this.

@riderx it's up to you whether you want this plugin to use Camera2 API directly or CameraX in conjuction with Camera2 via Camera2Interop.
I don't have the time to test or implement the CameraX version but you are welcome to use my PR above for the Camera2 implementation.

@riderx
Copy link
Contributor Author

riderx commented Jul 7, 2024

Thanks for looking at it @dpa99c,
I believe Camera 2 is a better option as it allows lower level access and more flexibility.
@asr2003 if you manage to have a computer who works with Gradle, I can sponsor it and if @dpa99c you can just review the implementation I can still support it for that and will be delighted

@forgr-owner
Copy link

@neo773 If you want to check the PR of @dpa99c as well

@asr2003
Copy link

asr2003 commented Jul 7, 2024

@forgr-owner I am more interested to complete this issue :)

FYI, @neo773 has cancelled his attempt

@asr2003
Copy link

asr2003 commented Jul 7, 2024

@riderx Do my PR need to be update to integrate Camera2 instead the CameraX?

@riderx
Copy link
Contributor Author

riderx commented Jul 7, 2024

@asr2003 yes,
I'm glad you are motivated to complete the task, and I'm trying to find a solution that you could do while I get the expected result.
The PR you made in Capgo org were 2 time not tested and not working.
Without the help of someone I trust, I'm not comfortable letting do it on your own, as the chances are high to require me to work on it too.
So I proposed to @neo773 to help you because he proved his capacity to deliver well-tested code, multiple time.

@asr2003
Copy link

asr2003 commented Jul 7, 2024

@riderx Thanks! I will follow up this issue with the @neo773 and complete this issue very soon :)

@dpa99c
Copy link

dpa99c commented Jul 7, 2024

If you want to validate my Camera2 API implementation, you can use my test app project which pulls it in:
https://github.com/dpa99c/capacitor-camera-preview-test

@asr2003
Copy link

asr2003 commented Jul 8, 2024

@riderx Waiting for the @neo773 response

@riderx
Copy link
Contributor Author

riderx commented Jul 8, 2024

@asr2003 I got an answer in private @neo773 will be able to review your code, but please do build on your side before and test as well

@riderx
Copy link
Contributor Author

riderx commented Jul 8, 2024

To make a PR valid you need to provide a demo video, as it say in the instruction, so i will expect that before any review

@asr2003
Copy link

asr2003 commented Jul 9, 2024

Sure @riderx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants