2011-07-07 08:21:25 +00:00
|
|
|
/*
|
2012-03-01 18:22:48 +00:00
|
|
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
2011-07-07 08:21:25 +00:00
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2011-11-30 18:31:36 +00:00
|
|
|
// ViESyncModule is responsible for synchronization audio and video for a given
|
|
|
|
|
// VoE and ViE channel couple.
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2011-11-30 18:31:36 +00:00
|
|
|
#ifndef WEBRTC_VIDEO_ENGINE_VIE_SYNC_MODULE_H_
|
|
|
|
|
#define WEBRTC_VIDEO_ENGINE_VIE_SYNC_MODULE_H_
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-05-17 13:44:48 +00:00
|
|
|
#include "webrtc/modules/interface/module.h"
|
|
|
|
|
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
|
|
|
|
|
#include "webrtc/system_wrappers/interface/tick_util.h"
|
|
|
|
|
#include "webrtc/video_engine/stream_synchronization.h"
|
|
|
|
|
#include "webrtc/voice_engine/include/voe_video_sync.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2011-11-30 18:31:36 +00:00
|
|
|
namespace webrtc {
|
|
|
|
|
|
2011-07-07 08:21:25 +00:00
|
|
|
class CriticalSectionWrapper;
|
|
|
|
|
class RtpRtcp;
|
|
|
|
|
class VideoCodingModule;
|
2012-09-11 07:00:42 +00:00
|
|
|
class ViEChannel;
|
2011-07-07 08:21:25 +00:00
|
|
|
class VoEVideoSync;
|
|
|
|
|
|
2011-11-30 18:31:36 +00:00
|
|
|
class ViESyncModule : public Module {
|
|
|
|
|
public:
|
2012-09-11 07:00:42 +00:00
|
|
|
ViESyncModule(VideoCodingModule* vcm,
|
|
|
|
|
ViEChannel* vie_channel);
|
2011-11-30 18:31:36 +00:00
|
|
|
~ViESyncModule();
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2012-05-11 11:08:54 +00:00
|
|
|
int ConfigureSync(int voe_channel_id,
|
|
|
|
|
VoEVideoSync* voe_sync_interface,
|
2013-08-15 23:38:54 +00:00
|
|
|
RtpRtcp* video_rtcp_module,
|
|
|
|
|
RtpReceiver* video_receiver);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2012-05-11 11:08:54 +00:00
|
|
|
int VoiceChannel();
|
2012-05-10 23:01:04 +00:00
|
|
|
|
2013-02-15 23:22:18 +00:00
|
|
|
// Set target delay for buffering mode (0 = real-time mode).
|
2013-03-06 23:29:33 +00:00
|
|
|
int SetTargetBufferingDelay(int target_delay_ms);
|
2013-02-15 23:22:18 +00:00
|
|
|
|
2011-11-30 18:31:36 +00:00
|
|
|
// Implements Module.
|
2014-09-11 06:20:28 +00:00
|
|
|
virtual int32_t TimeUntilNextProcess() OVERRIDE;
|
|
|
|
|
virtual int32_t Process() OVERRIDE;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2011-11-30 18:31:36 +00:00
|
|
|
private:
|
2011-12-22 14:17:53 +00:00
|
|
|
scoped_ptr<CriticalSectionWrapper> data_cs_;
|
2012-05-11 11:08:54 +00:00
|
|
|
VideoCodingModule* vcm_;
|
2012-09-11 07:00:42 +00:00
|
|
|
ViEChannel* vie_channel_;
|
2013-08-15 23:38:54 +00:00
|
|
|
RtpReceiver* video_receiver_;
|
2012-09-11 07:00:42 +00:00
|
|
|
RtpRtcp* video_rtp_rtcp_;
|
2011-11-30 18:31:36 +00:00
|
|
|
int voe_channel_id_;
|
|
|
|
|
VoEVideoSync* voe_sync_interface_;
|
|
|
|
|
TickTime last_sync_time_;
|
2012-06-28 07:51:16 +00:00
|
|
|
scoped_ptr<StreamSynchronization> sync_;
|
2012-09-11 07:00:42 +00:00
|
|
|
StreamSynchronization::Measurements audio_measurement_;
|
|
|
|
|
StreamSynchronization::Measurements video_measurement_;
|
2011-11-30 18:31:36 +00:00
|
|
|
};
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2011-11-30 18:31:36 +00:00
|
|
|
} // namespace webrtc
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2011-11-30 18:31:36 +00:00
|
|
|
#endif // WEBRTC_VIDEO_ENGINE_VIE_SYNC_MODULE_H_
|