[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Original]
Re: [transcode-users] Recording from v4l2?
On Wed, 2004-12-22 at 12:47 -0500, Adam K Kirchhoff wrote:
> I do have some experience with C, though it's been a number of years
> since I took those classes in college. I actually have a little bit of
> free time coming up, so I'll take a stab at it and see what I can come
> up with.
Something like this (not tested):
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <linux/types.h>
#include <linux/videodev2.h>
int main(char ** argv, int argc)
{
struct v4l2_fmtdesc fmt;
int fd, ix;
if((fd = open("/dev/video0", O_RDWR, 0)) < 0)
{
fprintf(stderr, "cannot open video device\n");
close(fd);
exit(1);
}
for(ix = 0; ix < 100; ix++)
{
memset(&fmt, 0, sizeof(fmt));
fmt.index = ix;
fmt.type = V4L2_BUF_TYPE_CAPTURE;
if(ioctl(fd, VIDIOC_ENUM_FMT, &fmt))
{
perror("VIDIOC_ENUM_FMT");
close(fd);
exit(2);
}
printf("%x %c%c%c%c %s\n", fmt.pixelformat, (fmt.pixelformat >>
24) &
255, (fmt.pixelformat >> 16) & 255, (fmt.pixelformat >> 8) & 255,
fmt.pixelformat & 255, fmt.description);
}
close(fd);
return(0);
}
- Re: [transcode-users] Recording from v4l2?, (continued)
- Re: [transcode-users] Recording from v4l2?, Jacob Meuser, 2004/12/22
- Re: [transcode-users] Recording from v4l2?, Adam K Kirchhoff, 2004/12/22
- Re: [transcode-users] Recording from v4l2?, Erik Slagter, 2004/12/22
- Re: [transcode-users] Recording from v4l2?, Adam K Kirchhoff, 2004/12/22
- Re: [transcode-users] Recording from v4l2?, Erik Slagter, 2004/12/22
- Re: [transcode-users] Recording from v4l2?, Adam K Kirchhoff, 2004/12/22
- Re: [transcode-users] Recording from v4l2?, Erik Slagter, 2004/12/22
- Re: [transcode-users] Recording from v4l2?, Erik Slagter, 2004/12/22
- Re: [transcode-users] Recording from v4l2?, Adam K Kirchhoff, 2004/12/22
- Re: [transcode-users] Recording from v4l2?, Erik Slagter, 2004/12/22
- Re: [transcode-users] Recording from v4l2?,
Erik Slagter <=
- Re: [transcode-users] Recording from v4l2?, Adam K Kirchhoff, 2004/12/23
- Re: [transcode-users] Recording from v4l2?, Erik Slagter, 2004/12/24
- Re: [transcode-users] Recording from v4l2?, Jacob Meuser, 2004/12/23
- Re: [transcode-users] Recording from v4l2?, Erik Slagter, 2004/12/22
- Re: [transcode-users] Recording from v4l2?, Jacob Meuser, 2004/12/22
- Re: [transcode-users] Recording from v4l2?, Erik Slagter, 2004/12/23
- Re: [transcode-users] Recording from v4l2?, Jacob Meuser, 2004/12/23
- Re: [transcode-users] Recording from v4l2?, Erik Slagter, 2004/12/23
- Re: [transcode-users] Recording from v4l2?, Erik Slagter, 2004/12/21
- Re: [transcode-users] Recording from v4l2?, Erik Slagter, 2004/12/21