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

Revision 10161, 1.3 kB (checked in by robert, 6 years ago)

From Jean-Sebastien Guay, changed the timing control for when no audio layer is supplied.

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();
[10161]32    bool audioDisabled() const { return m_audio_disabled; }
[9816]33
34    double videoSynchClock(const AVFrame * frame, double time_base, double pts);
35    double videoRefreshSchedule(double pts);
36
37    double getStartTime() const;
38
39private:
40
41    double getAudioTime() const;
42
43    typedef osg::Timer Timer;
44    typedef OpenThreads::Mutex Mutex;
45    typedef OpenThreads::ScopedLock<Mutex> ScopedLock;
46
47    mutable Mutex m_mutex;
48
49    double    m_video_clock;
50
51    double    m_start_time;
52    double    m_last_frame_delay;
53    double    m_last_frame_pts;
54    double    m_last_actual_delay;
55    double    m_frame_time;
56    double    m_audio_buffer_end_pts;
57    double    m_audio_delay;
58    Timer    m_audio_timer;
59    bool    m_audio_disabled;
60    bool    m_rewind;
61   
62};
63
64
65
66} // namespace osgFFmpeg
67
68
69
70#endif // HEADER_GUARD_OSGFFMPEG_FFMPEG_CLOCKS_H
Note: See TracBrowser for help on using the browser.