xref: /aosp_15_r20/external/webrtc/pc/rtp_sender_proxy.h (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1 /*
2  *  Copyright 2021 The WebRTC project authors. All Rights Reserved.
3  *
4  *  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.
9  */
10 
11 #ifndef PC_RTP_SENDER_PROXY_H_
12 #define PC_RTP_SENDER_PROXY_H_
13 
14 #include <memory>
15 #include <string>
16 #include <vector>
17 
18 #include "api/rtp_sender_interface.h"
19 #include "pc/proxy.h"
20 
21 namespace webrtc {
22 
23 // Define proxy for RtpSenderInterface.
24 // TODO(deadbeef): Move this to .cc file. What threads methods are called on is
25 // an implementation detail.
26 BEGIN_PRIMARY_PROXY_MAP(RtpSender)
27 PROXY_PRIMARY_THREAD_DESTRUCTOR()
28 PROXY_METHOD1(bool, SetTrack, MediaStreamTrackInterface*)
29 PROXY_CONSTMETHOD0(rtc::scoped_refptr<MediaStreamTrackInterface>, track)
30 PROXY_CONSTMETHOD0(rtc::scoped_refptr<DtlsTransportInterface>, dtls_transport)
31 PROXY_CONSTMETHOD0(uint32_t, ssrc)
32 BYPASS_PROXY_CONSTMETHOD0(cricket::MediaType, media_type)
33 BYPASS_PROXY_CONSTMETHOD0(std::string, id)
34 PROXY_CONSTMETHOD0(std::vector<std::string>, stream_ids)
35 PROXY_CONSTMETHOD0(std::vector<RtpEncodingParameters>, init_send_encodings)
36 PROXY_CONSTMETHOD0(RtpParameters, GetParameters)
37 PROXY_METHOD1(RTCError, SetParameters, const RtpParameters&)
38 PROXY_METHOD2(void,
39               SetParametersAsync,
40               const RtpParameters&,
41               SetParametersCallback)
42 PROXY_CONSTMETHOD0(rtc::scoped_refptr<DtmfSenderInterface>, GetDtmfSender)
43 PROXY_METHOD1(void,
44               SetFrameEncryptor,
45               rtc::scoped_refptr<FrameEncryptorInterface>)
46 PROXY_CONSTMETHOD0(rtc::scoped_refptr<FrameEncryptorInterface>,
47                    GetFrameEncryptor)
48 PROXY_METHOD1(void, SetStreams, const std::vector<std::string>&)
49 PROXY_METHOD1(void,
50               SetEncoderToPacketizerFrameTransformer,
51               rtc::scoped_refptr<FrameTransformerInterface>)
52 PROXY_METHOD1(void,
53               SetEncoderSelector,
54               std::unique_ptr<VideoEncoderFactory::EncoderSelectorInterface>)
55 PROXY_METHOD1(RTCError, GenerateKeyFrame, const std::vector<std::string>&)
56 END_PROXY_MAP(RtpSender)
57 
58 }  // namespace webrtc
59 
60 #endif  // PC_RTP_SENDER_PROXY_H_
61