Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(767)

Unified Diff: content/renderer/media/webrtc/rtc_rtp_receiver.h

Issue 2759953003: Interface RTCRtpReceiver and RTCPeerConnection.getReceivers() added. (Closed)
Patch Set: DISALLOW_COPY_AND_ASSIGN Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/webrtc/rtc_rtp_receiver.h
diff --git a/content/renderer/media/webrtc/rtc_rtp_receiver.h b/content/renderer/media/webrtc/rtc_rtp_receiver.h
new file mode 100644
index 0000000000000000000000000000000000000000..5bba6c395f744680ecdcd0200f1cb2424adb111c
--- /dev/null
+++ b/content/renderer/media/webrtc/rtc_rtp_receiver.h
@@ -0,0 +1,43 @@
+// Copyright (c) 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 CONTENT_RENDERER_MEDIA_WEBRTC_RTC_RTP_RECEIVER_H_
+#define CONTENT_RENDERER_MEDIA_WEBRTC_RTC_RTP_RECEIVER_H_
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "content/common/content_export.h"
+#include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
+#include "third_party/WebKit/public/platform/WebRTCRtpReceiver.h"
+#include "third_party/webrtc/api/rtpreceiverinterface.h"
+
+namespace content {
+
+// Used to surface |webrtc::RtpReceiverInterface| to blink. Multiple
+// |RTCRtpReceiver|s could reference the same webrtc receiver; |id| is the value
+// of the pointer to the webrtc receiver.
+class CONTENT_EXPORT RTCRtpReceiver : public blink::WebRTCRtpReceiver {
+ public:
+ static uintptr_t getId(
+ const webrtc::RtpReceiverInterface* webrtc_rtp_receiver);
+
+ RTCRtpReceiver(webrtc::RtpReceiverInterface* webrtc_rtp_receiver,
+ const blink::WebMediaStreamTrack& web_track);
+ ~RTCRtpReceiver() override;
+
+ uintptr_t id() const override;
+
+ const blink::WebMediaStreamTrack& track() const override;
+ const webrtc::MediaStreamTrackInterface& webrtc_track() const;
+
+ private:
+ const scoped_refptr<webrtc::RtpReceiverInterface> webrtc_rtp_receiver_;
+ const blink::WebMediaStreamTrack web_track_;
+
+ DISALLOW_COPY_AND_ASSIGN(RTCRtpReceiver);
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_MEDIA_WEBRTC_RTC_RTP_RECEIVER_H_
« no previous file with comments | « content/renderer/media/rtc_peer_connection_handler_unittest.cc ('k') | content/renderer/media/webrtc/rtc_rtp_receiver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698