andrew@webrtc.org | a7b57da | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 1 | /* |
| 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.org | f2e6fb3 | 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" |
andrew@webrtc.org | a7b57da | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 22 | |
| 23 | namespace webrtc { |
| 24 | |
| 25 | class CriticalSectionWrapper; |
| 26 | class RtpRtcp; |
| 27 | class VideoCodingModule; |
| 28 | class ViEChannel; |
| 29 | class VoEVideoSync; |
| 30 | |
| 31 | class 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.org | 55055d2 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 39 | RtpRtcp* video_rtcp_module, |
| 40 | RtpReceiver* video_receiver); |
andrew@webrtc.org | a7b57da | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 41 | |
| 42 | int VoiceChannel(); |
| 43 | |
mikhal@webrtc.org | 4db69af | 2013-02-15 23:22:18 +0000 | [diff] [blame] | 44 | // Set target delay for buffering mode (0 = real-time mode). |
mikhal@webrtc.org | ace0823 | 2013-03-06 23:29:33 +0000 | [diff] [blame] | 45 | int SetTargetBufferingDelay(int target_delay_ms); |
mikhal@webrtc.org | 4db69af | 2013-02-15 23:22:18 +0000 | [diff] [blame] | 46 | |
andrew@webrtc.org | a7b57da | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 47 | // Implements Module. |
henrik.lundin@webrtc.org | 1327556 | 2014-09-11 06:20:28 +0000 | [diff] [blame] | 48 | virtual int32_t TimeUntilNextProcess() OVERRIDE; |
| 49 | virtual int32_t Process() OVERRIDE; |
andrew@webrtc.org | a7b57da | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 50 | |
| 51 | private: |
| 52 | scoped_ptr<CriticalSectionWrapper> data_cs_; |
| 53 | VideoCodingModule* vcm_; |
| 54 | ViEChannel* vie_channel_; |
wu@webrtc.org | 55055d2 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 55 | RtpReceiver* video_receiver_; |
andrew@webrtc.org | a7b57da | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 56 | 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_ |