int lost[INPUT_MANY];
int merit[180];
- struct timeval timeval0;
- struct timeval timeval1;
- struct timeval timeval2;
- struct timeval timeval3;
- struct timeval timeval6;
- struct timeval timeval7;
- struct timeval timeval8;
long long int dnbydt;
int video_interface;
int write_vt(struct usb_device *, u16, u16);
int isdongle(struct easycap *);
/*---------------------------------------------------------------------------*/
-struct signed_div_result {
- long long int quotient;
- unsigned long long int remainder;
-} signed_div(long long int, long long int);
/*---------------------------------------------------------------------------*/
switch (peasycap->mute) {
case 1: {
peasycap->audio_idle = 1;
- peasycap->timeval0.tv_sec = 0;
SAM("adjusting mute: %i=peasycap->audio_idle\n",
peasycap->audio_idle);
return 0;
peasycap->video_idle = 1;
peasycap->audio_idle = 1;
- peasycap->timeval0.tv_sec = 0;
/*---------------------------------------------------------------------------*/
/*
* IF THE WAIT QUEUES ARE NOT CLEARED IN RESPONSE TO THE STREAMOFF COMMAND
peasycap->video_eof = 0;
peasycap->audio_eof = 0;
- do_gettimeofday(&peasycap->timeval7);
/*---------------------------------------------------------------------------*/
/*
* RESTORE INPUT AND FORCE REFRESH OF STANDARD, FORMAT, ETC.
int
field2frame(struct easycap *peasycap)
{
- struct timeval timeval;
- long long int above, below;
- u32 remainder;
- struct signed_div_result sdr;
void *pex, *pad;
int kex, kad, mex, mad, rex, rad, rad2;
if (peasycap->field_read == peasycap->field_fill)
SAM("WARNING: on exit, filling field buffer %i\n",
peasycap->field_read);
-/*---------------------------------------------------------------------------*/
-/*
- * CALCULATE VIDEO STREAMING RATE
- */
-/*---------------------------------------------------------------------------*/
- do_gettimeofday(&timeval);
- if (peasycap->timeval6.tv_sec) {
- below = ((long long int)(1000000)) *
- ((long long int)(timeval.tv_sec -
- peasycap->timeval6.tv_sec)) +
- (long long int)(timeval.tv_usec - peasycap->timeval6.tv_usec);
- above = (long long int)1000000;
-
- sdr = signed_div(above, below);
- above = sdr.quotient;
- remainder = (u32)sdr.remainder;
-
- JOM(8, "video streaming at %3lli.%03i fields per second\n",
- above, (remainder/1000));
- }
- peasycap->timeval6 = timeval;
if (caches)
JOM(8, "%i=caches\n", caches);
return 0;
}
-/*****************************************************************************/
-struct signed_div_result
-signed_div(long long int above, long long int below)
-{
- struct signed_div_result sdr;
-
- if (((0 <= above) && (0 <= below)) || ((0 > above) && (0 > below))) {
- sdr.remainder = (unsigned long long int) do_div(above, below);
- sdr.quotient = (long long int) above;
- } else {
- if (0 > above)
- above = -above;
- if (0 > below)
- below = -below;
- sdr.remainder = (unsigned long long int) do_div(above, below);
- sdr.quotient = -((long long int) above);
- }
- return sdr;
-}
-/*****************************************************************************/
/*---------------------------------------------------------------------------*/
/*
* DECIMATION AND COLOURSPACE CONVERSION.
wake_up_interruptible
(&(peasycap->
wq_video));
- do_gettimeofday
- (&peasycap->timeval7);
} else {
peasycap->video_junk++;
if (bad & 0x0010)