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/FFmpegDecoderAudio.hpp

    r9869 r10851  
    44 
    55#include <OpenThreads/Thread> 
     6 
     7#include <osg/Timer> 
    68 
    79#include "FFmpegClocks.hpp" 
     
    3032 
    3133    void open(AVStream * stream); 
     34    void pause(bool pause); 
    3235    void close(bool waitForThreadToExit); 
    3336     
     
    5255 
    5356 
    54     PacketQueue &        m_packets; 
    55     FFmpegClocks &        m_clocks; 
    56     AVStream *            m_stream; 
    57     AVCodecContext *    m_context; 
    58     FFmpegPacket        m_packet; 
    59     const uint8_t *        m_packet_data; 
    60     int                    m_bytes_remaining; 
     57    PacketQueue &                       m_packets; 
     58    FFmpegClocks &                      m_clocks; 
     59    AVStream *                          m_stream; 
     60    AVCodecContext *                    m_context; 
     61    FFmpegPacket                        m_packet; 
     62    const uint8_t *                     m_packet_data; 
     63    int                                 m_bytes_remaining; 
    6164 
    62     Buffer                m_audio_buffer; 
    63     size_t                m_audio_buf_size; 
    64     size_t                m_audio_buf_index; 
     65    Buffer                              m_audio_buffer; 
     66    size_t                              m_audio_buf_size; 
     67    size_t                              m_audio_buf_index; 
    6568 
    66     int                    m_frequency; 
    67     int                    m_nb_channels; 
    68     osg::AudioStream::SampleFormat    m_sample_format; 
     69    int                                 m_frequency; 
     70    int                                 m_nb_channels; 
     71    osg::AudioStream::SampleFormat      m_sample_format; 
    6972 
    70     SinkPtr                m_audio_sink; 
     73    SinkPtr                             m_audio_sink; 
    7174 
    72     bool                m_end_of_stream; 
    73     volatile bool        m_exit; 
     75    osg::Timer                          m_pause_timer; 
     76 
     77    bool                                m_end_of_stream; 
     78    bool                                m_paused; 
     79    volatile bool                       m_exit; 
    7480}; 
    7581