[MPlayer-dev-eng] [Patch] fix ivtv cvidix in configure-script

Martin Dauskardt martin.dauskardt at gmx.de
Tue Feb 2 00:08:05 CET 2010


>From  Reimar Döffinger <Reimar.Doeffinger at gmx.de>
> Diego handles configure, but:
> > -  # FIXME: ivtv driver temporarily disabled until we have a proper test
> > -  #test "$_vidix_drivers" || _vidix_drivers="cyberblade ivtv mach64 mga
> > mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome"
> > +  echocheck "ivtv vidix driver"
> > +  cat > $TMPC << EOF
> > +#include <stdlib.h>
> > +#include <inttypes.h>
> > +#include <linux/types.h>
> > +#include <linux/videodev2.h>
> > +#include <linux/ivtv.h>
> > +#include <sys/ioctl.h>
> > +int main(void) {
> > +struct ivtv_dma_frame tmp;
> > +tmp.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
> > +ioctl(0, IVTV_IOC_DMA_FRAME, &tmp);
> > +return 0; }
> > +EOF
> > +  _vidix_drv_ivtv=no
> > +  cc_check && _vidix_drv_ivtv=yes
> > +
> >    test "$_vidix_drivers" || _vidix_drivers="cyberblade mach64 mga
> > mga_crtc2 nvidia pm2 pm3 radeon rage128 s3 sh_veu sis unichrome" +  if
> > test "$_vidix_drv_ivtv" = yes ; then
> > +    _vidix_drivers="ivtv $_vidix_drivers"
> > +  fi
> > +  echores "$_vidix_drv_ivtv"
> 
> Don't put enabling the other drivers in the middle of the ivtv detection.
> And for new variables you should not use _ at the start of the variable
>  names. Proper indenting of the code in main probably wouldn't hurt either.
Feel free to modify it in any way you want. I am only a hobbyist - I can't do 
it better.
_vidix_drv_ivtv is an already existing variable, although it seems to be 
unused. So I thought it would be a good idea to use it instead of creating a 
new one. 
> 
> > diff -ur mplayer-old/vidix/ivtv_vid.c mplayer-new/vidix/ivtv_vid.c
> > --- mplayer-old/vidix/ivtv_vid.c      2010-01-24 19:06:43.277260784 +0100
> > +++ mplayer-new/vidix/ivtv_vid.c      2010-01-24 19:18:11.977259993 +0100
> 
> Is that part actually necessary? Why?
see explanation in
<http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2010-January/063394.html>
> 2.6.22 is not that old that the code to support version before it should be
> dropped unless it is really necessary (on thinking again it might actually
> be that old, still...).
The old code (which I removed) requires the old ivtv-driver (version 0.10) 
which is not part of the kernel. In this case (one has manually installed ivtv 
on a kernel <= 2.6.21) the /usr/include/linux/ivtv.h has the old API 
structures, and the configure cc_check will fail. We would need to implement a 
second detection in the configure script which detects the old ivtv API

Using LINUX_VERSION_CODE inside the ivtv vidix driver is not a good idea:
One could have a Debian Etch (LINUX_VERSION_CODE says 2.6.18) but uses a 
current v4l2-dvb hg with new ivtv API.

The only way to keep both ivtv APIs alive would be to use a new ivtv-0.10.h 
file with the old ivtv API inside mplayer. We would need to change ivtv_vid.c 
to select the right API version not at compile time but at run time (e.g. 
using VIDIOC_QUERYCAP and check vcap.version for the ivtv driver version). But 
that requires a lot of work for nothing: The old ivtv driver is dead, and I 
doubt that anybody who wants to use ivtv cvidix has still such an old kernel.



More information about the MPlayer-dev-eng mailing list