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

feat: Synchronize Frame properly #2501

Merged
merged 3 commits into from
Feb 5, 2024
Merged

feat: Synchronize Frame properly #2501

merged 3 commits into from
Feb 5, 2024

Conversation

mrousavy
Copy link
Owner

@mrousavy mrousavy commented Feb 2, 2024

What

Synchronizes the Android Frame type properly by using Java's synchronized keyword for the whole method, not just the Image assertion part.

Before:

int getWidth() {
  synchronize(this) {
    assertImageIsValid();
  }
  return image.width;
}

After:

int getWidth() {
  synchronize(this) {
    assertImageIsValid();
    return image.width;
  }
}

(semi-pseudo code)

Changes

Tested on

Related issues

Copy link

vercel bot commented Feb 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-vision-camera ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 2, 2024 4:01pm

@mrousavy mrousavy merged commit d8c95c9 into main Feb 5, 2024
7 checks passed
@mrousavy mrousavy deleted the feat/assert-frame-valid branch February 5, 2024 11:34
isaaccolson pushed a commit to isaaccolson/deliveries-mobile that referenced this pull request Oct 30, 2024
* feat: Synchronize `Frame` properly

* Update CameraError.ts

* Image is not valid if `refCount` < 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant