Re: little program, big problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Fri, Mar 28, 2003 at 09:46:12AM +0100, Ronald Bultje wrote:
> On Fri, 2003-03-28 at 07:57, Ottavio Campana wrote:
> > When I run it I get "mmap:  Invalid argument" and then segfault. What is
> > invalid for mmap?
> 
> As far as I could see, you're not running VIDIOCGMBUF before mmap()'ing.
> You need to allocate/request the buffers (that's what VIDIOCGMBUF does)
> before using them.

I'm having a little progress. It doesn't  die any more, but I don't have
got the data anyway.

I've added:

struct video_mbuf b;
...
b.size = v.width*v.height*3;
b.frames = 1;
...
if(ioctl(fd, VIDIOCGFBUF, &b)<0) perror("VIDIOCGFBUF");

and then

map= (void*) mmap(0, b.size, PROT_READ|PROT_READ, MAP_SHARED,
fd, 0);

but mmap returns pointer to 0x0

I'm looking  for an example to  study, but I haven't  find anything. Can
you please tell me a good link or adjust my buggy source?

-- 
Non c'è più forza nella normalità, c'è solo monotonia.





[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux