niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 1 | /* |
leozwang@webrtc.org | 39e9659 | 2012-03-01 18:22:48 +0000 | [diff] [blame] | 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 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 | |
mflodman@webrtc.org | 511f82e | 2011-11-30 18:31:36 +0000 | [diff] [blame] | 11 | // ViESyncModule is responsible for synchronization audio and video for a given |
| 12 | // VoE and ViE channel couple. |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 13 | |
mflodman@webrtc.org | 511f82e | 2011-11-30 18:31:36 +0000 | [diff] [blame] | 14 | #ifndef WEBRTC_VIDEO_ENGINE_VIE_SYNC_MODULE_H_ |
| 15 | #define WEBRTC_VIDEO_ENGINE_VIE_SYNC_MODULE_H_ |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 16 | |
pbos@webrtc.org | f5d4cb1 | 2013-05-17 13:44:48 +0000 | [diff] [blame] | 17 | #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" |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 22 | |
mflodman@webrtc.org | 511f82e | 2011-11-30 18:31:36 +0000 | [diff] [blame] | 23 | namespace webrtc { |
| 24 | |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 25 | class CriticalSectionWrapper; |
| 26 | class RtpRtcp; |
| 27 | class VideoCodingModule; |
stefan@webrtc.org | 7c3523c | 2012-09-11 07:00:42 +0000 | [diff] [blame] | 28 | class ViEChannel; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 29 | class VoEVideoSync; |
| 30 | |
mflodman@webrtc.org | 511f82e | 2011-11-30 18:31:36 +0000 | [diff] [blame] | 31 | class ViESyncModule : public Module { |
| 32 | public: |
stefan@webrtc.org | 7c3523c | 2012-09-11 07:00:42 +0000 | [diff] [blame] | 33 | ViESyncModule(VideoCodingModule* vcm, |
| 34 | ViEChannel* vie_channel); |
mflodman@webrtc.org | 511f82e | 2011-11-30 18:31:36 +0000 | [diff] [blame] | 35 | ~ViESyncModule(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 36 | |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 37 | int ConfigureSync(int voe_channel_id, |
| 38 | VoEVideoSync* voe_sync_interface, |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 39 | RtpRtcp* video_rtcp_module, |
| 40 | RtpReceiver* video_receiver); |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 41 | |
mflodman@webrtc.org | 511f82e | 2011-11-30 18:31:36 +0000 | [diff] [blame] | 42 | int VoiceChannel(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 43 | |
mikhal@webrtc.org | ef9f76a | 2013-02-15 23:22:18 +0000 | [diff] [blame] | 44 | // Set target delay for buffering mode (0 = real-time mode). |
mikhal@webrtc.org | efe4edb | 2013-03-06 23:29:33 +0000 | [diff] [blame] | 45 | int SetTargetBufferingDelay(int target_delay_ms); |
mikhal@webrtc.org | ef9f76a | 2013-02-15 23:22:18 +0000 | [diff] [blame] | 46 | |
mflodman@webrtc.org | 511f82e | 2011-11-30 18:31:36 +0000 | [diff] [blame] | 47 | // Implements Module. |
pbos@webrtc.org | b238d12 | 2013-04-09 13:41:51 +0000 | [diff] [blame] | 48 | virtual int32_t TimeUntilNextProcess(); |
| 49 | virtual int32_t Process(); |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 50 | |
mflodman@webrtc.org | 511f82e | 2011-11-30 18:31:36 +0000 | [diff] [blame] | 51 | private: |
mflodman@webrtc.org | d32c447 | 2011-12-22 14:17:53 +0000 | [diff] [blame] | 52 | scoped_ptr<CriticalSectionWrapper> data_cs_; |
pwestin@webrtc.org | 2853dde | 2012-05-11 11:08:54 +0000 | [diff] [blame] | 53 | VideoCodingModule* vcm_; |
stefan@webrtc.org | 7c3523c | 2012-09-11 07:00:42 +0000 | [diff] [blame] | 54 | ViEChannel* vie_channel_; |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 55 | RtpReceiver* video_receiver_; |
stefan@webrtc.org | 7c3523c | 2012-09-11 07:00:42 +0000 | [diff] [blame] | 56 | RtpRtcp* video_rtp_rtcp_; |
mflodman@webrtc.org | 511f82e | 2011-11-30 18:31:36 +0000 | [diff] [blame] | 57 | int voe_channel_id_; |
| 58 | VoEVideoSync* voe_sync_interface_; |
| 59 | TickTime last_sync_time_; |
stefan@webrtc.org | 5f28498 | 2012-06-28 07:51:16 +0000 | [diff] [blame] | 60 | scoped_ptr<StreamSynchronization> sync_; |
stefan@webrtc.org | 7c3523c | 2012-09-11 07:00:42 +0000 | [diff] [blame] | 61 | StreamSynchronization::Measurements audio_measurement_; |
| 62 | StreamSynchronization::Measurements video_measurement_; |
niklase@google.com | 470e71d | 2011-07-07 08:21:25 +0000 | [diff] [blame] | 63 | }; |
mflodman@webrtc.org | 511f82e | 2011-11-30 18:31:36 +0000 | [diff] [blame] | 64 | |
| 65 | } // namespace webrtc |
| 66 | |
| 67 | #endif // WEBRTC_VIDEO_ENGINE_VIE_SYNC_MODULE_H_ |