Reformat the WebRTC code base

Running clang-format with chromium's style guide.

The goal is n-fold:
 * providing consistency and readability (that's what code guidelines are for)
 * preventing noise with presubmit checks and git cl format
 * building on the previous point: making it easier to automatically fix format issues
 * you name it

Please consider using git-hyper-blame to ignore this commit.

Bug: webrtc:9340
Change-Id: I694567c4cdf8cee2860958cfe82bfaf25848bb87
Reviewed-on: https://webrtc-review.googlesource.com/81185
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23660}
This commit is contained in:
Yves Gerey
2018-06-19 15:03:05 +02:00
parent b602123a5a
commit 665174fdbb
1569 changed files with 30495 additions and 30309 deletions

View File

@ -77,14 +77,12 @@ NS_ASSUME_NONNULL_BEGIN
- (NSError *)configurationErrorWithDescription:(NSString *)description;
// Properties and methods for tests.
@property(nonatomic, readonly)
std::vector<__weak id<RTCAudioSessionDelegate> > delegates;
@property(nonatomic, readonly) std::vector<__weak id<RTCAudioSessionDelegate> > delegates;
- (void)notifyDidBeginInterruption;
- (void)notifyDidEndInterruptionWithShouldResumeSession:
(BOOL)shouldResumeSession;
- (void)notifyDidEndInterruptionWithShouldResumeSession:(BOOL)shouldResumeSession;
- (void)notifyDidChangeRouteWithReason:(AVAudioSessionRouteChangeReason)reason
previousRoute:(AVAudioSessionRouteDescription *)previousRoute;
previousRoute:(AVAudioSessionRouteDescription *)previousRoute;
- (void)notifyMediaServicesWereLost;
- (void)notifyMediaServicesWereReset;
- (void)notifyDidChangeCanPlayOrRecord:(BOOL)canPlayOrRecord;

View File

@ -26,8 +26,7 @@ class AudioSessionObserver;
/** |observer| is a raw pointer and should be kept alive
* for this object's lifetime.
*/
- (instancetype)initWithObserver:(webrtc::AudioSessionObserver *)observer
NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithObserver:(webrtc::AudioSessionObserver *)observer NS_DESIGNATED_INITIALIZER;
@end

View File

@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic, readonly) std::string stdString;
+ (std::string)stdStringForString:(NSString *)nsString;
+ (NSString *)stringForStdString:(const std::string&)stdString;
+ (NSString *)stringForStdString:(const std::string &)stdString;
@end

View File

