|
有没有在linux下做摄像头数据采集的xdjm。我这个ioctl调用关于VIDIOCSPICT怎么用不起啊。。
以下是我的函数:
void camera_set_picture(int cam_fd, struct video_picture *vpic)
{
if (ioctl(cam_fd, VIDIOCGPICT, vpic) != -1)
{
vpic->palette = VIDEO_PALETTE_RGB24;//这句加上就会运行((1))
vpic->colour = 65535;//这句可以更改vpic->colour值;
errno = 0;
if (ioctl(cam_fd, VIDIOCSPICT, vpic) < 0)
{
perror("VIDIOCSPICT");//((1))
fprintf(stderr,"errno=%d\n",errno);
close(cam_fd);
exit(1);
}
}
if (1 == debugFlag)
{
fprintf(stderr,"\nthe following is coming from camera_set_picture method\n");
fprintf(stderr," debug info the colour-> %d\n",vpic->colour);
}
}
/*****************************************************************************/
我用if (ioctl(cam_fd, VIDIOCGPICT, vpic) < 0)
可以得到vpic->palette 值为15;
在videodev.h中定义如下:
#define VIDEO_PALETTE_GREY1/* Linear greyscale */
#define VIDEO_PALETTE_HI2402/* High 240 cube (BT84 */
#define VIDEO_PALETTE_RGB5653/* 565 16 bit RGB */
#define VIDEO_PALETTE_RGB244/* 24bit RGB */
#define VIDEO_PALETTE_RGB325/* 32bit RGB */
#define VIDEO_PALETTE_RGB5556/* 555 15bit RGB */
#define VIDEO_PALETTE_YUV4227/* YUV422 capture */
#define VIDEO_PALETTE_YUYV8
#define VIDEO_PALETTE_UYVY9/* The great thing about standards is ... */
#define VIDEO_PALETTE_YUV42010
#define VIDEO_PALETTE_YUV41111/* YUV411 capture */
#define VIDEO_PALETTE_RAW12/* RAW capture (BT84 */
#define VIDEO_PALETTE_YUV422P13/* YUV 4:2:2 Planar */
#define VIDEO_PALETTE_YUV411P14/* YUV 4:1:1 Planar */
#define VIDEO_PALETTE_YUV420P15/* YUV 4:2:0 Planar */
#define VIDEO_PALETTE_YUV410P16/* YUV 4:1:0 Planar */
#define VIDEO_PALETTE_PLANAR13/* start of planar entries */
#define VIDEO_PALETTE_COMPONENT 7/* start of component entries */
}; |
|