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

Failed when reopen video using WebcamPanel #188

Closed
germanchaparro opened this issue Mar 7, 2014 · 3 comments
Closed

Failed when reopen video using WebcamPanel #188

germanchaparro opened this issue Mar 7, 2014 · 3 comments

Comments

@germanchaparro
Copy link

Hi sarxos

I started to play with your api by modifying your example TakeSnaphotFromVideoExample.java. I created a Stop button to stop the capture from the webcam by using the method panel.stop().

private class StopAction extends AbstractAction{

    public StopAction() {
        super("Stop");
    }

    @Override
    public void actionPerformed(ActionEvent e) {

        btStart.setEnabled(true);
        btSnapMe.setEnabled(false);
        btStop.setEnabled(false);

        panel.stop();
    }
}

This seems to be working well but, when I try to start the video again with the Start button which calls the method panel.start() I get the following exception:

Exception in thread "pool-1-thread-1" java.lang.IllegalThreadStateException
    at java.lang.Thread.start(Thread.java:704)
    at com.github.sarxos.webcam.WebcamPanel$ImageUpdater.start(WebcamPanel.java:324)
    at com.github.sarxos.webcam.WebcamPanel.start(WebcamPanel.java:560)
    at TakeSnaphotFromVideoExample$StartAction.run(TakeSnaphotFromVideoExample.java:63)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)

It seems to be similar to the bug "Dispose Webcam #121" but in that thread you never talk about start the capture again without closing the application.

I am working in this environment:
Webcam Capture version: webcam-capture-0.3.10-RC6
Java version: 1.7.0_51-b13
OS: OS X 10.9.2
Name of Webcam: FaceTime HD Camera (Built-in) 0x1a11000005ac8510
Architecture: 64 bits

I already try the suggestions you gave in Dispose Webcam #121 with no successful results.

Thanks in advance

PD: Great API !

@sarxos
Copy link
Owner

sarxos commented Mar 10, 2014

Hi @germanchaparro,

Indeed, I was able to reproduce it using source code you provided on top of RC6 tag, however I do not confirm its existence in newest SNAPSHOT build. I guess it was fixed by @syliks who did d36900b - thanks Sylwia!

Can you please try again with this one: webcam-capture-0.3.10-20140310.191743-24.jar?

Seems like I should release RC7 ASAP ;P

@germanchaparro
Copy link
Author

Hi @sarxos

This jar works perfectly well. I will work with this one and as soon as you release the new version I will try it again.

Thank you very much :)

PD: Congratulations for this API, it is great

@sarxos
Copy link
Owner

sarxos commented Mar 10, 2014

I'm glad it works :)

@sarxos sarxos closed this as completed Mar 10, 2014
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

No branches or pull requests

2 participants