GstStartup: Use directsoundsink as primary sink
This commit is contained in:
parent
d1a6e53f5c
commit
483b42d2b8
|
@ -84,18 +84,23 @@ void GstStartup::InitializeGStreamer() {
|
||||||
gstfastspectrum_register_static();
|
gstfastspectrum_register_static();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(Q_OS_WIN32) && defined(__MINGW32__)
|
#ifdef Q_OS_WIN32
|
||||||
// MinGW does not have wasapi2sink and wasapisink does not support device switching, so use directsoundsink as the default sink.
|
// Use directsoundsink as the default sink on Windows.
|
||||||
|
// wasapisink does not support device switching and wasapi2sink has issues, see #1227.
|
||||||
GstRegistry *reg = gst_registry_get();
|
GstRegistry *reg = gst_registry_get();
|
||||||
if (reg) {
|
if (reg) {
|
||||||
GstPluginFeature *directsoundsink = gst_registry_lookup_feature(reg, "directsoundsink");
|
if (GstPluginFeature *directsoundsink = gst_registry_lookup_feature(reg, "directsoundsink")) {
|
||||||
GstPluginFeature *wasapisink = gst_registry_lookup_feature(reg, "wasapisink");
|
|
||||||
if (directsoundsink && wasapisink) {
|
|
||||||
gst_plugin_feature_set_rank(directsoundsink, GST_RANK_PRIMARY);
|
gst_plugin_feature_set_rank(directsoundsink, GST_RANK_PRIMARY);
|
||||||
gst_plugin_feature_set_rank(wasapisink, GST_RANK_SECONDARY);
|
gst_object_unref(directsoundsink);
|
||||||
|
}
|
||||||
|
if (GstPluginFeature *wasapisink = gst_registry_lookup_feature(reg, "wasapisink")) {
|
||||||
|
gst_plugin_feature_set_rank(wasapisink, GST_RANK_SECONDARY);
|
||||||
|
gst_object_unref(wasapisink);
|
||||||
|
}
|
||||||
|
if (GstPluginFeature *wasapi2sink = gst_registry_lookup_feature(reg, "wasapi2sink")) {
|
||||||
|
gst_plugin_feature_set_rank(wasapi2sink, GST_RANK_SECONDARY);
|
||||||
|
gst_object_unref(wasapi2sink);
|
||||||
}
|
}
|
||||||
if (directsoundsink) gst_object_unref(directsoundsink);
|
|
||||||
if (wasapisink) gst_object_unref(wasapisink);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue