blob: e6ca5fd275db1eb427b1dabc425b6ba68b9c6987 [file] [log] [blame]
andrew@webrtc.orga7b57da2012-10-22 18:19:23 +00001/*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 *
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 */
10
11// ViESyncModule is responsible for synchronization audio and video for a given
12// VoE and ViE channel couple.
13
14#ifndef WEBRTC_VIDEO_ENGINE_VIE_SYNC_MODULE_H_
15#define WEBRTC_VIDEO_ENGINE_VIE_SYNC_MODULE_H_
16
pbos@webrtc.orgf2e6fb32013-05-17 13:44:48 +000017#include "webrtc/modules/interface/module.h"
18#include "webrtc/system_wrappers/interface/scoped_ptr.h"
19#include "webrtc/system_wrappers/interface/tick_util.h"
20#include "webrtc/video_engine/stream_synchronization.h"
21#include "webrtc/voice_engine/include/voe_video_sync.h"
andrew@webrtc.orga7b57da2012-10-22 18:19:23 +000022
23namespace webrtc {
24
25class CriticalSectionWrapper;
26class RtpRtcp;
27class VideoCodingModule;
28class ViEChannel;
29class VoEVideoSync;
30
31class ViESyncModule : public Module {
32 public:
33 ViESyncModule(VideoCodingModule* vcm,
34 ViEChannel* vie_channel);
35 ~ViESyncModule();
36
37 int ConfigureSync(int voe_channel_id,
38 VoEVideoSync* voe_sync_interface,
wu@webrtc.org55055d22013-08-15 23:38:54 +000039 RtpRtcp* video_rtcp_module,
40 RtpReceiver* video_receiver);
andrew@webrtc.orga7b57da2012-10-22 18:19:23 +000041
42 int VoiceChannel();
43
mikhal@webrtc.org4db69af2013-02-15 23:22:18 +000044 // Set target delay for buffering mode (0 = real-time mode).
mikhal@webrtc.orgace08232013-03-06 23:29:33 +000045 int SetTargetBufferingDelay(int target_delay_ms);
mikhal@webrtc.org4db69af2013-02-15 23:22:18 +000046
andrew@webrtc.orga7b57da2012-10-22 18:19:23 +000047 // Implements Module.
henrik.lundin@webrtc.org13275562014-09-11 06:20:28 +000048 virtual int32_t TimeUntilNextProcess() OVERRIDE;
49 virtual int32_t Process() OVERRIDE;
andrew@webrtc.orga7b57da2012-10-22 18:19:23 +000050
51 private:
52 scoped_ptr<CriticalSectionWrapper> data_cs_;
53 VideoCodingModule* vcm_;
54 ViEChannel* vie_channel_;
wu@webrtc.org55055d22013-08-15 23:38:54 +000055 RtpReceiver* video_receiver_;
andrew@webrtc.orga7b57da2012-10-22 18:19:23 +000056 RtpRtcp* video_rtp_rtcp_;
57 int voe_channel_id_;
58 VoEVideoSync* voe_sync_interface_;
59 TickTime last_sync_time_;
60 scoped_ptr<StreamSynchronization> sync_;
61 StreamSynchronization::Measurements audio_measurement_;
62 StreamSynchronization::Measurements video_measurement_;
63};
64
65} // namespace webrtc
66
67#endif // WEBRTC_VIDEO_ENGINE_VIE_SYNC_MODULE_H_