Hi,

for A/V-sync I'm measuring the frame rate of current screen with
two WaitForSync() calls. for VIA unichrome I get some strange result:
A/V sync seems to be OK (no frames dropped) when time is set hardcoded.
Without that I'll get:

[dfb] Display frame time is 99949 microseconds
[dfb] Display frame time is 99950 microseconds

used code is:

  if (videoLayer)
  {
      struct timeval  tv1, tv2, tv3;
      int             t1, t2, t3;

    try
    {
      videoLayer->GetScreen()->WaitForSync();
      gettimeofday(&tv1,NULL);
      videoLayer->GetScreen()->WaitForSync();
      gettimeofday(&tv2,NULL);
      videoLayer->GetScreen()->WaitForSync();
      gettimeofday(&tv3,NULL);
    }
    catch (DFBException *ex)
    {
      fprintf (stderr,"[dfb] GetDisplayFrameTime: action=%s, result=%s\n",
               ex->GetAction(), ex->GetResult());
      delete ex;
      tv1.tv_sec = tv2.tv_sec = tv1.tv_usec = tv2.tv_usec = 0;
    }
    t1 = (tv1.tv_sec & 1) * 1000000 + tv1.tv_usec;
    t2 = (tv2.tv_sec & 1) * 1000000 + tv2.tv_usec;
    t3 = (tv3.tv_sec & 1) * 1000000 + tv3.tv_usec;
    fprintf (stderr,"[dfb] Display frame time is %d microseconds\n", t2 - t1);
    fprintf (stderr,"[dfb] Display frame time is %d microseconds\n", t3 - t2);
    displayTimeUS = t2 - t1;
    displayTimeUS = 16667;
  }

-- 
Stefan Lucke


_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to