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

Add support for external camera feed from external plugin on Android #96705

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

elmajime
Copy link

@elmajime elmajime commented Sep 8, 2024

This MR reflects the implementation of proposal godotengine/godot-proposals#10678

As indicated in the proposal, these changes are needed for the creation of an ARCore plugin basic feature: camera feed display.

@Chaosus
Copy link
Member

Chaosus commented Sep 8, 2024

CI failed, you need to fix it and squash the commits after that.

@AThousandShips AThousandShips changed the title Added external camera feed from external plugin on Android Add support for external camera feed from external plugin on Android Sep 9, 2024
@dsnopek
Copy link
Contributor

dsnopek commented Sep 9, 2024

Here's two previous PRs that have aimed to implement GL_TEXTURE_EXTERNAL_OES:

One of the important notes from the discussion on the first PR, is that we already have something in the OpenGL renderer that we're calling an "external texture". To avoid confusion, I think we should rename the old TextureStorage::texture_create_external() to something else, and use the term "external" for GL_TEXTURE_EXTERNAL_OES.

On that PR, I gave the following name suggestions:

Maybe:

  • TextureStorage::texture_create_foreign()
  • TextureStorage::texture_create_reference() -- the idea being it "references" a texture created elsewhere
  • TextureStorage::texture_create_remote()
  • TextureStorage::texture_create_third_party()
  • TextureStorage::texture_create_independent()

Naming is hard :-)

@dsnopek
Copy link
Contributor

dsnopek commented Sep 21, 2024

This needs to be rebased on top of PR #96982, now that that has been merged

@elmajime elmajime force-pushed the camera_from_external_feed branch 2 times, most recently from 5defe32 to d4aea7f Compare October 5, 2024 07:54
Copy link
Contributor

@dsnopek dsnopek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I haven't tested, but for the most part the code looks good to me :-)

There's just a handful of changes that I don't think are needed.

Copy link
Contributor

@BastiaanOlij BastiaanOlij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking really good. Few small nitpicking cleanup things David and myself noted, once those are cleaned up this can be merged IMHO.

@elmajime elmajime force-pushed the camera_from_external_feed branch from d4aea7f to f810272 Compare October 6, 2024 09:38
@elmajime
Copy link
Author

elmajime commented Oct 6, 2024

@dsnopek and @BastiaanOlij, just push force the commit to take into account your comments

@elmajime elmajime force-pushed the camera_from_external_feed branch from f810272 to 5f116dc Compare October 6, 2024 12:20
@BastiaanOlij
Copy link
Contributor

Look good to me!

Copy link
Contributor

@dsnopek dsnopek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! The code looks good to me after the latest changes. The PR is currently failing CI due to minor code formatting issues, but once those are resolved and this is passing tests, then I think it's ready to go :-)

@elmajime elmajime force-pushed the camera_from_external_feed branch from 5f116dc to c630cf1 Compare October 11, 2024 07:05
@elmajime elmajime requested a review from a team as a code owner October 11, 2024 07:05
@elmajime elmajime requested a review from a team as a code owner October 11, 2024 07:05
@elmajime elmajime force-pushed the camera_from_external_feed branch 2 times, most recently from 86a11cf to b532781 Compare October 12, 2024 16:06
Copy link
Member

@AThousandShips AThousandShips left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the fix for the comma

@elmajime elmajime force-pushed the camera_from_external_feed branch from b532781 to 90e9fc3 Compare October 13, 2024 07:58
@elmajime elmajime force-pushed the camera_from_external_feed branch from 90e9fc3 to 08dc2fb Compare October 13, 2024 09:00
@elmajime elmajime force-pushed the camera_from_external_feed branch from 08dc2fb to 64ae665 Compare October 13, 2024 11:17
@@ -361,6 +361,7 @@ RasterizerGLES3::RasterizerGLES3() {
cubemap_filter = memnew(GLES3::CubemapFilter);
glow = memnew(GLES3::Glow);
post_effects = memnew(GLES3::PostEffects);
feed_effects = memnew(GLES3::FeedEffects);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also needs to be freed in RasterizerGLES3::finalize

Copy link
Contributor

@BastiaanOlij BastiaanOlij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small nitpick fix and I think this is good to merge.

@Repiteo
Copy link
Contributor

Repiteo commented Oct 29, 2024

The commits will need to be squashed before this can be merged; check out the documentation for a guide

@elmajime
Copy link
Author

elmajime commented Oct 30, 2024

The commits will need to be squashed before this can be merged; check out the documentation for a guide

@Repiteo my last fork sync with master seams to have messed up my commit history, do you think I need to do anything more than squashing the fixup?

i.e. can the merge stay or do I need to remove that and rebase instead?

@Repiteo
Copy link
Contributor

Repiteo commented Oct 30, 2024

It should be removed and rebased, yeah. Merging against master is a common beginner's trap for amend/rebase workflows, but it's thankfully one that's relatively easy to resolve. For the sake of clarity: the endgoal is to make the Added external camera feed from external plugin on Android commit the only commit on this PR

@elmajime
Copy link
Author

elmajime commented Oct 30, 2024 via email

@elmajime elmajime force-pushed the camera_from_external_feed branch from 5c85afa to 6f846eb Compare November 1, 2024 09:28
@Repiteo Repiteo merged commit 11b9008 into godotengine:master Nov 5, 2024
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Nov 5, 2024

Thanks! Congratulations on your first contribution! 🎉

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

Successfully merging this pull request may close these issues.

7 participants