VFL1: Programming with it

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



Hi,

For brevity, by application and setup is at the end of this email.  Here are
the questions:

1. How does the VIDIOCGMBUF ioctl call and the mmap call work together?  How
does the driver/api know where to put the captured video data?  First, I  do
an ioctl(fd, VIDIOCGMBUF, &video_mmbuf) tells me what the buffer size is.
(buffer size on the card?  in the driver?  what?), and the number of frames
it can handle (number of frames = how many addresses it can keep track of,
right? (which is hardware dependent yes?)).  Then I call mmap, but I only
tell mmap which file and how much memory I want.  MMap is a call to Linux.
How does the driver/card know to put the captured images in the memory
allocated by mmap()?  As far as I can tell I never actually told the driver
where the memory was allocated to, let alone if it was allocated at all.  I
just asked how much it needed.  I DID allocate memory, but I didn't tell the
driver/card where it is.  How does it know?

2.  Why can't I use malloc() instead of mmap()?  What is the significance of
allocating memory after a special file?  In the man page for mmap, it says
it allocates memory 'after' the file, why after it?  Does it matter where
the memory is allocated as long as the relevant code knows where that is?

3.  My application wants to use all of the available physical memory, no
virtual memory.  Has anyone every tried to malloc 200 Megabytes of RAM?
Does that work?  Are there any tricks to doing this?

4.  Does the call ioctl(fd, VIDIOCSYNC, framenumber) block?

4.5  How can I be sure that I won't be malloc'ed virtual memory?

5.  How can I find out how much physical (not virtual) memory is available
from:
a) the command line
b) from a C program

6.  Gcc produces a.out files.  Apparently, a.out is redundant and some new
format called ELF does the same thing but in a newer way, thus making a.out
obsolete.  As far as I am concerned, will I run in to trouble using these
a.out files?

7.  How do I start a new thread (the POSIX standard way? can't remember what
it's called!)

8. If the video card and/or it's driver can capture directly into the frame
buffer of my video card, can I make it capture right into my buffers (which
are allocated with malloc)?

9.  After each frame is captured, can I update the address of the buffer of
the next frame so that even if the card itself only supports two buffers, as
reported by VIDIOCGMBUF ioctl call, I could store to RAM as long as I got
there in time to change the vector before it started storing the data?

Thanks!
David.


Application:

I am making a program to record hi-def video.  I want to record at max
possible resolution and frame rate for my hardware setup.  Since hard disks
are too slow, I am using  lot of RAM as the buffer.  It is not a requirement
of this application to record for a long time, just to record at high
resolution/depth/framerate.  I do eventually store to disk when the user
hits a key.

Setup:

K6-200.  Generic BT878 (PV591 3DDemon).  256Meg ram.  RH 7.3 workstation
install.  Standard videodev.h file that came with RH7.3.  Standard driver
for the BT848 or 878.  Absolutely no idea what versions of videodev.h and
bttv.c are.






[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