Changeset 4054

Show
Ignore:
Timestamp:
10/12/07 17:45:23 (1 year ago)
Author:
hverkuil
Message:

Fix MPEG1 resizing.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ivtv/branches/0.10/driver/ivtv-ioctl.c

    r3973 r4054  
    465465        // set window size 
    466466        if (fmt->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) { 
     467                struct cx2341x_mpeg_params *p = &itv->params; 
    467468                int w = fmt->fmt.pix.width; 
    468469                int h = fmt->fmt.pix.height; 
     
    476477                fmt->fmt.pix.height = h; 
    477478#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18) 
    478                 if (itv->params.width != 720 || itv->params.height != (itv->is_50hz ? 576 : 480)) 
    479                         itv->params.video_temporal_filter = 0; 
     479                if (p->width != 720 || p->height != (itv->is_50hz ? 576 : 480)) 
     480                        p->video_temporal_filter = 0; 
    480481                else 
    481                         itv->params.video_temporal_filter = 8; 
     482                        p->video_temporal_filter = 8; 
    482483#endif 
    483484 
    484                 if (!set_fmt || (itv->params.width == w && itv->params.height == h)) 
     485                if (!set_fmt || (p->width == w && p->height == h)) 
    485486                        return 0; 
    486487                if (atomic_read(&itv->capturing) > 0) 
    487488                        return -EBUSY; 
    488489 
    489                 itv->params.width = w; 
    490                 itv->params.height = h; 
     490                p->width = w; 
     491                p->height = h; 
    491492                if (w != 720 || h != (itv->is_50hz ? 576 : 480)) 
    492                         itv->params.video_temporal_filter = 0; 
     493                        p->video_temporal_filter = 0; 
    493494                else 
    494                         itv->params.video_temporal_filter = 8; 
     495                        p->video_temporal_filter = 8; 
     496                if (p->video_encoding == V4L2_MPEG_VIDEO_ENCODING_MPEG_1) 
     497                        fmt->fmt.pix.width /= 2; 
    495498                itv->video_dec_func(itv, VIDIOC_S_FMT, fmt); 
    496499                return ivtv_get_fmt(itv, streamtype, fmt);