Show
Ignore:
Timestamp:
12/02/09 19:58:45 (3 years ago)
Author:
robert
Message:

From Julen Garcia,"I've been lately working also with the ffmpeg plugin and I implemented pause(), seek() and getReferenceTime(). I think that I have solved the internal clock issues (maybe not in the most elegant way :?"

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegDecoder.hpp

    r10809 r10851  
    7171    void seek(double time); 
    7272    void pause(); 
    73     void resume(); 
    7473 
    7574    void loop(bool loop); 
     
    7776 
    7877    double duration() const; 
     78    double reference(); 
    7979 
    8080    FFmpegDecoderAudio & audio_decoder(); 
     
    109109 
    110110    FormatContextPtr    m_format_context; 
    111     AVStream *            m_audio_stream; 
    112     AVStream *            m_video_stream; 
     111    AVStream *          m_audio_stream; 
     112    AVStream *          m_video_stream; 
    113113 
    114114    int                 m_audio_index; 
     
    117117    FFmpegClocks        m_clocks; 
    118118    FFmpegPacket        m_pending_packet; 
    119     PacketQueue            m_audio_queue; 
    120     PacketQueue            m_video_queue; 
     119    PacketQueue         m_audio_queue; 
     120    PacketQueue         m_video_queue; 
    121121     
    122     FFmpegDecoderAudio    m_audio_decoder; 
    123     FFmpegDecoderVideo    m_video_decoder; 
     122    FFmpegDecoderAudio  m_audio_decoder; 
     123    FFmpegDecoderVideo  m_video_decoder; 
    124124 
    125     double                m_duration; 
    126     double                m_start; 
     125    double              m_duration; 
     126    double              m_start; 
    127127 
    128     State                m_state; 
     128    State               m_state; 
    129129    bool                m_loop; 
    130130}; 
     
    149149{ 
    150150    return double(m_format_context->duration) / AV_TIME_BASE;     
     151} 
     152 
     153inline double FFmpegDecoder::reference() 
     154{ 
     155    return m_clocks.getCurrentTime();     
    151156} 
    152157