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

[droidcamsrc] call droid_media_camera_take_picture from another thread #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

peat-psuwit
Copy link
Contributor

@peat-psuwit peat-psuwit commented Oct 4, 2019

take_picture call in HAL sometimes need to read information from preview
frames for e.g. auto exposure when using flash. If the calling thread
also handles pulling preview frames, this will create a deadlock.

To prevent this, I've moved the actual droid_media_camera_take_picture()
call to a function that will be called in a background thread. The
GstTaskPool is used to execute the function in the glib's thread pool,
so that the new thread doesn't have to be created every time.

This fixed taking a picture with the flash on on Fairphone 2 with
Halium 7.1-based port and Ubuntu Touch.

@peat-psuwit
Copy link
Contributor Author

I've rebased the commit and add additional commit message. @abranson?

take_picture call in HAL sometimes need to read information from preview
frames for e.g. auto exposure when using flash. If the calling thread
also handles pulling preview frames, this will create a deadlock.

To prevent this, I've moved the actual droid_media_camera_take_picture()
call to a function that will be called in a background thread. The
GstTaskPool is used to execute the function in the glib's thread pool,
so that the new thread doesn't have to be created every time.

This fixed taking a picture with the flash on on Fairphone 2 with
Halium 7.1-based port and Ubuntu Touch.
@pvuorela
Copy link
Contributor

pvuorela commented Jul 6, 2021

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