Cap-go / camera-preview

MIT License
3 stars 9 forks source link

Migrate Android Camera to CameraX or Camera2 #61

Open riderx opened 2 months ago

riderx commented 2 months ago

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 commented 2 months ago

/bounty $100

algora-pbc[bot] commented 2 months ago

๐Ÿ’Ž $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 bounty โ€ข Share 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 commented 2 months ago

/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 commented 2 months ago

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

algora-pbc[bot] commented 2 months ago

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

amaanlari commented 2 months ago

/attempt #61

algora-pbc[bot] commented 2 months ago

[!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.

algora-pbc[bot] commented 2 months ago

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

asr2003 commented 2 weeks ago

/attempt #61

Algora profile Completed bounties Tech Active attempts Options
@asr2003 1 bounty from 1 project
Java, JavaScript, Go,
HTML & more
Cancel attempt
algora-pbc[bot] commented 2 weeks ago

๐Ÿ’ก @asr2003 submitted a pull request that claims the bounty. You can visit your bounty board to reward.

dpa99c commented 2 weeks ago

as @forgr-owner mentions above, I have implemented the Camera 2 API in https://github.com/capacitor-community/camera-preview/pull/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 commented 2 weeks ago

Hi @dpa99c ,

I have taken implementation of CameraX in capacitor as reference and implemented here https://github.com/Cap-go/camera-preview/pull/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 commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

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

asr2003 commented 2 weeks ago

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

FYI, @neo773 has cancelled his attempt

asr2003 commented 2 weeks ago

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

riderx commented 2 weeks ago

@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 commented 2 weeks ago

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

dpa99c commented 2 weeks ago

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 commented 2 weeks ago

@riderx Waiting for the @neo773 response

riderx commented 2 weeks ago

@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 commented 2 weeks ago

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 commented 2 weeks ago

Sure @riderx