OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 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 RTCRtpSender_h | 5 #ifndef RTCRtpSender_h |
6 #define RTCRtpSender_h | 6 #define RTCRtpSender_h |
7 | 7 |
8 #include "platform/bindings/ScriptWrappable.h" | 8 #include "platform/bindings/ScriptWrappable.h" |
9 #include "platform/heap/GarbageCollected.h" | 9 #include "platform/heap/GarbageCollected.h" |
10 #include "platform/heap/Member.h" | 10 #include "platform/heap/Member.h" |
11 #include "platform/heap/Visitor.h" | 11 #include "platform/heap/Visitor.h" |
12 #include "platform/wtf/text/WTFString.h" | 12 #include "platform/wtf/text/WTFString.h" |
13 #include "public/platform/WebRTCRtpSender.h" | 13 #include "public/platform/WebRTCRtpSender.h" |
14 | 14 |
15 namespace blink { | 15 namespace blink { |
16 | 16 |
17 class MediaStreamTrack; | 17 class MediaStreamTrack; |
18 | 18 |
19 // https://w3c.github.io/webrtc-pc/#rtcrtpsender-interface | 19 // https://w3c.github.io/webrtc-pc/#rtcrtpsender-interface |
20 class RTCRtpSender final : public GarbageCollectedFinalized<RTCRtpSender>, | 20 class RTCRtpSender final : public GarbageCollectedFinalized<RTCRtpSender>, |
21 public ScriptWrappable { | 21 public ScriptWrappable { |
22 DEFINE_WRAPPERTYPEINFO(); | 22 DEFINE_WRAPPERTYPEINFO(); |
23 | 23 |
24 public: | 24 public: |
25 RTCRtpSender(std::unique_ptr<WebRTCRtpSender>, MediaStreamTrack*); | 25 RTCRtpSender(std::unique_ptr<WebRTCRtpSender>, MediaStreamTrack*); |
26 | 26 |
27 MediaStreamTrack* track(); | 27 MediaStreamTrack* track(); |
28 | 28 |
| 29 WebRTCRtpSender* web_rtp_sender(); |
| 30 // Sets the track. This must be called when the |WebRTCRtpSender| has its |
| 31 // track updated, and the |track| must match the |WebRTCRtpSender::Track|. |
| 32 void SetTrack(MediaStreamTrack*); |
| 33 |
29 DECLARE_VIRTUAL_TRACE(); | 34 DECLARE_VIRTUAL_TRACE(); |
30 | 35 |
31 private: | 36 private: |
32 std::unique_ptr<WebRTCRtpSender> sender_; | 37 std::unique_ptr<WebRTCRtpSender> sender_; |
33 Member<MediaStreamTrack> track_; | 38 Member<MediaStreamTrack> track_; |
34 }; | 39 }; |
35 | 40 |
36 } // namespace blink | 41 } // namespace blink |
37 | 42 |
38 #endif // RTCRtpSender_h | 43 #endif // RTCRtpSender_h |
OLD | NEW |