LibWebRTCRtpTransceiverBackend.h [plain text]
#pragma once
#if ENABLE(WEB_RTC) && USE(LIBWEBRTC)
#include "LibWebRTCMacros.h"
#include "LibWebRTCRtpSenderBackend.h"
#include "RTCRtpTransceiverBackend.h"
ALLOW_UNUSED_PARAMETERS_BEGIN
#include <webrtc/api/rtp_transceiver_interface.h>
#include <webrtc/api/scoped_refptr.h>
ALLOW_UNUSED_PARAMETERS_END
namespace WebCore {
class LibWebRTCRtpReceiverBackend;
class LibWebRTCRtpTransceiverBackend final : public RTCRtpTransceiverBackend {
WTF_MAKE_FAST_ALLOCATED;
public:
explicit LibWebRTCRtpTransceiverBackend(rtc::scoped_refptr<webrtc::RtpTransceiverInterface>&& rtcTransceiver)
: m_rtcTransceiver(WTFMove(rtcTransceiver))
{
}
std::unique_ptr<LibWebRTCRtpReceiverBackend> createReceiverBackend();
std::unique_ptr<LibWebRTCRtpSenderBackend> createSenderBackend(LibWebRTCPeerConnectionBackend&, LibWebRTCRtpSenderBackend::Source&&);
webrtc::RtpTransceiverInterface* rtcTransceiver() { return m_rtcTransceiver.get(); }
private:
RTCRtpTransceiverDirection direction() const final;
Optional<RTCRtpTransceiverDirection> currentDirection() const final;
void setDirection(RTCRtpTransceiverDirection) final;
String mid() final;
void stop() final;
bool stopped() const final;
ExceptionOr<void> setCodecPreferences(const Vector<RTCRtpCodecCapability>&) final;
rtc::scoped_refptr<webrtc::RtpTransceiverInterface> m_rtcTransceiver;
};
}
#endif // ENABLE(WEB_RTC) && USE(LIBWEBRTC)