@ -18,7 +18,7 @@ namespace ios {
bool CheckAndLogError(BOOL success, NSError* error);
NSString *NSStringFromStdString(const std::string& stdString);
NSString* NSStringFromStdString(const std::string& stdString);
std::string StdStringFromNSString(NSString* nsString);
// Return thread ID as a string.

View File

@ -13,7 +13,8 @@
#import "RTCMTLRenderer.h"
/** @abstract RGB/BGR renderer.
* @discussion This renderer handles both kCVPixelFormatType_32BGRA and kCVPixelFormatType_32ARGB.
* @discussion This renderer handles both kCVPixelFormatType_32BGRA and
* kCVPixelFormatType_32ARGB.
*/
NS_AVAILABLE(10_11, 9_0)
@interface RTCMTLRGBRenderer : RTCMTLRenderer

View File

@ -21,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
* Protocol defining ability to render RTCVideoFrame in Metal enabled views.
*/
@protocol RTCMTLRenderer<NSObject>
@protocol RTCMTLRenderer <NSObject>
/**
* Method to be implemented to perform actual rendering of the provided frame.
@ -49,7 +49,7 @@ NS_ASSUME_NONNULL_BEGIN
* Implementation of RTCMTLRenderer protocol.
*/
NS_AVAILABLE(10_11, 9_0)
@interface RTCMTLRenderer : NSObject<RTCMTLRenderer>
@interface RTCMTLRenderer : NSObject <RTCMTLRenderer>
/** @abstract A wrapped RTCVideoRotation, or nil.
@discussion When not nil, the rotation of the actual frame is ignored when rendering.

View File

@ -22,11 +22,11 @@
/** Initialize an RTCAudioSource from a native AudioSourceInterface. */
- (instancetype)initWithNativeAudioSource:
(rtc::scoped_refptr<webrtc::AudioSourceInterface>)nativeAudioSource
(rtc::scoped_refptr<webrtc::AudioSourceInterface>)nativeAudioSource
NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithNativeMediaSource:
(rtc::scoped_refptr<webrtc::MediaSourceInterface>)nativeMediaSource
(rtc::scoped_refptr<webrtc::MediaSourceInterface>)nativeMediaSource
type:(RTCMediaSourceType)type NS_UNAVAILABLE;
@end

View File

@ -18,8 +18,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface RTCAudioTrack ()
/** AudioTrackInterface created or passed in at construction. */
@property(nonatomic, readonly)
rtc::scoped_refptr<webrtc::AudioTrackInterface> nativeAudioTrack;
@property(nonatomic, readonly) rtc::scoped_refptr<webrtc::AudioTrackInterface> nativeAudioTrack;
/** Initialize an RTCAudioTrack with an id. */
- (instancetype)initWithFactory:(RTCPeerConnectionFactory *)factory

View File

@ -18,9 +18,10 @@ NS_ASSUME_NONNULL_BEGIN
/** Optional TurnCustomizer.
* With this class one can modify outgoing TURN messages.
* The object passed in must remain valid until PeerConnection::Close() is called.
* The object passed in must remain valid until PeerConnection::Close() is
* called.
*/
@property(nonatomic, nullable) webrtc::TurnCustomizer *turnCustomizer;
@property(nonatomic, nullable) webrtc::TurnCustomizer* turnCustomizer;
@end

View File

@ -16,43 +16,43 @@ NS_ASSUME_NONNULL_BEGIN
@interface RTCConfiguration ()
+ (webrtc::PeerConnectionInterface::IceTransportsType)
nativeTransportsTypeForTransportPolicy:(RTCIceTransportPolicy)policy;
+ (webrtc::PeerConnectionInterface::IceTransportsType)nativeTransportsTypeForTransportPolicy:
(RTCIceTransportPolicy)policy;
+ (RTCIceTransportPolicy)transportPolicyForTransportsType:
(webrtc::PeerConnectionInterface::IceTransportsType)nativeType;
(webrtc::PeerConnectionInterface::IceTransportsType)nativeType;
+ (NSString *)stringForTransportPolicy:(RTCIceTransportPolicy)policy;
+ (webrtc::PeerConnectionInterface::BundlePolicy)nativeBundlePolicyForPolicy:
(RTCBundlePolicy)policy;
(RTCBundlePolicy)policy;
+ (RTCBundlePolicy)bundlePolicyForNativePolicy:
(webrtc::PeerConnectionInterface::BundlePolicy)nativePolicy;
(webrtc::PeerConnectionInterface::BundlePolicy)nativePolicy;
+ (NSString *)stringForBundlePolicy:(RTCBundlePolicy)policy;
+ (webrtc::PeerConnectionInterface::RtcpMuxPolicy)nativeRtcpMuxPolicyForPolicy:
(RTCRtcpMuxPolicy)policy;
(RTCRtcpMuxPolicy)policy;
+ (RTCRtcpMuxPolicy)rtcpMuxPolicyForNativePolicy:
(webrtc::PeerConnectionInterface::RtcpMuxPolicy)nativePolicy;
(webrtc::PeerConnectionInterface::RtcpMuxPolicy)nativePolicy;
+ (NSString *)stringForRtcpMuxPolicy:(RTCRtcpMuxPolicy)policy;
+ (webrtc::PeerConnectionInterface::TcpCandidatePolicy)
nativeTcpCandidatePolicyForPolicy:(RTCTcpCandidatePolicy)policy;
+ (webrtc::PeerConnectionInterface::TcpCandidatePolicy)nativeTcpCandidatePolicyForPolicy:
(RTCTcpCandidatePolicy)policy;
+ (RTCTcpCandidatePolicy)tcpCandidatePolicyForNativePolicy:
(webrtc::PeerConnectionInterface::TcpCandidatePolicy)nativePolicy;
(webrtc::PeerConnectionInterface::TcpCandidatePolicy)nativePolicy;
+ (NSString *)stringForTcpCandidatePolicy:(RTCTcpCandidatePolicy)policy;
+ (webrtc::PeerConnectionInterface::CandidateNetworkPolicy)
nativeCandidateNetworkPolicyForPolicy:(RTCCandidateNetworkPolicy)policy;
+ (webrtc::PeerConnectionInterface::CandidateNetworkPolicy)nativeCandidateNetworkPolicyForPolicy:
(RTCCandidateNetworkPolicy)policy;
+ (RTCCandidateNetworkPolicy)candidateNetworkPolicyForNativePolicy:
(webrtc::PeerConnectionInterface::CandidateNetworkPolicy)nativePolicy;
(webrtc::PeerConnectionInterface::CandidateNetworkPolicy)nativePolicy;
+ (NSString *)stringForCandidateNetworkPolicy:(RTCCandidateNetworkPolicy)policy;
@ -71,7 +71,7 @@ NS_ASSUME_NONNULL_BEGIN
- (nullable webrtc::PeerConnectionInterface::RTCConfiguration *)createNativeConfiguration;
- (instancetype)initWithNativeConfiguration:
(const webrtc::PeerConnectionInterface::RTCConfiguration &)config NS_DESIGNATED_INITIALIZER;
(const webrtc::PeerConnectionInterface::RTCConfiguration &)config NS_DESIGNATED_INITIALIZER;
@end

View File

@ -24,23 +24,22 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic, readonly) const webrtc::DataBuffer *nativeDataBuffer;
/** Initialize an RTCDataBuffer from a native DataBuffer. */
- (instancetype)initWithNativeBuffer:(const webrtc::DataBuffer&)nativeBuffer;
- (instancetype)initWithNativeBuffer:(const webrtc::DataBuffer &)nativeBuffer;
@end
@interface RTCDataChannel ()
/** Initialize an RTCDataChannel from a native DataChannelInterface. */
- (instancetype)initWithNativeDataChannel:
(rtc::scoped_refptr<webrtc::DataChannelInterface>)nativeDataChannel
(rtc::scoped_refptr<webrtc::DataChannelInterface>)nativeDataChannel
NS_DESIGNATED_INITIALIZER;
+ (webrtc::DataChannelInterface::DataState)
nativeDataChannelStateForState:(RTCDataChannelState)state;
+ (webrtc::DataChannelInterface::DataState)nativeDataChannelStateForState:
(RTCDataChannelState)state;
+ (RTCDataChannelState)dataChannelStateForNativeState:
(webrtc::DataChannelInterface::DataState)nativeState;
(webrtc::DataChannelInterface::DataState)nativeState;
+ (NSString *)stringForState:(RTCDataChannelState)state;

