Ruslan Burakov | 493a650 | 2019-02-27 15:32:48 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2019 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 | #ifndef PC_PLAYOUT_LATENCY_INTERFACE_H_ |
| 12 | #define PC_PLAYOUT_LATENCY_INTERFACE_H_ |
| 13 | |
| 14 | #include <stdint.h> |
| 15 | |
| 16 | #include "media/base/delayable.h" |
| 17 | #include "rtc_base/ref_count.h" |
| 18 | |
| 19 | namespace webrtc { |
| 20 | |
| 21 | // PlayoutLatency delivers user's latency queries to the underlying media |
| 22 | // channel. It can describe either video or audio latency for receiving stream. |
| 23 | // "Interface" suffix in the interface name is required to be compatible with |
| 24 | // api/proxy.cc |
| 25 | class PlayoutLatencyInterface : public rtc::RefCountInterface { |
| 26 | public: |
| 27 | // OnStart allows to uniqely identify to which receiving stream playout |
| 28 | // latency must correpond through |media_channel| and |ssrc| pair. |
| 29 | virtual void OnStart(cricket::Delayable* media_channel, uint32_t ssrc) = 0; |
| 30 | |
| 31 | // Indicates that underlying receiving stream is stopped. |
| 32 | virtual void OnStop() = 0; |
| 33 | |
| 34 | // Sets latency in seconds. |
| 35 | virtual void SetLatency(double latency) = 0; |
| 36 | |
| 37 | // Returns latency in seconds. |
| 38 | virtual double GetLatency() const = 0; |
| 39 | }; |
| 40 | |
| 41 | } // namespace webrtc |
| 42 | |
| 43 | #endif // PC_PLAYOUT_LATENCY_INTERFACE_H_ |