| OLD | NEW |
| 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_RTC_RTP_RECEIVER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_RTC_RTP_RECEIVER_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_RTC_RTP_RECEIVER_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_RTC_RTP_RECEIVER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 11 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" | 11 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
| 12 #include "third_party/WebKit/public/platform/WebRTCRtpReceiver.h" | 12 #include "third_party/WebKit/public/platform/WebRTCRtpReceiver.h" |
| 13 #include "third_party/webrtc/api/rtpreceiverinterface.h" | 13 #include "third_party/webrtc/api/rtpreceiverinterface.h" |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 | 16 |
| 17 // Used to surface |webrtc::RtpReceiverInterface| to blink. Multiple | 17 // Used to surface |webrtc::RtpReceiverInterface| to blink. Multiple |
| 18 // |RTCRtpReceiver|s could reference the same webrtc receiver; |id| is the value | 18 // |RTCRtpReceiver|s could reference the same webrtc receiver; |id| is the value |
| 19 // of the pointer to the webrtc receiver. | 19 // of the pointer to the webrtc receiver. |
| 20 class CONTENT_EXPORT RTCRtpReceiver : public blink::WebRTCRtpReceiver { | 20 class CONTENT_EXPORT RTCRtpReceiver : public blink::WebRTCRtpReceiver { |
| 21 public: | 21 public: |
| 22 static uintptr_t getId( | 22 static uintptr_t getId( |
| 23 const webrtc::RtpReceiverInterface* webrtc_rtp_receiver); | 23 const webrtc::RtpReceiverInterface* webrtc_rtp_receiver); |
| 24 | 24 |
| 25 RTCRtpReceiver(webrtc::RtpReceiverInterface* webrtc_rtp_receiver, | 25 RTCRtpReceiver(webrtc::RtpReceiverInterface* webrtc_rtp_receiver, |
| 26 const blink::WebMediaStreamTrack& web_track); | 26 const blink::WebMediaStreamTrack& web_track); |
| 27 ~RTCRtpReceiver() override; | 27 ~RTCRtpReceiver() override; |
| 28 | 28 |
| 29 uintptr_t Id() const override; | 29 uintptr_t Id() const override; |
| 30 const blink::WebMediaStreamTrack& Track() const override; |
| 31 blink::WebVector<std::unique_ptr<blink::WebRTCRtpContributingSource>> |
| 32 GetSources() override; |
| 30 | 33 |
| 31 const blink::WebMediaStreamTrack& Track() const override; | |
| 32 const webrtc::MediaStreamTrackInterface& webrtc_track() const; | 34 const webrtc::MediaStreamTrackInterface& webrtc_track() const; |
| 33 | 35 |
| 34 private: | 36 private: |
| 35 const scoped_refptr<webrtc::RtpReceiverInterface> webrtc_rtp_receiver_; | 37 const scoped_refptr<webrtc::RtpReceiverInterface> webrtc_rtp_receiver_; |
| 36 const blink::WebMediaStreamTrack web_track_; | 38 const blink::WebMediaStreamTrack web_track_; |
| 37 | 39 |
| 38 DISALLOW_COPY_AND_ASSIGN(RTCRtpReceiver); | 40 DISALLOW_COPY_AND_ASSIGN(RTCRtpReceiver); |
| 39 }; | 41 }; |
| 40 | 42 |
| 41 } // namespace content | 43 } // namespace content |
| 42 | 44 |
| 43 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_RTC_RTP_RECEIVER_H_ | 45 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_RTC_RTP_RECEIVER_H_ |
| OLD | NEW |