root/OpenSceneGraph/trunk/src/osgPlugins/ffmpeg/FFmpegClocks.hpp @ 9816

Revision 9816, 1.3 kB (checked in by robert, 5 years ago)

From Tanguy Fautre (Aris Technologies), ffmpeg plugin

RevLine 
[9816]1
2#ifndef HEADER_GUARD_OSGFFMPEG_FFMPEG_CLOCKS_H
3#define HEADER_GUARD_OSGFFMPEG_FFMPEG_CLOCKS_H
4
5#include <osg/Timer>
6
7#include <OpenThreads/Mutex>
8#include <OpenThreads/ScopedLock>
9
10#include "FFmpegHeaders.hpp"
11
12
13
14namespace osgFFmpeg {
15
16
17
18class FFmpegClocks
19{
20public:
21
22    FFmpegClocks();
23
24    void reset(double start_time);
25    void rewindAudio();
26    void rewindVideo();
27
28    void audioSetBufferEndPts(double pts);
29    void audioAdjustBufferEndPts(double increment);
30    void audioSetDelay(double delay);
31    void audioDisable();
32
33    double videoSynchClock(const AVFrame * frame, double time_base, double pts);
34    double videoRefreshSchedule(double pts);
35
36    double getStartTime() const;
37
38private:
39
40    double getAudioTime() const;
41
42    typedef osg::Timer Timer;
43    typedef OpenThreads::Mutex Mutex;
44    typedef OpenThreads::ScopedLock<Mutex> ScopedLock;
45
46    mutable Mutex m_mutex;
47
48    double    m_video_clock;
49
50    double    m_start_time;
51    double    m_last_frame_delay;
52    double    m_last_frame_pts;
53    double    m_last_actual_delay;
54    double    m_frame_time;
55    double    m_audio_buffer_end_pts;
56    double    m_audio_delay;
57    Timer    m_audio_timer;
58    bool    m_audio_disabled;
59    bool    m_rewind;
60   
61};
62
63
64
65} // namespace osgFFmpeg
66
67
68
69#endif // HEADER_GUARD_OSGFFMPEG_FFMPEG_CLOCKS_H
Note: See TracBrowser for help on using the browser.