#include <vlc_common.h>
#include <vlc_services_discovery.h>
#include <vlc_plugin.h>
-#include <search.h>
+#include <vlc_url.h>
+#ifdef HAVE_SEARCH_H
+# include <search.h>
+#endif
#include <poll.h>
#include <errno.h>
static int OpenV4L (vlc_object_t *);
+#ifdef HAVE_ALSA
static int OpenALSA (vlc_object_t *);
+#endif
static int OpenDisc (vlc_object_t *);
static void Close (vlc_object_t *);
static int vlc_sd_probe_Open (vlc_object_t *);
set_capability ("services_discovery", 0)
set_callbacks (OpenV4L, Close)
add_shortcut ("v4l")
-
+#ifdef HAVE_ALSA
add_submodule ()
set_shortname (N_("Audio capture"))
set_description (N_("Audio capture (ALSA)"))
set_capability ("services_discovery", 0)
set_callbacks (OpenALSA, Close)
add_shortcut ("alsa")
-
+#endif
add_submodule ()
set_shortname (N_("Discs"))
set_description (N_("Discs"))
{
vlc_sd_probe_Add (probe, "v4l{longname=\"Video capture\"}",
N_("Video capture"), SD_CAT_DEVICES);
+#ifdef HAVE_ALSA
vlc_sd_probe_Add (probe, "alsa{longname=\"Audio capture\"}",
N_("Audio capture"), SD_CAT_DEVICES);
+#endif
vlc_sd_probe_Add (probe, "disc{longname=\"Discs\"}", N_("Discs"),
SD_CAT_DEVICES);
udev_monitor_unref (mon);
if (val && !strcmp (val, "blank"))
return NULL; /* ignore empty drives and virgin recordable discs */
- const char *scheme = "invalid";
+ const char *scheme = NULL;
val = udev_device_get_property_value (dev,
"ID_CDROM_MEDIA_TRACK_COUNT_AUDIO");
if (val && atoi (val))
scheme = "cdda"; /* Audio CD rather than file system */
val = udev_device_get_property_value (dev, "ID_CDROM_MEDIA_DVD");
if (val && atoi (val))
- scheme = "file";
+ scheme = "dvd";
val = udev_device_get_property_value (dev, "ID_CDROM_MEDIA_BD");
if (val && atoi (val))
/* We didn't get any property that could tell we have optical disc
that we can play */
- if( !strcmp( scheme, "invalid" ) )
+ if (scheme == NULL)
return NULL;
val = udev_device_get_devnode (dev);
- char *mrl;
-
- if (asprintf (&mrl, "%s://%s", scheme, val) == -1)
- mrl = NULL;
- return mrl;
+ return make_URI (val, scheme);
}
static char *disc_get_name (struct udev_device *dev)