rtpsender interface: make pure virtual again
after providing default implementations in Chromium tests BUG=None Change-Id: I53bf26b3a99416f4005e7df75b9b86dfbf2489cb Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/273100 Commit-Queue: Philipp Hancke <phancke@microsoft.com> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/main@{#37941}
This commit is contained in:
committed by
WebRTC LUCI CQ
parent
cc62b747c4
commit
021512b76a
@ -208,7 +208,6 @@ rtc_library("libjingle_peerconnection_api") {
|
|||||||
"peer_connection_interface.h",
|
"peer_connection_interface.h",
|
||||||
"rtp_receiver_interface.cc",
|
"rtp_receiver_interface.cc",
|
||||||
"rtp_receiver_interface.h",
|
"rtp_receiver_interface.h",
|
||||||
"rtp_sender_interface.cc",
|
|
||||||
"rtp_sender_interface.h",
|
"rtp_sender_interface.h",
|
||||||
"rtp_transceiver_interface.cc",
|
"rtp_transceiver_interface.cc",
|
||||||
"rtp_transceiver_interface.h",
|
"rtp_transceiver_interface.h",
|
||||||
|
|||||||
@ -1,36 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2018 The WebRTC Project Authors. All rights reserved.
|
|
||||||
*
|
|
||||||
* Use of this source code is governed by a BSD-style license
|
|
||||||
* that can be found in the LICENSE file in the root of the source
|
|
||||||
* tree. An additional intellectual property rights grant can be found
|
|
||||||
* in the file PATENTS. All contributing project authors may
|
|
||||||
* be found in the AUTHORS file in the root of the source tree.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "api/rtp_sender_interface.h"
|
|
||||||
|
|
||||||
namespace webrtc {
|
|
||||||
|
|
||||||
void RtpSenderInterface::SetFrameEncryptor(
|
|
||||||
rtc::scoped_refptr<FrameEncryptorInterface> frame_encryptor) {}
|
|
||||||
|
|
||||||
rtc::scoped_refptr<FrameEncryptorInterface>
|
|
||||||
RtpSenderInterface::GetFrameEncryptor() const {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<RtpEncodingParameters> RtpSenderInterface::init_send_encodings()
|
|
||||||
const {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
rtc::scoped_refptr<DtlsTransportInterface> RtpSenderInterface::dtls_transport()
|
|
||||||
const {
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void RtpSenderInterface::SetEncoderToPacketizerFrameTransformer(
|
|
||||||
rtc::scoped_refptr<FrameTransformerInterface> frame_transformer) {}
|
|
||||||
|
|
||||||
} // namespace webrtc
|
|
||||||
@ -43,8 +43,7 @@ class RTC_EXPORT RtpSenderInterface : public rtc::RefCountInterface {
|
|||||||
// The dtlsTransport attribute exposes the DTLS transport on which the
|
// The dtlsTransport attribute exposes the DTLS transport on which the
|
||||||
// media is sent. It may be null.
|
// media is sent. It may be null.
|
||||||
// https://w3c.github.io/webrtc-pc/#dom-rtcrtpsender-transport
|
// https://w3c.github.io/webrtc-pc/#dom-rtcrtpsender-transport
|
||||||
// TODO(https://bugs.webrtc.org/907849) remove default implementation
|
virtual rtc::scoped_refptr<DtlsTransportInterface> dtls_transport() const = 0;
|
||||||
virtual rtc::scoped_refptr<DtlsTransportInterface> dtls_transport() const;
|
|
||||||
|
|
||||||
// Returns primary SSRC used by this sender for sending media.
|
// Returns primary SSRC used by this sender for sending media.
|
||||||
// Returns 0 if not yet determined.
|
// Returns 0 if not yet determined.
|
||||||
@ -67,13 +66,13 @@ class RTC_EXPORT RtpSenderInterface : public rtc::RefCountInterface {
|
|||||||
// Sets the IDs of the media streams associated with this sender's track.
|
// Sets the IDs of the media streams associated with this sender's track.
|
||||||
// These are signalled in the SDP so that the remote side can associate
|
// These are signalled in the SDP so that the remote side can associate
|
||||||
// tracks.
|
// tracks.
|
||||||
virtual void SetStreams(const std::vector<std::string>& stream_ids) {}
|
virtual void SetStreams(const std::vector<std::string>& stream_ids) = 0;
|
||||||
|
|
||||||
// Returns the list of encoding parameters that will be applied when the SDP
|
// Returns the list of encoding parameters that will be applied when the SDP
|
||||||
// local description is set. These initial encoding parameters can be set by
|
// local description is set. These initial encoding parameters can be set by
|
||||||
// PeerConnection::AddTransceiver, and later updated with Get/SetParameters.
|
// PeerConnection::AddTransceiver, and later updated with Get/SetParameters.
|
||||||
// TODO(orphis): Make it pure virtual once Chrome has updated
|
// TODO(orphis): Make it pure virtual once Chrome has updated
|
||||||
virtual std::vector<RtpEncodingParameters> init_send_encodings() const;
|
virtual std::vector<RtpEncodingParameters> init_send_encodings() const = 0;
|
||||||
|
|
||||||
virtual RtpParameters GetParameters() const = 0;
|
virtual RtpParameters GetParameters() const = 0;
|
||||||
// Note that only a subset of the parameters can currently be changed. See
|
// Note that only a subset of the parameters can currently be changed. See
|
||||||
@ -89,20 +88,21 @@ class RTC_EXPORT RtpSenderInterface : public rtc::RefCountInterface {
|
|||||||
// using the user provided encryption mechanism regardless of whether SRTP is
|
// using the user provided encryption mechanism regardless of whether SRTP is
|
||||||
// enabled or not.
|
// enabled or not.
|
||||||
virtual void SetFrameEncryptor(
|
virtual void SetFrameEncryptor(
|
||||||
rtc::scoped_refptr<FrameEncryptorInterface> frame_encryptor);
|
rtc::scoped_refptr<FrameEncryptorInterface> frame_encryptor) = 0;
|
||||||
|
|
||||||
// Returns a pointer to the frame encryptor set previously by the
|
// Returns a pointer to the frame encryptor set previously by the
|
||||||
// user. This can be used to update the state of the object.
|
// user. This can be used to update the state of the object.
|
||||||
virtual rtc::scoped_refptr<FrameEncryptorInterface> GetFrameEncryptor() const;
|
virtual rtc::scoped_refptr<FrameEncryptorInterface> GetFrameEncryptor()
|
||||||
|
const = 0;
|
||||||
|
|
||||||
virtual void SetEncoderToPacketizerFrameTransformer(
|
virtual void SetEncoderToPacketizerFrameTransformer(
|
||||||
rtc::scoped_refptr<FrameTransformerInterface> frame_transformer);
|
rtc::scoped_refptr<FrameTransformerInterface> frame_transformer) = 0;
|
||||||
|
|
||||||
// Sets a user defined encoder selector.
|
// Sets a user defined encoder selector.
|
||||||
// Overrides selector that is (optionally) provided by VideoEncoderFactory.
|
// Overrides selector that is (optionally) provided by VideoEncoderFactory.
|
||||||
virtual void SetEncoderSelector(
|
virtual void SetEncoderSelector(
|
||||||
std::unique_ptr<VideoEncoderFactory::EncoderSelectorInterface>
|
std::unique_ptr<VideoEncoderFactory::EncoderSelectorInterface>
|
||||||
encoder_selector) {}
|
encoder_selector) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
~RtpSenderInterface() override = default;
|
~RtpSenderInterface() override = default;
|
||||||
|
|||||||
@ -11,6 +11,7 @@
|
|||||||
#ifndef API_TEST_MOCK_RTPSENDER_H_
|
#ifndef API_TEST_MOCK_RTPSENDER_H_
|
||||||
#define API_TEST_MOCK_RTPSENDER_H_
|
#define API_TEST_MOCK_RTPSENDER_H_
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@ -30,10 +31,15 @@ class MockRtpSender : public RtpSenderInterface {
|
|||||||
track,
|
track,
|
||||||
(),
|
(),
|
||||||
(const, override));
|
(const, override));
|
||||||
|
MOCK_METHOD(rtc::scoped_refptr<DtlsTransportInterface>,
|
||||||
|
dtls_transport,
|
||||||
|
(),
|
||||||
|
(const override));
|
||||||
MOCK_METHOD(uint32_t, ssrc, (), (const, override));
|
MOCK_METHOD(uint32_t, ssrc, (), (const, override));
|
||||||
MOCK_METHOD(cricket::MediaType, media_type, (), (const, override));
|
MOCK_METHOD(cricket::MediaType, media_type, (), (const, override));
|
||||||
MOCK_METHOD(std::string, id, (), (const, override));
|
MOCK_METHOD(std::string, id, (), (const, override));
|
||||||
MOCK_METHOD(std::vector<std::string>, stream_ids, (), (const, override));
|
MOCK_METHOD(std::vector<std::string>, stream_ids, (), (const, override));
|
||||||
|
MOCK_METHOD(void, SetStreams, (const std::vector<std::string>&), (override));
|
||||||
MOCK_METHOD(std::vector<RtpEncodingParameters>,
|
MOCK_METHOD(std::vector<RtpEncodingParameters>,
|
||||||
init_send_encodings,
|
init_send_encodings,
|
||||||
(),
|
(),
|
||||||
@ -44,6 +50,22 @@ class MockRtpSender : public RtpSenderInterface {
|
|||||||
GetDtmfSender,
|
GetDtmfSender,
|
||||||
(),
|
(),
|
||||||
(const, override));
|
(const, override));
|
||||||
|
MOCK_METHOD(void,
|
||||||
|
SetFrameEncryptor,
|
||||||
|
(rtc::scoped_refptr<FrameEncryptorInterface>),
|
||||||
|
(override));
|
||||||
|
MOCK_METHOD(rtc::scoped_refptr<FrameEncryptorInterface>,
|
||||||
|
GetFrameEncryptor,
|
||||||
|
(),
|
||||||
|
(const, override));
|
||||||
|
MOCK_METHOD(void,
|
||||||
|
SetEncoderToPacketizerFrameTransformer,
|
||||||
|
(rtc::scoped_refptr<FrameTransformerInterface>),
|
||||||
|
(override));
|
||||||
|
MOCK_METHOD(void,
|
||||||
|
SetEncoderSelector,
|
||||||
|
(std::unique_ptr<VideoEncoderFactory::EncoderSelectorInterface>),
|
||||||
|
(override));
|
||||||
};
|
};
|
||||||
|
|
||||||
static_assert(!std::is_abstract_v<rtc::RefCountedObject<MockRtpSender>>, "");
|
static_assert(!std::is_abstract_v<rtc::RefCountedObject<MockRtpSender>>, "");
|
||||||
|
|||||||
@ -11,6 +11,7 @@
|
|||||||
#ifndef PC_TEST_MOCK_RTP_SENDER_INTERNAL_H_
|
#ifndef PC_TEST_MOCK_RTP_SENDER_INTERNAL_H_
|
||||||
#define PC_TEST_MOCK_RTP_SENDER_INTERNAL_H_
|
#define PC_TEST_MOCK_RTP_SENDER_INTERNAL_H_
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@ -71,6 +72,14 @@ class MockRtpSenderInternal : public RtpSenderInternal {
|
|||||||
GetFrameEncryptor,
|
GetFrameEncryptor,
|
||||||
(),
|
(),
|
||||||
(const, override));
|
(const, override));
|
||||||
|
MOCK_METHOD(void,
|
||||||
|
SetEncoderToPacketizerFrameTransformer,
|
||||||
|
(rtc::scoped_refptr<FrameTransformerInterface>),
|
||||||
|
(override));
|
||||||
|
MOCK_METHOD(void,
|
||||||
|
SetEncoderSelector,
|
||||||
|
(std::unique_ptr<VideoEncoderFactory::EncoderSelectorInterface>),
|
||||||
|
(override));
|
||||||
|
|
||||||
// RtpSenderInternal methods.
|
// RtpSenderInternal methods.
|
||||||
MOCK_METHOD1(SetMediaChannel, void(cricket::MediaChannel*));
|
MOCK_METHOD1(SetMediaChannel, void(cricket::MediaChannel*));
|
||||||
|
|||||||
Reference in New Issue
Block a user