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

Add a method getWebcamByName(String name) in Webcam class #270

Closed
mcicolella opened this issue Oct 19, 2014 · 1 comment
Closed

Add a method getWebcamByName(String name) in Webcam class #270

mcicolella opened this issue Oct 19, 2014 · 1 comment

Comments

@mcicolella
Copy link

Hi,
in some cases it's important to obtain a webcam reference by its name, e.g. if you want to capture an image from a specific device.
Now getDefaults() returns only a ref to the default camera.
What about a specific method for this?

In my plugin I create the following method

public Webcam getCameraByName(String name) {
        for (Webcam webcam : Webcam.getWebcams()) {
            if (webcam.getName().equalsIgnoreCase(name)) {
                return webcam;
            }
        }
        return null;
    }
@sarxos
Copy link
Owner

sarxos commented Oct 19, 2014

Done :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants