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

Use separate camera thread #7

Merged
merged 2 commits into from
Oct 6, 2015
Merged

Use separate camera thread #7

merged 2 commits into from
Oct 6, 2015

Conversation

// update camera frame texture
GLES20.glActiveTexture(GLES20.GL_TEXTURE1);

camTexture.updateTexImage();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As you can see there is no need to call windowSurface.makeCurrent(); before updateTexImage.

headupinclouds added a commit that referenced this pull request Oct 6, 2015
@headupinclouds headupinclouds merged commit 0156f36 into headupinclouds:hunter Oct 6, 2015
return;
}
if (dataReady) {
return; // TODO; Should be `if (!tryLock) { return; }`
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've tested ReentrantLock here but it seems that synchronized (lock) doesn't playing well with lock.tryLock().

I thought that we can do:

if(!lock.tryLock()) {
  return; // exit immediately
}
lock.notify();
lock.unlock();

But in fact it should be:

if(!lock.tryLock()) {
  return;
}
synchronized (lock) {
  lock.notify();
}
lock.unlock();

which makes all the synchronization code looks quite ugly. I think we need to add new class or something (?)

@ruslo ruslo deleted the pr.camera.thread branch October 6, 2015 22:21
headupinclouds added a commit that referenced this pull request May 14, 2017
 hunterized unit tests;  astyle formatting; new shaders; copyright/au…
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.

2 participants