summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/platform/peerconnection/rtc_rtp_receiver_platform.h
blob: ad18bf33776152bbcf0d25b23f58bbba82077ab6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_PEERCONNECTION_RTC_RTP_RECEIVER_PLATFORM_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_PEERCONNECTION_RTC_RTP_RECEIVER_PLATFORM_H_

#include <memory>

#include "base/optional.h"
#include "third_party/blink/public/platform/web_common.h"
#include "third_party/blink/public/platform/web_rtc_stats.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/platform/web_vector.h"
#include "third_party/webrtc/api/dtls_transport_interface.h"
#include "third_party/webrtc/api/rtp_parameters.h"
#include "third_party/webrtc/api/stats/rtc_stats.h"

namespace blink {

class RTCRtpSource;
class WebMediaStreamTrack;

// Implementations of this interface keep the corresponding WebRTC-layer
// receiver alive through reference counting. Multiple |RTCRtpReceiverPlatform|s
// could reference the same receiver, see |id|.
// https://w3c.github.io/webrtc-pc/#rtcrtpreceiver-interface
class BLINK_PLATFORM_EXPORT RTCRtpReceiverPlatform {
 public:
  virtual ~RTCRtpReceiverPlatform();

  virtual std::unique_ptr<RTCRtpReceiverPlatform> ShallowCopy() const = 0;
  // Two |RTCRtpReceiverPlatform|s referencing the same WebRTC-layer receiver
  // have the same |id|.
  virtual uintptr_t Id() const = 0;
  virtual rtc::scoped_refptr<webrtc::DtlsTransportInterface>
  DtlsTransport() = 0;
  // Note: For convenience, DtlsTransportInformation always returns a value.
  // The information is only interesting if DtlsTransport() is non-null.
  virtual webrtc::DtlsTransportInformation DtlsTransportInformation() = 0;
  virtual const WebMediaStreamTrack& Track() const = 0;
  virtual WebVector<WebString> StreamIds() const = 0;
  virtual WebVector<std::unique_ptr<RTCRtpSource>> GetSources() = 0;
  virtual void GetStats(blink::WebRTCStatsReportCallback,
                        const WebVector<webrtc::NonStandardGroupId>&) = 0;
  virtual std::unique_ptr<webrtc::RtpParameters> GetParameters() const = 0;
  virtual void SetJitterBufferMinimumDelay(
      base::Optional<double> delay_seconds) = 0;
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_PLATFORM_PEERCONNECTION_RTC_RTP_RECEIVER_PLATFORM_H_