View File

@ -22,15 +22,13 @@ NS_ASSUME_NONNULL_BEGIN
* The native IceCandidateInterface representation of this RTCIceCandidate
* object. This is needed to pass to the underlying C++ APIs.
*/
@property(nonatomic, readonly)
std::unique_ptr<webrtc::IceCandidateInterface> nativeCandidate;
@property(nonatomic, readonly) std::unique_ptr<webrtc::IceCandidateInterface> nativeCandidate;
/**
* Initialize an RTCIceCandidate from a native IceCandidateInterface. No
* ownership is taken of the native candidate.
*/
- (instancetype)initWithNativeCandidate:
(const webrtc::IceCandidateInterface *)candidate;
- (instancetype)initWithNativeCandidate:(const webrtc::IceCandidateInterface *)candidate;
@end

View File

@ -20,12 +20,10 @@ NS_ASSUME_NONNULL_BEGIN
* IceServer struct representation of this RTCIceServer object's data.
* This is needed to pass to the underlying C++ APIs.
*/
@property(nonatomic, readonly)
webrtc::PeerConnectionInterface::IceServer nativeServer;
@property(nonatomic, readonly) webrtc::PeerConnectionInterface::IceServer nativeServer;
/** Initialize an RTCIceServer from a native IceServer. */
- (instancetype)initWithNativeServer:
(webrtc::PeerConnectionInterface::IceServer)nativeServer;
- (instancetype)initWithNativeServer:(webrtc::PeerConnectionInterface::IceServer)nativeServer;
@end

