-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
JavaFX example hangs on Mac OS X Yosemite #357
Comments
Any solutions for this? I've tried to search for the webcams in a different thread, but its still freezing up. |
Hi @Greg767, The issue is caused by the Apple limitation that allows some native code to run only on the main thread when using SWT, GWT or JavaFX. Have you try starting your app with |
Hey thanks for the quick reply. I just tried with -XstartOnFirstThread and it still hangs. I will look into that post. |
In regards to:
Yes. It support both build-in and UVC :) |
OK so finally what worked for me is that I switched to my Macbook to finalize the development and get the default cam in a Task, as per the code exemple. I didn't need to use -XstartOnFirstThread option. |
I am having a similar issue and I can confirm that putting @Greg767 can you please elaborate your solution? |
For me it worked without that property on a Mac in netbeans and I used this code:
|
@Greg767 thanks for sharing the code. I think the clear solution here is to run |
Hi @hendraanggrian, Can you please elaborate more about this Is this NPE comes from |
@sarxos I weirdly cannot reproduce the error, at this point everything works great with your library. Thanks! |
Cool, in case it manifest again please do not hesitate to report it :) |
I found that in general the FX Application Thread is prone to hanging if you interact with the web cam much at all on that thread. E.g. |
Hi @james-d, Thank you for this contribution. Indeed many people from Webcam Capture community reported that using this API on Mac is somehow tricky. In regards to your code - since there are lambdas in your code I had to update <plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin> Otherwise it gave me compilation error:
|
@james-d, I included your code as a new example. Feel free to modify it whenever you need. Thanks! |
Hi,
when trying to launch the JavaFX example WebCamAppLauncher the programs hangs while searching for devices. I guess the problem is related to #318.
I get the following output:
and the output from jstack:
Searching for Webcams in a separate thread like this works without problems:
The text was updated successfully, but these errors were encountered: