void Xv411Grabber::setsize() { int w = capwin_->basewidth() / decimate_; int h = capwin_->baseheight() / decimate_; capwin_->setsize(w, h); capwin_->converter(RGB_Converter_411::instance()); set_size_411(w, h); allocref(); }
void XvCIFGrabber::setsize() { int w = 2 * 352 / decimate_; int h = 2 * 288 / decimate_; capwin_->setsize(w, h); capwin_->converter(RGB_Converter_411::instance()); set_size_411(w, h); allocref(); }
void DirectShowCIFGrabber::setsize() { int w; int h; w = basewidth_ / decimate_; h = baseheight_ / decimate_; debug_msg("DirectShowCIFGrabber::setsize: %dx%d\n", w, h); set_size_cif(w, h); allocref(); }
int xengrant(domid_t domid, ulong frame, int flags) { int ref; grant_entry_t *gt; if ((ref = allocref()) < 0) panic("out of xengrant refs"); gt = &granttab[ref]; gt->frame = frame; gt->domid = domid; coherence(); gt->flags = flags; return ref; }
void V4lGrabber::format() { struct video_channel channel; debug_msg("V4l: format\n"); width_ = CIF_WIDTH * 2 / decimate_; height_ = CIF_HEIGHT * 2 / decimate_; // FIXED by barz 2006/9/19: YUV422 is default if (have_420P) v4lformat_ = VIDEO_PALETTE_YUV420P; else v4lformat_ = VIDEO_PALETTE_YUV422; switch (cformat_) { case CF_CIF: set_size_411(width_, height_); debug_msg(" cif"); break; case CF_411: set_size_411(width_, height_); debug_msg(" 411"); break; case CF_422: set_size_422(width_, height_); if (have_422P) { v4lformat_ = VIDEO_PALETTE_YUV422P; debug_msg("Capturing directly in 422 Planar\n"); } debug_msg(" 422"); break; } if (have_mmap) { gb_even.frame = 0; gb_even.format = v4lformat_; gb_even.width = width_; gb_even.height = height_; gb_odd.frame = 1; gb_odd.format = v4lformat_; gb_odd.width = width_; gb_odd.height = height_; } else { memset(&win, 0, sizeof(win)); win.width = width_; win.height = height_; debug_msg("Setting palette to %d", pict.palette); if (-1 == ioctl(fd_, VIDIOCSWIN, &win)) perror("ioctl VIDIOCSWIN"); if (-1 == ioctl(fd_, VIDIOCGWIN, &win)) perror("ioctl VIDIOCGWIN"); width_ = win.width; height_ = win.height; pict.palette = v4lformat_; if (-1 == ioctl(fd_, VIDIOCSPICT, &pict)) { perror("ioctl VIDIOCSPICT"); } } // barz: get pict to setup the white blance if (-1 == ioctl(fd_, VIDIOCGPICT, &pict)) { perror("ioctl VIDIOCGPICT"); } debug_msg(" size=%dx%d\n", width_, height_); bzero(&channel, sizeof(struct video_channel)); if (-1 == ioctl(fd_, VIDIOCGCHAN, &channel)) perror("ioctl VIDIOCGCHAN"); channel.channel = port_; channel.norm = norm_; if (-1 == ioctl(fd_, VIDIOCSCHAN, &channel)) perror("ioctl VIDIOCSCHAN"); debug_msg(" port=%d\n", port_); debug_msg(" norm=%d\n", norm_); allocref(); }