View File

@ -16,12 +16,10 @@ NS_ASSUME_NONNULL_BEGIN
@interface RTCIntervalRange ()
@property(nonatomic, readonly)
std::unique_ptr<rtc::IntervalRange> nativeIntervalRange;
@property(nonatomic, readonly) std::unique_ptr<rtc::IntervalRange> nativeIntervalRange;
- (instancetype)initWithNativeIntervalRange:(const rtc::IntervalRange &)config;
@end
NS_ASSUME_NONNULL_END

View File

@ -20,9 +20,8 @@ class MediaConstraints : public MediaConstraintsInterface {
public:
virtual ~MediaConstraints();
MediaConstraints();
MediaConstraints(
const MediaConstraintsInterface::Constraints& mandatory,
const MediaConstraintsInterface::Constraints& optional);
MediaConstraints(const MediaConstraintsInterface::Constraints& mandatory,
const MediaConstraintsInterface::Constraints& optional);
virtual const Constraints& GetMandatory() const;
virtual const Constraints& GetOptional() const;
@ -33,7 +32,6 @@ class MediaConstraints : public MediaConstraintsInterface {
} // namespace webrtc
NS_ASSUME_NONNULL_BEGIN
@interface RTCMediaConstraints ()
@ -45,9 +43,8 @@ NS_ASSUME_NONNULL_BEGIN
- (std::unique_ptr<webrtc::MediaConstraints>)nativeConstraints;
/** Return a native Constraints object representing these constraints */
+ (webrtc::MediaConstraintsInterface::Constraints)
nativeConstraintsForConstraints:
(NSDictionary<NSString *, NSString *> *)constraints;
+ (webrtc::MediaConstraintsInterface::Constraints)nativeConstraintsForConstraints:
(NSDictionary<NSString*, NSString*>*)constraints;
@end

View File

@ -21,19 +21,15 @@ typedef NS_ENUM(NSInteger, RTCMediaSourceType) {
@interface RTCMediaSource ()
@property(nonatomic, readonly)
rtc::scoped_refptr<webrtc::MediaSourceInterface> nativeMediaSource;
@property(nonatomic, readonly) rtc::scoped_refptr<webrtc::MediaSourceInterface> nativeMediaSource;
- (instancetype)initWithNativeMediaSource:
(rtc::scoped_refptr<webrtc::MediaSourceInterface>)nativeMediaSource
type:(RTCMediaSourceType)type
NS_DESIGNATED_INITIALIZER;
(rtc::scoped_refptr<webrtc::MediaSourceInterface>)nativeMediaSource
type:(RTCMediaSourceType)type NS_DESIGNATED_INITIALIZER;
+ (webrtc::MediaSourceInterface::SourceState)nativeSourceStateForState:
(RTCSourceState)state;
+ (webrtc::MediaSourceInterface::SourceState)nativeSourceStateForState:(RTCSourceState)state;
+ (RTCSourceState)sourceStateForNativeState:
(webrtc::MediaSourceInterface::SourceState)nativeState;
+ (RTCSourceState)sourceStateForNativeState:(webrtc::MediaSourceInterface::SourceState)nativeState;
+ (NSString *)stringForState:(RTCSourceState)state;

View File

@ -20,16 +20,14 @@ NS_ASSUME_NONNULL_BEGIN
* MediaStreamInterface representation of this RTCMediaStream object. This is
* needed to pass to the underlying C++ APIs.
*/
@property(nonatomic, readonly)
rtc::scoped_refptr<webrtc::MediaStreamInterface> nativeMediaStream;
@property(nonatomic, readonly) rtc::scoped_refptr<webrtc::MediaStreamInterface> nativeMediaStream;
/** Initialize an RTCMediaStream with an id. */
- (instancetype)initWithFactory:(RTCPeerConnectionFactory *)factory
streamId:(NSString *)streamId;
- (instancetype)initWithFactory:(RTCPeerConnectionFactory *)factory streamId:(NSString *)streamId;
/** Initialize an RTCMediaStream from a native MediaStreamInterface. */
- (instancetype)initWithNativeMediaStream:
(rtc::scoped_refptr<webrtc::MediaStreamInterface>)nativeMediaStream;
(rtc::scoped_refptr<webrtc::MediaStreamInterface>)nativeMediaStream;
@end

View File

@ -25,27 +25,25 @@ NS_ASSUME_NONNULL_BEGIN
* The native MediaStreamTrackInterface passed in or created during
* construction.
*/
@property(nonatomic, readonly)
rtc::scoped_refptr<webrtc::MediaStreamTrackInterface> nativeTrack;
@property(nonatomic, readonly) rtc::scoped_refptr<webrtc::MediaStreamTrackInterface> nativeTrack;
/**
* Initialize an RTCMediaStreamTrack from a native MediaStreamTrackInterface.
*/
- (instancetype)initWithNativeTrack:
(rtc::scoped_refptr<webrtc::MediaStreamTrackInterface>)nativeTrack
type:(RTCMediaStreamTrackType)type
NS_DESIGNATED_INITIALIZER;
(rtc::scoped_refptr<webrtc::MediaStreamTrackInterface>)nativeTrack
type:(RTCMediaStreamTrackType)type NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithNativeTrack:
(rtc::scoped_refptr<webrtc::MediaStreamTrackInterface>)nativeTrack;
(rtc::scoped_refptr<webrtc::MediaStreamTrackInterface>)nativeTrack;
- (BOOL)isEqualToTrack:(RTCMediaStreamTrack *)track;
+ (webrtc::MediaStreamTrackInterface::TrackState)nativeTrackStateForState:
(RTCMediaStreamTrackState)state;
(RTCMediaStreamTrackState)state;
+ (RTCMediaStreamTrackState)trackStateForNativeState:
(webrtc::MediaStreamTrackInterface::TrackState)nativeState;
(webrtc::MediaStreamTrackInterface::TrackState)nativeState;
+ (NSString *)stringForState:(RTCMediaStreamTrackState)state;

View File

@ -20,8 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface RTCMetricsSampleInfo ()
/** Initialize an RTCMetricsSampleInfo object from native SampleInfo. */
- (instancetype)initWithNativeSampleInfo:
(const webrtc::metrics::SampleInfo &)info;
- (instancetype)initWithNativeSampleInfo:(const webrtc::metrics::SampleInfo &)info;
@end

View File

@ -21,13 +21,11 @@ namespace webrtc {
* id<RTCPeerConnectionDelegate> and call methods on that interface.
*/
class PeerConnectionDelegateAdapter : public PeerConnectionObserver {
public:
PeerConnectionDelegateAdapter(RTCPeerConnection *peerConnection);
virtual ~PeerConnectionDelegateAdapter();
void OnSignalingChange(
PeerConnectionInterface::SignalingState new_state) override;
void OnSignalingChange(PeerConnectionInterface::SignalingState new_state) override;
void OnAddStream(rtc::scoped_refptr<MediaStreamInterface> stream) override;
@ -35,77 +33,68 @@ class PeerConnectionDelegateAdapter : public PeerConnectionObserver {
void OnTrack(rtc::scoped_refptr<RtpTransceiverInterface> transceiver) override;
void OnDataChannel(
rtc::scoped_refptr<DataChannelInterface> data_channel) override;
void OnDataChannel(rtc::scoped_refptr<DataChannelInterface> data_channel) override;
void OnRenegotiationNeeded() override;
void OnIceConnectionChange(
PeerConnectionInterface::IceConnectionState new_state) override;
void OnIceConnectionChange(PeerConnectionInterface::IceConnectionState new_state) override;
void OnIceGatheringChange(
PeerConnectionInterface::IceGatheringState new_state) override;
void OnIceGatheringChange(PeerConnectionInterface::IceGatheringState new_state) override;
void OnIceCandidate(const IceCandidateInterface *candidate) override;
void OnIceCandidatesRemoved(
const std::vector<cricket::Candidate>& candidates) override;
void OnIceCandidatesRemoved(const std::vector<cricket::Candidate> &candidates) override;
void OnAddTrack(rtc::scoped_refptr<RtpReceiverInterface> receiver,
const std::vector<rtc::scoped_refptr<MediaStreamInterface>>& streams) override;
const std::vector<rtc::scoped_refptr<MediaStreamInterface>> &streams) override;
private:
__weak RTCPeerConnection *peer_connection_;
};
} // namespace webrtc
} // namespace webrtc
@interface RTCPeerConnection ()
/** The native PeerConnectionInterface created during construction. */
@property(nonatomic, readonly)
rtc::scoped_refptr<webrtc::PeerConnectionInterface> nativePeerConnection;
@property(nonatomic, readonly) rtc::scoped_refptr<webrtc::PeerConnectionInterface>
nativePeerConnection;
/** Initialize an RTCPeerConnection with a configuration, constraints, and
* delegate.
*/
- (instancetype)initWithFactory:
(RTCPeerConnectionFactory *)factory
configuration:
(RTCConfiguration *)configuration
constraints:
(RTCMediaConstraints *)constraints
delegate:
(nullable id<RTCPeerConnectionDelegate>)delegate
- (instancetype)initWithFactory:(RTCPeerConnectionFactory *)factory
configuration:(RTCConfiguration *)configuration
constraints:(RTCMediaConstraints *)constraints
delegate:(nullable id<RTCPeerConnectionDelegate>)delegate
NS_DESIGNATED_INITIALIZER;
+ (webrtc::PeerConnectionInterface::SignalingState)nativeSignalingStateForState:
(RTCSignalingState)state;
(RTCSignalingState)state;
+ (RTCSignalingState)signalingStateForNativeState:
(webrtc::PeerConnectionInterface::SignalingState)nativeState;
(webrtc::PeerConnectionInterface::SignalingState)nativeState;
+ (NSString *)stringForSignalingState:(RTCSignalingState)state;
+ (webrtc::PeerConnectionInterface::IceConnectionState)
nativeIceConnectionStateForState:(RTCIceConnectionState)state;
+ (webrtc::PeerConnectionInterface::IceConnectionState)nativeIceConnectionStateForState:
(RTCIceConnectionState)state;
+ (RTCIceConnectionState)iceConnectionStateForNativeState:
(webrtc::PeerConnectionInterface::IceConnectionState)nativeState;
(webrtc::PeerConnectionInterface::IceConnectionState)nativeState;
+ (NSString *)stringForIceConnectionState:(RTCIceConnectionState)state;
+ (webrtc::PeerConnectionInterface::IceGatheringState)
nativeIceGatheringStateForState:(RTCIceGatheringState)state;
+ (webrtc::PeerConnectionInterface::IceGatheringState)nativeIceGatheringStateForState:
(RTCIceGatheringState)state;
+ (RTCIceGatheringState)iceGatheringStateForNativeState:
(webrtc::PeerConnectionInterface::IceGatheringState)nativeState;
(webrtc::PeerConnectionInterface::IceGatheringState)nativeState;
+ (NSString *)stringForIceGatheringState:(RTCIceGatheringState)state;
+ (webrtc::PeerConnectionInterface::StatsOutputLevel)
nativeStatsOutputLevelForLevel:(RTCStatsOutputLevel)level;
+ (webrtc::PeerConnectionInterface::StatsOutputLevel)nativeStatsOutputLevelForLevel:
(RTCStatsOutputLevel)level;
@end

View File

@ -23,7 +23,8 @@ NS_ASSUME_NONNULL_BEGIN
* C++ APIs.
*/
@property(nonatomic, readonly)
rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> nativeFactory;
rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface>
nativeFactory;
@end

View File

@ -20,8 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic, readonly) webrtc::RtpCodecParameters nativeParameters;
/** Initialize the object with a native RtpCodecParameters structure. */
- (instancetype)initWithNativeParameters:
(const webrtc::RtpCodecParameters &)nativeParameters;
- (instancetype)initWithNativeParameters:(const webrtc::RtpCodecParameters &)nativeParameters;
@end

View File

@ -20,8 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic, readonly) webrtc::RtpEncodingParameters nativeParameters;
/** Initialize the object with a native RtpEncodingParameters structure. */
- (instancetype)initWithNativeParameters:
(const webrtc::RtpEncodingParameters &)nativeParameters;
- (instancetype)initWithNativeParameters:(const webrtc::RtpEncodingParameters &)nativeParameters;
@end

View File

@ -20,8 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic, readonly) webrtc::RtpParameters nativeParameters;
/** Initialize the object with a native RtpParameters structure. */
- (instancetype)initWithNativeParameters:
(const webrtc::RtpParameters &)nativeParameters;
- (instancetype)initWithNativeParameters:(const webrtc::RtpParameters &)nativeParameters;
@end

View File

@ -30,12 +30,11 @@ class RtpReceiverDelegateAdapter : public RtpReceiverObserverInterface {
@interface RTCRtpReceiver ()
@property(nonatomic, readonly)
rtc::scoped_refptr<webrtc::RtpReceiverInterface> nativeRtpReceiver;
@property(nonatomic, readonly) rtc::scoped_refptr<webrtc::RtpReceiverInterface> nativeRtpReceiver;
/** Initialize an RTCRtpReceiver with a native RtpReceiverInterface. */
- (instancetype)initWithNativeRtpReceiver:
(rtc::scoped_refptr<webrtc::RtpReceiverInterface>)nativeRtpReceiver
(rtc::scoped_refptr<webrtc::RtpReceiverInterface>)nativeRtpReceiver
NS_DESIGNATED_INITIALIZER;
+ (RTCRtpMediaType)mediaTypeForNativeMediaType:(cricket::MediaType)nativeMediaType;

View File

@ -16,13 +16,11 @@ NS_ASSUME_NONNULL_BEGIN
@interface RTCRtpSender ()
@property(nonatomic, readonly)
rtc::scoped_refptr<webrtc::RtpSenderInterface> nativeRtpSender;
@property(nonatomic, readonly) rtc::scoped_refptr<webrtc::RtpSenderInterface> nativeRtpSender;
/** Initialize an RTCRtpSender with a native RtpSenderInterface. */
- (instancetype)initWithNativeRtpSender:
(rtc::scoped_refptr<webrtc::RtpSenderInterface>)nativeRtpSender
NS_DESIGNATED_INITIALIZER;
(rtc::scoped_refptr<webrtc::RtpSenderInterface>)nativeRtpSender NS_DESIGNATED_INITIALIZER;
@end

View File

@ -29,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN
* description.
*/
- (instancetype)initWithNativeDescription:
(const webrtc::SessionDescriptionInterface *)nativeDescription;
(const webrtc::SessionDescriptionInterface *)nativeDescription;
+ (std::string)stdStringForType:(RTCSdpType)type;

View File

@ -30,8 +30,7 @@ NS_ASSUME_NONNULL_BEGIN
* to this interface will be adapted and passed to the RTCVideoRenderer supplied
* during construction. This pointer is unsafe and owned by this class.
*/
@property(nonatomic, readonly)
rtc::VideoSinkInterface<webrtc::VideoFrame> *nativeVideoRenderer;
@property(nonatomic, readonly) rtc::VideoSinkInterface<webrtc::VideoFrame> *nativeVideoRenderer;
/** Initialize an RTCVideoRendererAdapter with an RTCVideoRenderer. */
- (instancetype)initWithNativeRenderer:(id<RTCVideoRenderer>)videoRenderer

View File

@ -22,17 +22,16 @@ NS_ASSUME_NONNULL_BEGIN
* The VideoTrackSourceInterface object passed to this RTCVideoSource during
* construction.
*/
@property(nonatomic, readonly)
rtc::scoped_refptr<webrtc::VideoTrackSourceInterface>
nativeVideoSource;
@property(nonatomic, readonly) rtc::scoped_refptr<webrtc::VideoTrackSourceInterface>
nativeVideoSource;
/** Initialize an RTCVideoSource from a native VideoTrackSourceInterface. */
- (instancetype)initWithNativeVideoSource:
(rtc::scoped_refptr<webrtc::VideoTrackSourceInterface>)nativeVideoSource
(rtc::scoped_refptr<webrtc::VideoTrackSourceInterface>)nativeVideoSource
NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithNativeMediaSource:
(rtc::scoped_refptr<webrtc::MediaSourceInterface>)nativeMediaSource
(rtc::scoped_refptr<webrtc::MediaSourceInterface>)nativeMediaSource
type:(RTCMediaSourceType)type NS_UNAVAILABLE;
- (instancetype)initWithSignalingThread:(rtc::Thread *)signalingThread

View File

@ -17,8 +17,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface RTCVideoTrack ()
/** VideoTrackInterface created or passed in at construction. */
@property(nonatomic, readonly)
rtc::scoped_refptr<webrtc::VideoTrackInterface> nativeVideoTrack;
@property(nonatomic, readonly) rtc::scoped_refptr<webrtc::VideoTrackInterface> nativeVideoTrack;
/** Initialize an RTCVideoTrack with its source and an id. */
- (instancetype)initWithFactory:(RTCPeerConnectionFactory *)factory

View File

@ -12,9 +12,10 @@
RTC_EXTERN const char kRTCVertexShaderSource[];
RTC_EXTERN GLuint RTCCreateShader(GLenum type, const GLchar *source);
RTC_EXTERN GLuint RTCCreateShader(GLenum type, const GLchar* source);
RTC_EXTERN GLuint RTCCreateProgram(GLuint vertexShader, GLuint fragmentShader);
RTC_EXTERN GLuint RTCCreateProgramFromFragmentSource(const char fragmentShaderSource[]);
RTC_EXTERN GLuint
RTCCreateProgramFromFragmentSource(const char fragmentShaderSource[]);
RTC_EXTERN BOOL RTCCreateVertexBuffer(GLuint* vertexBuffer,
GLuint* vertexArray);
RTC_EXTERN void RTCSetVertexData(RTCVideoRotation rotation);

View File

@ -33,7 +33,7 @@ bool H264CMSampleBufferToAnnexBBuffer(
CMSampleBufferRef avcc_sample_buffer,
bool is_keyframe,
rtc::Buffer* annexb_buffer,
std::unique_ptr<RTPFragmentationHeader> *out_header) {
std::unique_ptr<RTPFragmentationHeader>* out_header) {
RTC_DCHECK(avcc_sample_buffer);
RTC_DCHECK(out_header);
out_header->reset(nullptr);

View File

@ -33,7 +33,7 @@ bool H264CMSampleBufferToAnnexBBuffer(
CMSampleBufferRef avcc_sample_buffer,
bool is_keyframe,
rtc::Buffer* annexb_buffer,
std::unique_ptr<RTPFragmentationHeader> *out_header);
std::unique_ptr<RTPFragmentationHeader>* out_header);
// Converts a buffer received from RTP into a sample buffer suitable for the
// VideoToolbox decoder. The RTP buffer is in annex b format whereas the sample

View File

@ -25,14 +25,11 @@ static const uint8_t NALU_TEST_DATA_1[] = {0xDE, 0xAD, 0xBE, 0xEF};
TEST(H264VideoToolboxNaluTest, TestCreateVideoFormatDescription) {
const uint8_t sps_pps_buffer[] = {
// SPS nalu.
0x00, 0x00, 0x00, 0x01,
0x27, 0x42, 0x00, 0x1E, 0xAB, 0x40, 0xF0, 0x28, 0xD3, 0x70, 0x20, 0x20,
0x20, 0x20,
// PPS nalu.
0x00, 0x00, 0x00, 0x01,
0x28, 0xCE, 0x3C, 0x30
};
// SPS nalu.
0x00, 0x00, 0x00, 0x01, 0x27, 0x42, 0x00, 0x1E, 0xAB, 0x40, 0xF0, 0x28,
0xD3, 0x70, 0x20, 0x20, 0x20, 0x20,
// PPS nalu.
0x00, 0x00, 0x00, 0x01, 0x28, 0xCE, 0x3C, 0x30};
CMVideoFormatDescriptionRef description =
CreateVideoFormatDescription(sps_pps_buffer, arraysize(sps_pps_buffer));
EXPECT_TRUE(description);
@ -59,8 +56,8 @@ TEST(H264VideoToolboxNaluTest, TestCreateVideoFormatDescription) {
}
const uint8_t other_buffer[] = {0x00, 0x00, 0x00, 0x01, 0x28};
EXPECT_FALSE(CreateVideoFormatDescription(other_buffer,
arraysize(other_buffer)));
EXPECT_FALSE(
CreateVideoFormatDescription(other_buffer, arraysize(other_buffer)));
}
TEST(AnnexBBufferReaderTest, TestReadEmptyInput) {