[Ffmpeg-devel] [PATCH] Set input channel on vide4linux with channel parameter
Michael Niedermayer
michaelni
Sat Oct 7 17:12:15 CEST 2006
Hi
On Fri, Oct 06, 2006 at 05:13:19PM +0200, Silvano Galliani (kysucix) wrote:
> Here is a simple patch to video4linux (grab.c) letting input to select
> video source (composite or s-video, ...) with channel option.
> ffmpeg help has been updated too. It was just for DV1394.
>
> Best regards.
> kysucix
[...]
> -
> +
cosmetic
> + /* set input channel */
> + if (ap->channel) {
> + if (ap->channel >= s->video_cap.channels || ap->channels < 0) {
> + av_log(NULL, AV_LOG_ERROR,
> + "Can't set channel, %d device has only %d channels\n",
> + ap->channel, s->video_cap.channels);
> + } else {
> + grab_chan.channel = ap->channel;
> + /* set channel standard */
> + if (ap->standard) {
> + if (!strcasecmp(ap->standard, "pal"))
> + grab_chan.norm = VIDEO_MODE_PAL;
> + else if (!strcasecmp(ap->standard, "ntsc"))
> + grab_chan.norm = VIDEO_MODE_NTSC;
> + }
the strcasecmp() is duplicated from below, there rather should be a char*
-> standard and then it should be copied into all the silly redundant
v4l structs
or is this maybe not needed at all and is the code below enough for setting
the standard?
[...]
> /* set tv standard */
> if (ap->standard && !ioctl(video_fd, VIDIOCGTUNER, &tuner)) {
> if (!strcasecmp(ap->standard, "pal"))
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is
More information about the ffmpeg-devel
mailing list