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

fix: make sure to match Audio class too #270

Merged
merged 2 commits into from
Apr 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/Manager/DeviceManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public class Manager.DeviceManager : Object {
return _instance;
}

private const string CLASS_NAME_SOURCE = "Source/Audio";
private const string CLASS_NAME_SINK = "Sink/Audio";
private Gst.DeviceMonitor monitor;

private DeviceManager () {
Expand All @@ -42,8 +44,8 @@ public class Manager.DeviceManager : Object {
});

var caps = new Gst.Caps.empty_simple ("audio/x-raw");
monitor.add_filter ("Source/Audio", caps);
monitor.add_filter ("Sink/Audio", caps);
monitor.add_filter (CLASS_NAME_SOURCE, caps);
monitor.add_filter (CLASS_NAME_SINK, caps);

sources = new Gee.ArrayList<Gst.Device> ();
sinks = new Gee.ArrayList<Gst.Device> ();
Expand Down Expand Up @@ -76,7 +78,7 @@ public class Manager.DeviceManager : Object {
continue;
}

if (device.has_classes ("Source")) {
if (device.has_classes (CLASS_NAME_SOURCE)) {
if (sources.contains (device)) {
continue;
}
Expand All @@ -90,7 +92,7 @@ public class Manager.DeviceManager : Object {
}
}

if (device.has_classes ("Sink")) {
if (device.has_classes (CLASS_NAME_SINK)) {
if (sinks.contains (device)) {
continue;
}
Expand Down