| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 // ViESyncModule is responsible for synchronization audio and video for a given | 11 // ViESyncModule is responsible for synchronization audio and video for a given |
| 12 // VoE and ViE channel couple. | 12 // VoE and ViE channel couple. |
| 13 | 13 |
| 14 #ifndef WEBRTC_VIDEO_VIE_SYNC_MODULE_H_ | 14 #ifndef WEBRTC_VIDEO_VIE_SYNC_MODULE_H_ |
| 15 #define WEBRTC_VIDEO_VIE_SYNC_MODULE_H_ | 15 #define WEBRTC_VIDEO_VIE_SYNC_MODULE_H_ |
| 16 | 16 |
| 17 #include <memory> | 17 #include <memory> |
| 18 | 18 |
| 19 #include "webrtc/base/criticalsection.h" | 19 #include "webrtc/base/criticalsection.h" |
| 20 #include "webrtc/modules/include/module.h" | 20 #include "webrtc/modules/include/module.h" |
| 21 #include "webrtc/system_wrappers/include/tick_util.h" | 21 #include "webrtc/system_wrappers/include/tick_util.h" |
| 22 #include "webrtc/video/stream_synchronization.h" | 22 #include "webrtc/video/stream_synchronization.h" |
| 23 #include "webrtc/voice_engine/include/voe_video_sync.h" | 23 #include "webrtc/voice_engine/include/voe_video_sync.h" |
| 24 | 24 |
| 25 namespace webrtc { | 25 namespace webrtc { |
| 26 | 26 |
| 27 class Clock; | 27 class Clock; |
| 28 class RtpRtcp; | 28 class RtpRtcp; |
| 29 class VideoCodingModule; | |
| 30 class VideoFrame; | 29 class VideoFrame; |
| 31 class ViEChannel; | 30 class ViEChannel; |
| 32 class VoEVideoSync; | 31 class VoEVideoSync; |
| 33 | 32 |
| 33 namespace vcm { |
| 34 class VideoReceiver; |
| 35 } // namespace vcm |
| 36 |
| 34 class ViESyncModule : public Module { | 37 class ViESyncModule : public Module { |
| 35 public: | 38 public: |
| 36 explicit ViESyncModule(VideoCodingModule* vcm); | 39 explicit ViESyncModule(vcm::VideoReceiver* vcm); |
| 37 ~ViESyncModule(); | 40 ~ViESyncModule(); |
| 38 | 41 |
| 39 void ConfigureSync(int voe_channel_id, | 42 void ConfigureSync(int voe_channel_id, |
| 40 VoEVideoSync* voe_sync_interface, | 43 VoEVideoSync* voe_sync_interface, |
| 41 RtpRtcp* video_rtcp_module, | 44 RtpRtcp* video_rtcp_module, |
| 42 RtpReceiver* video_receiver); | 45 RtpReceiver* rtp_receiver); |
| 43 | 46 |
| 44 // Implements Module. | 47 // Implements Module. |
| 45 int64_t TimeUntilNextProcess() override; | 48 int64_t TimeUntilNextProcess() override; |
| 46 void Process() override; | 49 void Process() override; |
| 47 | 50 |
| 48 // Gets the sync offset between the current played out audio frame and the | 51 // Gets the sync offset between the current played out audio frame and the |
| 49 // video |frame|. Returns true on success, false otherwise. | 52 // video |frame|. Returns true on success, false otherwise. |
| 50 bool GetStreamSyncOffsetInMs(const VideoFrame& frame, | 53 bool GetStreamSyncOffsetInMs(const VideoFrame& frame, |
| 51 int64_t* stream_offset_ms) const; | 54 int64_t* stream_offset_ms) const; |
| 52 | 55 |
| 53 private: | 56 private: |
| 54 rtc::CriticalSection data_cs_; | 57 rtc::CriticalSection data_cs_; |
| 55 VideoCodingModule* const vcm_; | 58 vcm::VideoReceiver* const video_receiver_; |
| 56 Clock* const clock_; | 59 Clock* const clock_; |
| 57 RtpReceiver* video_receiver_; | 60 RtpReceiver* rtp_receiver_; |
| 58 RtpRtcp* video_rtp_rtcp_; | 61 RtpRtcp* video_rtp_rtcp_; |
| 59 int voe_channel_id_; | 62 int voe_channel_id_; |
| 60 VoEVideoSync* voe_sync_interface_; | 63 VoEVideoSync* voe_sync_interface_; |
| 61 TickTime last_sync_time_; | 64 TickTime last_sync_time_; |
| 62 std::unique_ptr<StreamSynchronization> sync_; | 65 std::unique_ptr<StreamSynchronization> sync_; |
| 63 StreamSynchronization::Measurements audio_measurement_; | 66 StreamSynchronization::Measurements audio_measurement_; |
| 64 StreamSynchronization::Measurements video_measurement_; | 67 StreamSynchronization::Measurements video_measurement_; |
| 65 }; | 68 }; |
| 66 | 69 |
| 67 } // namespace webrtc | 70 } // namespace webrtc |
| 68 | 71 |
| 69 #endif // WEBRTC_VIDEO_VIE_SYNC_MODULE_H_ | 72 #endif // WEBRTC_VIDEO_VIE_SYNC_MODULE_H_ |
| OLD | NEW |