Re: Webcam init and get
- From: roberson@xxxxxxxxxxxxxxxxxx (Walter Roberson)
- Date: Thu, 29 May 2008 16:12:20 +0000 (UTC)
In article <slrng3tfk7.a3j.stefano.sabatini@xxxxxxxxxxxxxxxxxxxx>,
Stefano Sabatini <stefano.sabatini@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
On 2008-05-12, frakie <frakieack@xxxxxxxxx> wrote:
I need a simple and stupid few line source code to access my webcam.
You could consider using libavdevice from ffmpeg, video4linux and
video4windows should be supported, it is plain and portable C (but not
trivial to use, but that's the price you have to pay to deal with
multimedia).
http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/v4l2_8c-source.html
#include "config.h"
#include "libavformat/avformat.h"
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/time.h>
#include <asm/types.h>
#include <linux/videodev2.h>
#include <time.h>
That's not portable C !
C89 3.8.2 Source File Inclusion
[...]
There shall be an implementation-defined mapping between the
delimited sequence and the external source file name. The
implementation shall provide unique mappings for sequences
consisting of one or more letters (as defined in 2.2.1) followed
by a period (.) and a single letter. The implementation may ignore
distinctions of alphabetical case and restrict the mapping
to six significant characters before the period.
Now "libavformat/avformat.h" has more than six significant characters
before the period, so which, if any, file that will map to is
implementation-defined -- and thus not portable C.
--
"I like to build things, I like to do things. I am having
a lot of fun." -- Walter Chrysler
.
- References:
- Webcam init and get
- From: frakie
- Re: Webcam init and get
- From: Stefano Sabatini
- Webcam init and get
- Prev by Date: Re: completely stuck
- Next by Date: Re: Seg fault + string manipulation
- Previous by thread: Re: Webcam init and get
- Next by thread: Re: dns spoof
- Index(es):
Relevant Pages
|