Bug 797671: Import Webrtc.org code from stable branch 3.12 (rev 2820) rs=jesup
[gecko.git] / media / webrtc / trunk / src / video_engine / vie_sync_module.h
blobc93d58621b8fdaa0296d2304be10af34a53d6419
1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
11 // ViESyncModule is responsible for synchronization audio and video for a given
12 // VoE and ViE channel couple.
14 #ifndef WEBRTC_VIDEO_ENGINE_VIE_SYNC_MODULE_H_
15 #define WEBRTC_VIDEO_ENGINE_VIE_SYNC_MODULE_H_
17 #include "modules/interface/module.h"
18 #include "system_wrappers/interface/scoped_ptr.h"
19 #include "system_wrappers/interface/tick_util.h"
21 namespace webrtc {
23 class CriticalSectionWrapper;
24 class RtpRtcp;
25 class StreamSynchronization;
26 class VideoCodingModule;
27 class VoEVideoSync;
29 class ViESyncModule : public Module {
30 public:
31 ViESyncModule(const int32_t channel_id, VideoCodingModule* vcm);
32 ~ViESyncModule();
34 int ConfigureSync(int voe_channel_id,
35 VoEVideoSync* voe_sync_interface,
36 RtpRtcp* video_rtcp_module);
38 int VoiceChannel();
40 // Implements Module.
41 virtual WebRtc_Word32 TimeUntilNextProcess();
42 virtual WebRtc_Word32 Process();
44 private:
45 scoped_ptr<CriticalSectionWrapper> data_cs_;
46 const int32_t channel_id_;
47 VideoCodingModule* vcm_;
48 RtpRtcp* video_rtcp_module_;
49 int voe_channel_id_;
50 VoEVideoSync* voe_sync_interface_;
51 TickTime last_sync_time_;
52 scoped_ptr<StreamSynchronization> sync_;
55 } // namespace webrtc
57 #endif // WEBRTC_VIDEO_ENGINE_VIE_SYNC_MODULE_H_