hi guyes
i am developing an embedded application which has reduced size of rootfs, i have 20Mbyte of space an i can't use mjpeg_stream (plus its dependencies) in order to access the USB-camera; i need a dummy device which can be accessed directly by /dev/video0 without any need to have
- jpeg library do decode the CAM stream -> i need a raw data, not compressed, usb-cam
- UAV dependent cam (which requires other libraries and support) -> i need a dummy char dev device, accessible as "file"
to examplify, i need something like this
#include <stdio.h>
#include <stdlib.h>
#define SIZE 307200 // number of pixels (640x480)
int main()
{
FILE *camera;
FILE *grab;
float data[SIZE];
long len;
camera = fopen("/dev/video0", "rb");
if (camera != NULL)
{
grab = fopen("grab.raw", "wb");
if (grab != NULL)
{
len = fread(data, sizeof(data[0]), SIZE, camera);
fwrite(data, sizeof(data[0]), SIZE, grab);
fclose(grab);
if (len == 0)
{
printf("camera has no data\n");
}
else
{
printf("camera has %lu data\n", len);
}
}
fclose(camera);
}
else
{
printf("no camera device\n");
}
return 0;
}
actually i have a pair of Microsoft Corp. LifeCam HD-3000, it supported by linux but it does not seem to be possible to access and handle it directly
any suggestion/experience ?