Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Oct 2007 12:37:56 +0300
From:      Achilleas Mantzios <achill@matrix.gatewaynet.com>
To:        Mark Tinguely <tinguely@casselton.net>
Cc:        freebsd-multimedia@freebsd.org
Subject:   Re: Zoneminder and multichannel cards
Message-ID:  <200710111237.57114.achill@matrix.gatewaynet.com>
In-Reply-To: <200710051443.l95EhAOV066689@casselton.net>
References:  <200710051443.l95EhAOV066689@casselton.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Scrap the previous message, due to typos,
please consider this one.

Just a question, in context with our previous discussions.
I managed to capture video from more than 1 camera, in zoneminder.
I'd like to ask, whats the theoritical max fps for each of 4 cameras using the 
bktr driver in its FreeBSD-6.2 state?

In my code, with METEOR_CAP_CONTINOUS (single camera) it can do
(as ZM reports) 25 fps (which AFAIK is good), whereas with all 4 cameras
and by using METEOR_CAP_SINGLE, the fps drop down to 2.5 fps/camera.

Is that the max the driver can do, or is my code in trouble?
Where is what i do (pseudocode):

void initialize() {
/* at this point we dont know if this is single, or we have more cameras */
	if (this is the first camera) { 
		c = METEOR_CAP_CONTINOUS;
	        ioctl(m_videohandle, METEORCAPTUR, &c);
	}
}

void PreCapture(int channel) {
	if (number_of_cameras > 1) { 
/* this runs only when number of cameras are 2 or more */
		/*stop continous capture */
		int tmpc = METEOR_CAP_STOP_CONT;
/*1*/		ioctl(m_videohandle, METEORCAPTUR, &tmpc); 

		/* set the input */
		int tmpint=bktr_dev[channel];
/*2*/		ioctl(m_videohandle, METEORSINPUT, &tmpint);

		/* 3 set single capture mode */
		tmpc = METEOR_CAP_SINGLE;
/*3*/		ioctl(m_videohandle, METEORCAPTUR, &tmpc); 
	}
}


The PreCapture method is not called when number_of_cameras == 1. In this case 
the driver always works in METEOR_CAP_CONTINOUS mode.
In case (number_of_cameras > 1), the operations "1" and "3" are needed to be 
run only the first time that PreCapture() is run to cope with the setting of 
initialize(). Subsequent runs dont need "1","3".

Has the above code any flaws?
If i try to remove syscalls "1","3" from runs 2,3,4,... whould i have better 
performance?

Any ideas are wellcome.
-- 
Achilleas Mantzios



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200710111237.57114.achill>