blob: ef4f0e113f36d297725e49ce17dcf530c0cdd3b3 [file] [log] [blame]
deadbeef6979b022015-09-24 16:47:53 -07001/*
kjellanderb24317b2016-02-10 07:54:43 -08002 * Copyright 2015 The WebRTC project authors. All Rights Reserved.
deadbeef6979b022015-09-24 16:47:53 -07003 *
kjellanderb24317b2016-02-10 07:54:43 -08004 * 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.
deadbeef6979b022015-09-24 16:47:53 -07009 */
10
deadbeef70ab1a12015-09-28 16:53:55 -070011// This file contains interfaces for RtpReceivers
12// http://w3c.github.io/webrtc-pc/#rtcrtpreceiver-interface
13
Henrik Kjellander15583c12016-02-10 10:53:12 +010014#ifndef WEBRTC_API_RTPRECEIVERINTERFACE_H_
15#define WEBRTC_API_RTPRECEIVERINTERFACE_H_
deadbeef70ab1a12015-09-28 16:53:55 -070016
17#include <string>
18
Henrik Kjellander15583c12016-02-10 10:53:12 +010019#include "webrtc/api/mediastreaminterface.h"
20#include "webrtc/api/proxy.h"
deadbeef70ab1a12015-09-28 16:53:55 -070021#include "webrtc/base/refcount.h"
22#include "webrtc/base/scoped_ref_ptr.h"
23
24namespace webrtc {
25
26class RtpReceiverInterface : public rtc::RefCountInterface {
27 public:
28 virtual rtc::scoped_refptr<MediaStreamTrackInterface> track() const = 0;
29
30 // Not to be confused with "mid", this is a field we can temporarily use
31 // to uniquely identify a receiver until we implement Unified Plan SDP.
32 virtual std::string id() const = 0;
33
34 virtual void Stop() = 0;
35
Taylor Brandstetterdb0cd9e2016-05-16 11:40:30 -070036 // The WebRTC specification only defines RTCRtpParameters in terms of senders,
37 // but this API also applies them to receivers, similar to ORTC:
38 // http://ortc.org/wp-content/uploads/2016/03/ortc.html#rtcrtpparameters*.
39 virtual RtpParameters GetParameters() const = 0;
40 virtual bool SetParameters(const RtpParameters& parameters) = 0;
41
deadbeef70ab1a12015-09-28 16:53:55 -070042 protected:
43 virtual ~RtpReceiverInterface() {}
44};
45
46// Define proxy for RtpReceiverInterface.
nisse72c8d2b2016-04-15 03:49:07 -070047BEGIN_SIGNALING_PROXY_MAP(RtpReceiver)
deadbeef70ab1a12015-09-28 16:53:55 -070048PROXY_CONSTMETHOD0(rtc::scoped_refptr<MediaStreamTrackInterface>, track)
49PROXY_CONSTMETHOD0(std::string, id)
50PROXY_METHOD0(void, Stop)
Taylor Brandstetterdb0cd9e2016-05-16 11:40:30 -070051PROXY_CONSTMETHOD0(RtpParameters, GetParameters);
52PROXY_METHOD1(bool, SetParameters, const RtpParameters&)
nisse72c8d2b2016-04-15 03:49:07 -070053END_SIGNALING_PROXY()
deadbeef70ab1a12015-09-28 16:53:55 -070054
55} // namespace webrtc
56
Henrik Kjellander15583c12016-02-10 10:53:12 +010057#endif // WEBRTC_API_RTPRECEIVERINTERFACE_H_