Changeset 4152

Show
Ignore:
Timestamp:
05/23/08 17:26:57 (6 years ago)
Author:
piers
Message:

Renamed gettimeofday() functions with an appropriate suffix according to
whether they return seconds (secs) or microseconds (usecs).

Location:
vic/branches/mpeg4
Files:
12 modified

Legend:

Unmodified
Added
Removed
  • vic/branches/mpeg4/codec/decoder.cpp

    r3746 r4152  
    199199 * Return time of day in microseconds. 
    200200 */ 
    201 double Decoder::gettimeofday() 
     201double Decoder::gettimeofday_usecs() 
    202202{ 
    203203        timeval tv; 
  • vic/branches/mpeg4/codec/decoder.h

    r902 r4152  
    8383        static void allocshm(dmabuf&, int, int flag = 0); 
    8484        static void freeshm(dmabuf&); 
    85         static double gettimeofday(); 
     85        static double gettimeofday_usecs(); 
    8686 
    8787        virtual int command(int argc, const char*const* argv); 
  • vic/branches/mpeg4/rtp/transmitter.cpp

    r1037 r4152  
    9595} 
    9696 
    97 inline double Transmitter::gettimeofday() const 
     97/* Return time of day in seconds */ 
     98inline double Transmitter::gettimeofday_secs() const 
    9899{ 
    99100        timeval tv; 
     
    211212        if (!busy_) { 
    212213                double delay = txtime(pb); 
    213                 nextpkttime_ = gettimeofday() + delay; 
     214                nextpkttime_ = gettimeofday_secs() + delay; 
    214215                output(pb); 
    215216                /* 
     
    231232void Transmitter::timeout() 
    232233{ 
    233         double now = gettimeofday(); 
     234        double now = gettimeofday_secs(); 
    234235        for (;;) { 
    235236                pktbuf* p = head_; 
  • vic/branches/mpeg4/timer.cpp

    r898 r4152  
    6969} 
    7070 
    71 double Timer::gettimeofday() const 
     71double Timer::gettimeofday_usecs() const 
    7272{ 
    7373        timeval tv; 
  • vic/branches/mpeg4/timer.h

    r702 r4152  
    5151        inline void ssched(int seconds) { msched(1000 * seconds); } 
    5252        void cancel(); 
    53         double gettimeofday() const; 
     53        double gettimeofday_usecs() const; 
    5454protected: 
    5555        virtual void timeout() = 0; 
  • vic/branches/mpeg4/video/grabber-jv.cpp

    r3746 r4152  
    270270{ 
    271271        link(server_, TK_READABLE); 
    272         frameclock_ = gettimeofday(); 
     272        frameclock_ = gettimeofday_usecs(); 
    273273        kick(); 
    274274} 
  • vic/branches/mpeg4/video/grabber-mme.cpp

    r905 r4152  
    470470                return; 
    471471        running_ = 1; 
    472         frameclock_ = gettimeofday(); 
     472        frameclock_ = gettimeofday_usecs(); 
    473473 
    474474        outstanding_ = 0; 
  • vic/branches/mpeg4/video/grabber-rtvc.cpp

    r905 r4152  
    680680        setsize(); 
    681681        link(fd_, TK_READABLE); 
    682         double now = gettimeofday(); 
     682        double now = gettimeofday_usecs(); 
    683683        frameclock_ = now; 
    684684        nextframetime_ = now + tick(grab()); 
     
    699699void RTVCGrabber::dispatch(int) 
    700700{ 
    701         double now = gettimeofday(); 
     701        double now = gettimeofday_usecs(); 
    702702        if (nextframetime_ > now) { 
    703703                /* 
  • vic/branches/mpeg4/video/grabber-still.cpp

    r3746 r4152  
    187187void StillGrabber::start() 
    188188{ 
    189     frameclock_ = gettimeofday(); 
     189    frameclock_ = gettimeofday_usecs(); 
    190190 
    191191    timeout(); 
  • vic/branches/mpeg4/video/grabber-sunrise.cpp

    r3746 r4152  
    542542    } 
    543543 
    544     frameclock_ = gettimeofday(); 
     544    frameclock_ = gettimeofday_usecs(); 
    545545 
    546546    /* 
     
    881881 
    882882    running_ = 1; 
    883     frameclock_ = gettimeofday(); 
     883    frameclock_ = gettimeofday_usecs(); 
    884884    timeout(); 
    885885} 
  • vic/branches/mpeg4/video/grabber-xil.cpp

    r3746 r4152  
    471471 
    472472        //link(fd_, TK_READABLE); 
    473         double now = gettimeofday(); 
     473        double now = gettimeofday_usecs(); 
    474474        frameclock_ = now; 
    475475        nextframetime_ = now + tick(grab()); 
     
    485485{ 
    486486        UNUSED(mask); 
    487         double now = gettimeofday(); 
     487        double now = gettimeofday_usecs(); 
    488488        if (nextframetime_ > now) { 
    489489#if 0 
  • vic/branches/mpeg4/video/grabber.cpp

    r4112 r4152  
    203203 * suspended), give up and reset the frame clock. 
    204204 */ 
    205 double Grabber::tick(int n) 
    206 { 
    207         double frametime = 8e6 * double(n) / double(bps_); 
     205double Grabber::tick(int frameSize) 
     206{ 
     207        double frametime = 8e6 * double(frameSize) / double(bps_); // uSecs 
    208208        if (frametime < frametime_) { 
    209209                if (frametime * 2. < frametime_) 
     
    216216 
    217217        frameclock_ += frametime; 
    218         double now = gettimeofday(); 
     218        double now = gettimeofday_usecs(); 
    219219        double delta = frameclock_ - now; 
    220220        if (delta < -0.2e6) { 
     
    233233void Grabber::start() 
    234234{ 
    235         frameclock_ = gettimeofday(); 
     235        frameclock_ = gettimeofday_usecs(); 
    236236#ifndef WIN32 
    237237        timeout();