7
7
#include < yangavutil/audio/YangAudioMix.h>
8
8
#include < yangutil/buffer/YangVideoBuffer.h>
9
9
10
+
10
11
enum YangSynType{
11
12
YANG_SYNC_AUDIO_MASTER, /* default choice */
12
13
YANG_SYNC_VIDEO_MASTER,
13
14
YANG_SYNC_EXTERNAL_CLOCK, /* synchronize to an external clock */
14
15
};
15
- #define Yang_Max_Audio_Intervaltime 20
16
- #define Yang_Max_Video_Intervaltime 40
17
- #define Yang_Video_Cache_time 0
16
+ #define Yang_Max_Audio_Intervaltime 25
17
+ #define Yang_Max_Video_Intervaltime 35
18
+ #define Yang_Video_Base_Update_Interval 600000 // 10*60*1000 //10m
19
+ #define Yang_Audio_Base_Update_Interval 600000 // 10*60*1000 //10m
20
+ #define Yang_Video_Cache_time 35
21
+ #define Yang_Audio_Cache_time 0
18
22
class YangSynBuffer // :public YangSynBufferI
19
23
{
20
24
public:
@@ -24,6 +28,8 @@ class YangSynBuffer //:public YangSynBufferI
24
28
int32_t m_width;
25
29
int32_t m_height;
26
30
void setTranstype (int transtype);
31
+ void setAudioClock (int paudioclock);
32
+ void setVideoClock (int pvideoclock);
27
33
28
34
public:
29
35
uint8_t * getVideoRef (YangFrame* pframe);
@@ -39,10 +45,8 @@ class YangSynBuffer //:public YangSynBufferI
39
45
void initClock ();
40
46
void setClock ();
41
47
42
- // int32_t playAudioFrame(YangFrame* pframe);
43
- bool playAudioFrame (int64_t pts);
44
- // int32_t playVideoFrame(YangFrame* pframe);
45
- int playVideoFrame (int64_t pts);
48
+ int playAudioFrame (int64_t pts);
49
+ int playVideoFrame (YangFrame* frame);
46
50
double compute_target_delay (double delay);
47
51
void video_refresh (int32_t pisaudio, double *remaining_time);
48
52
int32_t m_maxAudioMinus;
@@ -52,12 +56,13 @@ class YangSynBuffer //:public YangSynBufferI
52
56
bool m_isFirstAudio;
53
57
int32_t m_video_time_state;
54
58
void updateBaseTimestamp (int64_t pts);
55
-
59
+ void updateVideoBaseTimestamp (int64_t pts);
60
+ void updateAudioBaseTimestamp (int64_t pts);
56
61
private:
57
- // YangTime m_time;
58
- YangSynType m_synType;
62
+
63
+ YangSynType m_synType;
59
64
int32_t m_paused;
60
- int64_t m_baseClock,m_startClock ;
65
+ int64_t m_baseClock,m_audio_startClock ;
61
66
int32_t m_videoClock;
62
67
int32_t m_audioClock;
63
68
@@ -70,6 +75,10 @@ class YangSynBuffer //:public YangSynBufferI
70
75
int64_t m_videoTime;
71
76
int32_t m_audioMinus;
72
77
int32_t m_videoMinus;
78
+ int32_t m_audioNegativeCount;
79
+ int32_t m_audioTimeoutCount;
80
+ // int32_t m_keyFrameCount;
81
+
73
82
74
83
int64_t m_pre_audioTime;
75
84
int64_t m_pre_videoTime;
@@ -80,12 +89,6 @@ class YangSynBuffer //:public YangSynBufferI
80
89
private:
81
90
YangVideoBuffer *m_videoBuffer;
82
91
YangAudioPlayBuffer* m_audioBuffer;
83
-
84
-
85
-
86
-
87
-
88
-
89
92
};
90
93
91
94
#endif /* YANGPLAYER_INCLUDE_YANGAVSYN_H_ */
0 commit comments