mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-01 21:18:52 +00:00
sys/oss4/: Make device-name probing in NULL state work better (e.g. for the gnome-control-center sound capplet).
Original commit message from CVS: * sys/oss4/oss4-mixer.c: (gst_oss4_mixer_open): * sys/oss4/oss4-property-probe.c: (gst_oss4_property_probe_find_device_name), (gst_oss4_property_probe_find_device_name_nofd): * sys/oss4/oss4-property-probe.h: * sys/oss4/oss4-sink.c: (gst_oss4_sink_get_property): * sys/oss4/oss4-source.c: (gst_oss4_source_get_property): Make device-name probing in NULL state work better (e.g. for the gnome-control-center sound capplet).
This commit is contained in:
parent
b3bc29bc64
commit
80ef4ca4d7
6 changed files with 52 additions and 2 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
||||||
|
2008-05-22 Tim-Philipp Müller <tim.muller at collabora co uk>
|
||||||
|
|
||||||
|
* sys/oss4/oss4-mixer.c: (gst_oss4_mixer_open):
|
||||||
|
* sys/oss4/oss4-property-probe.c:
|
||||||
|
(gst_oss4_property_probe_find_device_name),
|
||||||
|
(gst_oss4_property_probe_find_device_name_nofd):
|
||||||
|
* sys/oss4/oss4-property-probe.h:
|
||||||
|
* sys/oss4/oss4-sink.c: (gst_oss4_sink_get_property):
|
||||||
|
* sys/oss4/oss4-source.c: (gst_oss4_source_get_property):
|
||||||
|
Make device-name probing in NULL state work better (e.g. for the
|
||||||
|
gnome-control-center sound capplet).
|
||||||
|
|
||||||
2008-05-22 Wim Taymans <wim.taymans@collabora.co.uk>
|
2008-05-22 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
Patch by: Sjoerd Simons <sjoerd at luon dot net>
|
Patch by: Sjoerd Simons <sjoerd at luon dot net>
|
||||||
|
|
|
@ -303,6 +303,9 @@ open_failed:
|
||||||
GST_ELEMENT_ERROR (mixer, RESOURCE, OPEN_READ_WRITE,
|
GST_ELEMENT_ERROR (mixer, RESOURCE, OPEN_READ_WRITE,
|
||||||
(_("Could not open audio device for mixer control handling.")),
|
(_("Could not open audio device for mixer control handling.")),
|
||||||
GST_ERROR_SYSTEM);
|
GST_ERROR_SYSTEM);
|
||||||
|
} else {
|
||||||
|
GST_DEBUG_OBJECT (mixer, "open failed: %s (ignoring errors)",
|
||||||
|
g_strerror (errno));
|
||||||
}
|
}
|
||||||
g_free (device);
|
g_free (device);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -315,6 +318,8 @@ legacy_oss:
|
||||||
(_("Could not open audio device for mixer control handling."
|
(_("Could not open audio device for mixer control handling."
|
||||||
"This version of the Open Sound System is not supported by this "
|
"This version of the Open Sound System is not supported by this "
|
||||||
"element.")), ("Try the 'ossmixer' element instead"));
|
"element.")), ("Try the 'ossmixer' element instead"));
|
||||||
|
} else {
|
||||||
|
GST_DEBUG_OBJECT (mixer, "open failed: legacy oss (ignoring errors)");
|
||||||
}
|
}
|
||||||
g_free (device);
|
g_free (device);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -163,6 +163,24 @@ gst_oss4_property_probe_find_device_name (GstObject * obj, int fd,
|
||||||
return (name != NULL);
|
return (name != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
gst_oss4_property_probe_find_device_name_nofd (GstObject * obj,
|
||||||
|
const gchar * device_handle, gchar ** device_name)
|
||||||
|
{
|
||||||
|
gboolean res;
|
||||||
|
int fd;
|
||||||
|
|
||||||
|
fd = open ("/dev/mixer", O_RDONLY);
|
||||||
|
if (fd < 0)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
res = gst_oss4_property_probe_find_device_name (obj, fd, device_handle,
|
||||||
|
device_name);
|
||||||
|
|
||||||
|
close (fd);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
static GList *
|
static GList *
|
||||||
gst_oss4_property_probe_get_mixer_devices (GstObject * obj, int fd,
|
gst_oss4_property_probe_get_mixer_devices (GstObject * obj, int fd,
|
||||||
struct oss_sysinfo *si)
|
struct oss_sysinfo *si)
|
||||||
|
|
|
@ -29,6 +29,10 @@ gboolean gst_oss4_property_probe_find_device_name (GstObject * obj,
|
||||||
const gchar * device_handle,
|
const gchar * device_handle,
|
||||||
gchar ** device_name);
|
gchar ** device_name);
|
||||||
|
|
||||||
|
gboolean gst_oss4_property_probe_find_device_name_nofd (GstObject * obj,
|
||||||
|
const gchar * device_handle,
|
||||||
|
gchar ** device_name);
|
||||||
|
|
||||||
#endif /* GST_OSS4_PROPERTY_PROBE_H */
|
#endif /* GST_OSS4_PROPERTY_PROBE_H */
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -255,7 +255,12 @@ gst_oss4_sink_get_property (GObject * object, guint prop_id,
|
||||||
g_value_set_string (value, oss->device_name);
|
g_value_set_string (value, oss->device_name);
|
||||||
gst_oss4_sink_close (GST_AUDIO_SINK (oss));
|
gst_oss4_sink_close (GST_AUDIO_SINK (oss));
|
||||||
} else {
|
} else {
|
||||||
g_value_set_string (value, oss->device_name);
|
gchar *name = NULL;
|
||||||
|
|
||||||
|
gst_oss4_property_probe_find_device_name_nofd (GST_OBJECT (oss),
|
||||||
|
oss->device, &name);
|
||||||
|
g_value_set_string (value, name);
|
||||||
|
g_free (name);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
g_value_set_string (value, oss->device_name);
|
g_value_set_string (value, oss->device_name);
|
||||||
|
|
|
@ -256,11 +256,17 @@ gst_oss4_source_get_property (GObject * object, guint prop_id,
|
||||||
g_value_set_string (value, oss->device_name);
|
g_value_set_string (value, oss->device_name);
|
||||||
gst_oss4_source_close (GST_AUDIO_SRC (oss));
|
gst_oss4_source_close (GST_AUDIO_SRC (oss));
|
||||||
} else {
|
} else {
|
||||||
g_value_set_string (value, NULL);
|
gchar *name = NULL;
|
||||||
|
|
||||||
|
gst_oss4_property_probe_find_device_name_nofd (GST_OBJECT (oss),
|
||||||
|
oss->device, &name);
|
||||||
|
g_value_set_string (value, name);
|
||||||
|
g_free (name);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
g_value_set_string (value, oss->device_name);
|
g_value_set_string (value, oss->device_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_OBJECT_UNLOCK (oss);
|
GST_OBJECT_UNLOCK (oss);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue