[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-video
Subject:    [V4L] V4L program problem
From:       tony Tong <chaffmanus () yahoo ! com>
Date:       2002-06-22 12:22:20
[Download RAW message or body]

I am using v4l programing for my v4l frame capture
card. and now I can use mmap capture to get my video .
it seems ok. But now I encounter a problem---how can I
change my capture size without close v4l card ?
The following is my code of changing size ,but it does
work . I dont know why.

set_size(int width,int height)
{
   gb_frame = 0;
   /* start to grab the first frame */
   gb_buf.frame = 1 - gb_frame;
   gb_buf.height = height;
   gb_buf.width = width;
   gb_buf.format = VIDEO_PALETTE_YUV420P;
        
   ret = ioctl(video_fd, VIDIOCMCAPTURE, &gb_buf);
   if (ret < 0 && errno != EAGAIN) {
            /* try YUV422 */
      gb_buf.format = VIDEO_PALETTE_YUV422;
      ret = ioctl(video_fd, VIDIOCMCAPTURE, &gb_buf);
      if (ret < 0 && errno != EAGAIN) {
	/* try RGB24 */
        gb_buf.format = VIDEO_PALETTE_RGB24;
        ret = ioctl(video_fd, VIDIOCMCAPTURE,
&gb_buf);
      }
   }
   if (ret < 0) {
     if (errno != EAGAIN) {
       fprintf(stderr, "Fatal: grab device does not
support suitable format\n");
       } else {
                fprintf(stderr,"Fatal: grab device
does not receive any video signal\n");
         }
            return 1;
    }
  return 0;
}
this function always return 1;ie ,it cannot
successfully exec ioctl functions.
but in my open  code , this part is also include in it
. it never fails. why this happen ? what lead to it ?
please give your help .
thanks in advance .


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com



_______________________________________________
Video4linux-list mailing list
Video4linux-list@redhat.com
https://listman.redhat.com/mailman/listinfo/video4linux-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic