summaryrefslogtreecommitdiff
path: root/src/input/input_v4l.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/input/input_v4l.c')
-rw-r--r--src/input/input_v4l.c35
1 files changed, 25 insertions, 10 deletions
diff --git a/src/input/input_v4l.c b/src/input/input_v4l.c
index ff9ea87d0..df0e0e48b 100644
--- a/src/input/input_v4l.c
+++ b/src/input/input_v4l.c
@@ -88,9 +88,9 @@ static char *log_line_prefix()
}
#endif
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "input_plugin.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/input_plugin.h>
#define NUM_FRAMES 15
@@ -110,12 +110,15 @@ static const resolution_t resolutions[] = {
{ 160, 120 }
};
-static char *tv_standard_names[] = { "PAL", "NTSC", "SECAM", NULL };
-static int tv_standard_values[] = { VIDEO_MODE_PAL, VIDEO_MODE_NTSC, VIDEO_MODE_SECAM };
+static const char *const tv_standard_names[] = { "PAL", "NTSC", "SECAM", NULL };
+static const int tv_standard_values[] = { VIDEO_MODE_PAL, VIDEO_MODE_NTSC, VIDEO_MODE_SECAM };
#define NUM_RESOLUTIONS (sizeof(resolutions)/sizeof(resolutions[0]))
-#define RADIO_DEV "/dev/v4l/radio0"
-#define VIDEO_DEV "/dev/v4l/video0"
+#define RADIO_DEV "/dev/radio0"
+#define VIDEO_DEV "/dev/video0"
+#ifdef HAVE_ALSA
+#define AUDIO_DEV "plughw:0,0"
+#endif
#if !defined(NDELAY) && defined(O_NDELAY)
#define FNDELAY O_NDELAY
@@ -913,7 +916,7 @@ static int open_video_capture_device(v4l_input_plugin_t *this)
if (ret < 0) {
close (this->video_fd);
this->video_fd = -1;
- lprintf("Grab: no colorspace format found\n");
+ lprintf("Grab: no colour space format found\n");
return 0;
}
else
@@ -1732,6 +1735,9 @@ static input_plugin_t *v4l_class_get_instance (input_class_t *cls_gen,
{
/* v4l_input_class_t *cls = (v4l_input_class_t *) cls_gen; */
v4l_input_plugin_t *this;
+#ifdef HAVE_ALSA
+ cfg_entry_t *entry;
+#endif
char *mrl = strdup(data);
/* Example mrl: v4l:/Television/62500 */
@@ -1752,13 +1758,14 @@ static input_plugin_t *v4l_class_get_instance (input_class_t *cls_gen,
this->event_queue = NULL;
this->scr = NULL;
#ifdef HAVE_ALSA
- this->pcm_name = NULL;
this->pcm_data = NULL;
this->pcm_hwparams = NULL;
/* Audio */
this->pcm_stream = SND_PCM_STREAM_CAPTURE;
- this->pcm_name = strdup("plughw:0,0");
+ entry = this->stream->xine->config->lookup_entry(this->stream->xine->config,
+ "media.video4linux.audio_device");
+ this->pcm_name = strdup (entry->str_value);
this->audio_capture = 1;
#endif
this->rate = 44100;
@@ -1928,6 +1935,14 @@ static void *init_video_class (xine_t *xine, void *data)
_("Selects the TV standard of the input signals. "
"Either: PAL, NTSC and SECAM. "), 20, NULL, NULL);
+#ifdef HAVE_ALSA
+ config->register_filename (config, "media.video4linux.audio_device",
+ AUDIO_DEV, 0,
+ _("v4l ALSA audio input device"),
+ _("The name of the audio device which corresponds "
+ "to your Video4Linux video device."),
+ 10, NULL, NULL);
+#endif
return this;
}