CatxFish / obs-v4l2sink

obs studio output plugin for Video4Linux2 device
GNU General Public License v2.0
930 stars 99 forks source link

use combobox to select v4l2loopback video device #59

Open yetist opened 4 years ago

yetist commented 4 years ago

Please review and test.

yetist commented 4 years ago

Before:

After: 2020-07-22 17-17-48 创建的截图

colemickens commented 4 years ago

Is it possible that this doesn't work with devices that have exclusive_caps=1 ?

colemickens commented 4 years ago

I can confirm, if I remove these lines, then I still get a dropdown, and I get all v4l2 devices in the dropdown:

        if (video_cap.capabilities & V4L2_CAP_DEVICE_CAPS) {
            caps = video_cap.device_caps;
        } else {
            caps = video_cap.capabilities;
        }

        if (!(caps & V4L2_CAP_VIDEO_CAPTURE)) {
            ::close(fd);
            continue;
        }

        if (strcmp((char*) video_cap.driver, "v4l2 loopback") != 0) {
            ::close(fd);
            continue;
        }

One of those checks doesn't hold when exclusive_caps=1 is used.