Show
Ignore:
Timestamp:
11/20/09 15:31:11 (4 years ago)
Author:
robert
Message:

From Rafa Gaitan, "Current ffmpeg plugin didn't support pause and seek, I have added this
functionality and I also modified osgmovie example to support "seek"."

Note from Robert Osfield, changes osgmovie to use '>' for the seek as '+' was already used in a separate submission that had been merged.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgmovie/osgmovie.cpp

    r10799 r10809  
    119119    bool            _trackMouse; 
    120120    ImageStreamList _imageStreamList; 
     121    unsigned int    _seekIncr; 
    121122 
    122123}; 
     
    238239                return true; 
    239240            } 
     241            else if (ea.getKey()=='>') 
     242            { 
     243                for(ImageStreamList::iterator itr=_imageStreamList.begin(); 
     244                    itr!=_imageStreamList.end(); 
     245                    ++itr) 
     246                { 
     247                    std::cout<<"Seeking"<<std::endl; 
     248                    if(_seekIncr > 3) _seekIncr = 0; 
     249                    double length = (*itr)->getLength(); 
     250                    double t_pos = (length/4.0f)*_seekIncr; 
     251                    //(*itr)->rewind(); 
     252                    (*itr)->seek(t_pos); 
     253                    (*itr)->play(); 
     254                    _seekIncr++; 
     255                } 
     256                return true; 
     257            } 
    240258            else if (ea.getKey()=='L') 
    241259            { 
     
    310328    usage.addKeyboardMouseBinding("-","Decrease speed of movie"); 
    311329    usage.addKeyboardMouseBinding("o","Display frame rate of movie"); 
     330    usage.addKeyboardMouseBinding(">","Advance the movie using seek"); 
    312331} 
    313332