From c8cb753c7bc9ccc4db81a53474eb8b280a570993 Mon Sep 17 00:00:00 2001 From: voroshil Date: Thu, 5 Apr 2007 16:33:54 +0000 Subject: Ability to specify video and audio capture device names in *BSD BT848 tv driver. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22916 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/en/mplayer.1 | 4 ++++ stream/tvi_bsdbt848.c | 48 ++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 44 insertions(+), 8 deletions(-) diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index eb7779e78f..19cce726f3 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -1719,6 +1719,10 @@ See \-tv driver=help for a list of compiled-in TV input drivers. available: dummy, v4l, v4l2, bsdbt848 .IPs device= Specify TV device (default: /dev/\:video0). +.I NOTE: +For bsdbt848 driver you can provide both bktr and tuner device names +separating them with comma, tuner after +bktr (e.g.\& -tv device=/dev/bktr1,/dev/tuner1) .IPs input= Specify input (default: 0 (TV), see console output for available inputs). .IPs freq= diff --git a/stream/tvi_bsdbt848.c b/stream/tvi_bsdbt848.c index cf526823c4..23e844ce0e 100644 --- a/stream/tvi_bsdbt848.c +++ b/stream/tvi_bsdbt848.c @@ -173,7 +173,46 @@ return; /* handler creator - entry point ! */ static tvi_handle_t *tvi_init_bsdbt848(char *device,char* adevice) { - return(new_handle()); + char* sep ; + tvi_handle_t* tvh; + priv_t* priv; + + tvh=new_handle(); + if(!tvh) + return NULL; + priv=(priv_t*)tvh->priv; + /* + if user needs to specify both /dev/bktr and /dev/tuner + it can do this with "-tv device=/dev/bktr1,/dev/tuner1" + */ + + /* set video device name */ + if (!device){ + priv->btdev = strdup("/dev/bktr0"); + priv->tunerdev = strdup("/dev/tuner0"); + }else{ + sep = strchr(device,','); + if(sep){ + // tuner device is also passed + priv->tunerdev = strdup(sep+1); + priv->btdev = strndup(device,sep-device); + }else{ + priv->tunerdev = strdup("/dev/tuner0"); + priv->btdev = strdup(device); + } + } + + /* set audio device name */ + if (!adevice) +#ifdef __NetBSD__ + priv->dspdev = strdup("/dev/sound"); +#else + priv->dspdev = strdup("/dev/dsp"); +#endif + else + priv->dspdev = strdup(adevice); + + return tvh; } static int control(priv_t *priv, int cmd, void *arg) @@ -479,7 +518,6 @@ G_private = priv; /* Oooh, sick */ /* Video Configuration */ priv->videoready = TRUE; -priv->btdev = strdup("/dev/bktr0"); priv->immediatemode = FALSE; priv->iformat = METEOR_FMT_PAL; priv->maxheight = PAL_HEIGHT; @@ -561,7 +599,6 @@ if(priv->videoready == TRUE) /* Tuner Configuration */ -priv->tunerdev = strdup("/dev/tuner0"); priv->tunerready = TRUE; priv->tunerfd = open(priv->tunerdev, O_RDONLY); @@ -575,11 +612,6 @@ if(priv->tunerfd < 0) /* Audio Configuration */ priv->dspready = TRUE; -#ifdef __NetBSD__ -priv->dspdev = strdup("/dev/sound"); -#else -priv->dspdev = strdup("/dev/dsp"); -#endif priv->dspsamplesize = 16; priv->dspstereo = 1; priv->dspspeed = 44100; -- cgit v1.2.3