summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/platform/peerconnection/rtc_rtp_receiver_platform.h
blob: 47e063d842dec717da02cbf3ad8bc79a8b8d955e (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
54
55
56
57
58
59
60
61
62
63
// 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/renderer/platform/peerconnection/rtc_stats.h"
#include "third_party/blink/renderer/platform/platform_export.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
#include "third_party/blink/renderer/platform/wtf/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 RTCEncodedAudioStreamTransformer;
class RTCEncodedVideoStreamTransformer;
class RTCRtpSource;
class MediaStreamComponent;

// 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 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 MediaStreamComponent* Track() const = 0;
  virtual Vector<String> StreamIds() const = 0;
  virtual Vector<std::unique_ptr<RTCRtpSource>> GetSources() = 0;
  virtual void GetStats(RTCStatsReportCallback,
                        const Vector<webrtc::NonStandardGroupId>&) = 0;
  virtual std::unique_ptr<webrtc::RtpParameters> GetParameters() const = 0;
  virtual void SetJitterBufferMinimumDelay(
      base::Optional<double> delay_seconds) = 0;
  virtual RTCEncodedAudioStreamTransformer* GetEncodedAudioStreamTransformer()
      const {
    return nullptr;
  }
  virtual RTCEncodedVideoStreamTransformer* GetEncodedVideoStreamTransformer()
      const {
    return nullptr;
  }
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_PLATFORM_PEERCONNECTION_RTC_RTP_RECEIVER_PLATFORM_H_