Re: Output jpeg-frames on DC10+

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hey Markus,

On Thu, 2003-01-23 at 09:51, Markus Nilsson wrote:
> 	//Store params
> 	bp.norm = 0; //PAL
> 	bp.quality = 100;
>     	bp.field_per_buff = 1;
>    	bp.img_width = 352;
> 	bp.img_height = 240;
> 	if (ioctl(vid_fd, MJPIOC_S_PARAMS, &bp) < 0) {
> 		cout << "***Error setting video parameters" << endl << "::" << strerror(errno) << endl;
>     	}

That's wrong. You need to set the width/height of the *unscaled* frame,
so 704/240 (field height!), and then use HorDcm/VerDcm/TmpDcm to scale
the frame to full size or double field/frame, in this case
bp.decimation=0 (which means 'manual' instead of 'auto'), bp.HorDcm=2,
bp.VerDcm=1, bp.TmpDcm=2  (see the API description provided in the
kernel package).

> 	/* REQBUFS */
> 	if(ioctl(vid_fd, MJPIOC_REQBUFS, &vm)<0) {
> 		cout << "***Error requesting buffers" << endl << "::" << strerror(errno) << endl;
> 	}
> 	/* mmap */
> 	vm.frames = 5;
> 	vm.size = 352*240*3*5; 

First set the vm.count and vm.size, then request buffers, you're doing
it the other way around. Your vm.size is a bit large, by the way (128k
is enough for this size), and vm.size is the size *per buffer*, not the
total size (again, see the API description provided in the kernel
package).

> void PS_VideoDriver::update() {

Looks good to me. :-).

Ronald

-- 
Ronald Bultje <rbultje@xxxxxxxxxxxxxxxxxxx>
Linux Video/Multimedia developer





[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux