linux-headers-2.6.35 and linux/videodev.h

Hi

With the recent github version of of and ubuntu 10.10 I encountered the following error while compiling:

  
  
/openFrameworks/video/ofGstVideoGrabber.cpp:28: fatal error: linux/videodev.h: No such file or directory  
  

Apparently linux-headers-2.6.35 only supplies videodev2.h

so I changed the include statement to

  
  
#include <linux/videodev2.h>  
  

This ended with the following error:

  
  
../../../openFrameworks/video/ofGstVideoGrabber.cpp:68: error: aggregate ‘video_capability v1cap’ has incomplete type and cannot be defined  
../../../openFrameworks/video/ofGstVideoGrabber.cpp:109: error: ‘VIDIOCGCAP’ was not declared in this scope  
  

after some google searches I came up with the following fix:

  
  
#include <linux/videodev2.h>  
  
#define VIDIOCGCAP              _IOR('v',1,struct video_capability)     /* Get capabilities */  
  
struct video_capability  
{  
         char name[32];  
         int type;  
         int channels;   /* Num channels */  
         int audios;     /* Num audio devices */  
         int maxwidth;   /* Supported width */  
         int maxheight;  /* And height */  
         int minwidth;   /* Supported width */  
         int minheight;  /* And height */  
};  
  

Now libopenframeworks.a compiled fine. But I don’t know yet whether the videoGrabber now or not. Anybody know more about this? Any thoughts? Should this be included in the official source?

lg.ph

hey thanks

yes v4l support has been dropped in recent kernel versions, i thought that was going to be from 11.04 not in an update to 10.10, i already have the fix, just need to apply it and upload to github, will do it asap.

great! thanks!

I’ll watch the repository and update as soon as I see the changes. Congrats on providing so many updates on a regular basis btw…

hello. Noticed the same thing as I upgraded to 11.04. This hasn’t been pushed upstream yet? Is there a patch somewhere or is underdoeg’s fix the way to go?

I can confirm that the fix has not been pushed yet. (revision https://github.com/openframeworks/openFrameworks/commit/8edeb3cf5bbe87c607a68a7cfba709bc7d14dfc4)

My unclean fix still works though and may become useful to more people, since ubuntu 11.04 is due tomorrow. (April 28th)

thanks, it’s fixed now, but i haven’t tested it on newest versions if someone can confirm that is working

thanks! I Saw your fix, I’ll test it as soon as I get to my linux workstation.

The video fix seems to work on ubuntu 11.04, thanks.

Could you please tell me what revision contains the fix, I downloaded the latest one for 11.04 and I couldn’t get it to work…

you need to dowload from github as it’s adviced in the setup guide:

http://github.com/openframeworks/openFrameworks