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}
diff --git a/sdk/objc/Framework/Classes/Audio/RTCAudioSession+Private.h b/sdk/objc/Framework/Classes/Audio/RTCAudioSession+Private.h
index 8be8aad..f163b5a 100644
--- a/sdk/objc/Framework/Classes/Audio/RTCAudioSession+Private.h
+++ b/sdk/objc/Framework/Classes/Audio/RTCAudioSession+Private.h
@@ -77,14 +77,12 @@
- (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;
diff --git a/sdk/objc/Framework/Classes/Audio/RTCNativeAudioSessionDelegateAdapter.h b/sdk/objc/Framework/Classes/Audio/RTCNativeAudioSessionDelegateAdapter.h
index 487bab1..7fb2184 100644
--- a/sdk/objc/Framework/Classes/Audio/RTCNativeAudioSessionDelegateAdapter.h
+++ b/sdk/objc/Framework/Classes/Audio/RTCNativeAudioSessionDelegateAdapter.h
@@ -26,8 +26,7 @@
/** |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
diff --git a/sdk/objc/Framework/Classes/Common/NSString+StdString.h b/sdk/objc/Framework/Classes/Common/NSString+StdString.h
index 8bf6cc9..7f51a9f 100644
--- a/sdk/objc/Framework/Classes/Common/NSString+StdString.h
+++ b/sdk/objc/Framework/Classes/Common/NSString+StdString.h
@@ -19,7 +19,7 @@
@property(nonatomic, readonly) std::string stdString;
+ (std::string)stdStringForString:(NSString *)nsString;
-+ (NSString *)stringForStdString:(const std::string&)stdString;
++ (NSString *)stringForStdString:(const std::string &)stdString;
@end
diff --git a/sdk/objc/Framework/Classes/Common/helpers.h b/sdk/objc/Framework/Classes/Common/helpers.h
index ca56d51..7fd9b34 100644
--- a/sdk/objc/Framework/Classes/Common/helpers.h
+++ b/sdk/objc/Framework/Classes/Common/helpers.h
@@ -18,7 +18,7 @@
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.
diff --git a/sdk/objc/Framework/Classes/Metal/RTCMTLRGBRenderer.h b/sdk/objc/Framework/Classes/Metal/RTCMTLRGBRenderer.h
index de27055..9db422c 100644
--- a/sdk/objc/Framework/Classes/Metal/RTCMTLRGBRenderer.h
+++ b/sdk/objc/Framework/Classes/Metal/RTCMTLRGBRenderer.h
@@ -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
diff --git a/sdk/objc/Framework/Classes/Metal/RTCMTLRenderer.h b/sdk/objc/Framework/Classes/Metal/RTCMTLRenderer.h
index bd1b6b7..f4a293b 100644
--- a/sdk/objc/Framework/Classes/Metal/RTCMTLRenderer.h
+++ b/sdk/objc/Framework/Classes/Metal/RTCMTLRenderer.h
@@ -21,7 +21,7 @@
/**
* 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 @@
* 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.
diff --git a/sdk/objc/Framework/Classes/PeerConnection/RTCAudioSource+Private.h b/sdk/objc/Framework/Classes/PeerConnection/RTCAudioSource+Private.h
index 43aff02..752eb66 100644
--- a/sdk/objc/Framework/Classes/PeerConnection/RTCAudioSource+Private.h
+++ b/sdk/objc/Framework/Classes/PeerConnection/RTCAudioSource+Private.h
@@ -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
diff --git a/sdk/objc/Framework/Classes/PeerConnection/RTCAudioTrack+Private.h b/sdk/objc/Framework/Classes/PeerConnection/RTCAudioTrack+Private.h
index 176d03f..7a2f2c8 100644
--- a/sdk/objc/Framework/Classes/PeerConnection/RTCAudioTrack+Private.h
+++ b/sdk/objc/Framework/Classes/PeerConnection/RTCAudioTrack+Private.h
@@ -18,8 +18,7 @@
@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
diff --git a/sdk/objc/Framework/Classes/PeerConnection/RTCConfiguration+Native.h b/sdk/objc/Framework/Classes/PeerConnection/RTCConfiguration+Native.h
index f539d1c..64653e4 100644
--- a/sdk/objc/Framework/Classes/PeerConnection/RTCConfiguration+Native.h
+++ b/sdk/objc/Framework/Classes/PeerConnection/RTCConfiguration+Native.h
@@ -18,9 +18,10 @@
/** 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
diff --git a/sdk/objc/Framework/Classes/PeerConnection/RTCConfiguration+Private.h b/sdk/objc/Framework/Classes/PeerConnection/RTCConfiguration+Private.h
index c572d63..ad57336 100644
--- a/sdk/objc/Framework/Classes/PeerConnection/RTCConfiguration+Private.h
+++ b/sdk/objc/Framework/Classes/PeerConnection/RTCConfiguration+Private.h
@@ -16,43 +16,43 @@
@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 @@
- (nullable webrtc::PeerConnectionInterface::RTCConfiguration *)createNativeConfiguration;
- (instancetype)initWithNativeConfiguration:
- (const webrtc::PeerConnectionInterface::RTCConfiguration &)config NS_DESIGNATED_INITIALIZER;
+ (const webrtc::PeerConnectionInterface::RTCConfiguration &)config NS_DESIGNATED_INITIALIZER;
@end
diff --git a/sdk/objc/Framework/Classes/PeerConnection/RTCDataChannel+Private.h b/sdk/objc/Framework/Classes/PeerConnection/RTCDataChannel+Private.h
index ca806ca..5ab308b 100644
--- a/sdk/objc/Framework/Classes/PeerConnection/RTCDataChannel+Private.h
+++ b/sdk/objc/Framework/Classes/PeerConnection/RTCDataChannel+Private.h
@@ -24,23 +24,22 @@
@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;
diff --git a/sdk/objc/Framework/Classes/PeerConnection/RTCIceCandidate+Private.h b/sdk/objc/Framework/Classes/PeerConnection/RTCIceCandidate+Private.h
index 6c47a39..47e934c 100644
--- a/sdk/objc/Framework/Classes/PeerConnection/RTCIceCandidate+Private.h
+++ b/sdk/objc/Framework/Classes/PeerConnection/RTCIceCandidate+Private.h
@@ -22,15 +22,13 @@
* 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
diff --git a/sdk/objc/Framework/Classes/PeerConnection/RTCIceServer+Private.h b/sdk/objc/Framework/Classes/PeerConnection/RTCIceServer+Private.h
index 19a845b..0f6b7b7 100644
--- a/sdk/objc/Framework/Classes/PeerConnection/RTCIceServer+Private.h
+++ b/sdk/objc/Framework/Classes/PeerConnection/RTCIceServer+Private.h
@@ -20,12 +20,10 @@
* 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
diff --git a/sdk/objc/Framework/Classes/PeerConnection/RTCIntervalRange+Private.h b/sdk/objc/Framework/Classes/PeerConnection/RTCIntervalRange+Private.h
index a80c99a..690daf3 100644
--- a/sdk/objc/Framework/Classes/PeerConnection/RTCIntervalRange+Private.h
+++ b/sdk/objc/Framework/Classes/PeerConnection/RTCIntervalRange+Private.h
@@ -16,12 +16,10 @@
@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
-
diff --git a/sdk/objc/Framework/Classes/PeerConnection/RTCMediaConstraints+Private.h b/sdk/objc/Framework/Classes/PeerConnection/RTCMediaConstraints+Private.h
index 1955c8c..75cd79b 100644
--- a/sdk/objc/Framework/Classes/PeerConnection/RTCMediaConstraints+Private.h
+++ b/sdk/objc/Framework/Classes/PeerConnection/RTCMediaConstraints+Private.h
@@ -20,9 +20,8 @@
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 @@
} // namespace webrtc
-
NS_ASSUME_NONNULL_BEGIN
@interface RTCMediaConstraints ()
@@ -45,9 +43,8 @@
- (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
diff --git a/sdk/objc/Framework/Classes/PeerConnection/RTCMediaSource+Private.h b/sdk/objc/Framework/Classes/PeerConnection/RTCMediaSource+Private.h
index 1656d16..f638249 100644
--- a/sdk/objc/Framework/Classes/PeerConnection/RTCMediaSource+Private.h
+++ b/sdk/objc/Framework/Classes/PeerConnection/RTCMediaSource+Private.h
@@ -21,19 +21,15 @@
@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;
diff --git a/sdk/objc/Framework/Classes/PeerConnection/RTCMediaStream+Private.h b/sdk/objc/Framework/Classes/PeerConnection/RTCMediaStream+Private.h
index 1d0847c..f95d15c 100644
--- a/sdk/objc/Framework/Classes/PeerConnection/RTCMediaStream+Private.h
+++ b/sdk/objc/Framework/Classes/PeerConnection/RTCMediaStream+Private.h
@@ -20,16 +20,14 @@
* 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
diff --git a/sdk/objc/Framework/Classes/PeerConnection/RTCMediaStreamTrack+Private.h b/sdk/objc/Framework/Classes/PeerConnection/RTCMediaStreamTrack+Private.h
index bcf7a5f..bb24216 100644
--- a/sdk/objc/Framework/Classes/PeerConnection/RTCMediaStreamTrack+Private.h
+++ b/sdk/objc/Framework/Classes/PeerConnection/RTCMediaStreamTrack+Private.h
@@ -25,27 +25,25 @@
* 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;
diff --git a/sdk/objc/Framework/Classes/PeerConnection/RTCMetricsSampleInfo+Private.h b/sdk/objc/Framework/Classes/PeerConnection/RTCMetricsSampleInfo+Private.h
index 48451df..ceaca8f 100644
--- a/sdk/objc/Framework/Classes/PeerConnection/RTCMetricsSampleInfo+Private.h
+++ b/sdk/objc/Framework/Classes/PeerConnection/RTCMetricsSampleInfo+Private.h
@@ -20,8 +20,7 @@
@interface RTCMetricsSampleInfo ()
/** Initialize an RTCMetricsSampleInfo object from native SampleInfo. */
-- (instancetype)initWithNativeSampleInfo:
- (const webrtc::metrics::SampleInfo &)info;
+- (instancetype)initWithNativeSampleInfo:(const webrtc::metrics::SampleInfo &)info;
@end
diff --git a/sdk/objc/Framework/Classes/PeerConnection/RTCPeerConnection+Private.h b/sdk/objc/Framework/Classes/PeerConnection/RTCPeerConnection+Private.h
index eae72fb..f533605 100644
--- a/sdk/objc/Framework/Classes/PeerConnection/RTCPeerConnection+Private.h
+++ b/sdk/objc/Framework/Classes/PeerConnection/RTCPeerConnection+Private.h
@@ -21,13 +21,11 @@
* 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 @@
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
diff --git a/sdk/objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory+Private.h b/sdk/objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory+Private.h
index 1e5d179..50944ee 100644
--- a/sdk/objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory+Private.h
+++ b/sdk/objc/Framework/Classes/PeerConnection/RTCPeerConnectionFactory+Private.h
@@ -23,7 +23,8 @@
* C++ APIs.
*/
@property(nonatomic, readonly)
- rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> nativeFactory;
+ rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface>
+ nativeFactory;
@end
diff --git a/sdk/objc/Framework/Classes/PeerConnection/RTCRtpCodecParameters+Private.h b/sdk/objc/Framework/Classes/PeerConnection/RTCRtpCodecParameters+Private.h
index f33a8cf..c6ca462 100644
--- a/sdk/objc/Framework/Classes/PeerConnection/RTCRtpCodecParameters+Private.h
+++ b/sdk/objc/Framework/Classes/PeerConnection/RTCRtpCodecParameters+Private.h
@@ -20,8 +20,7 @@
@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
diff --git a/sdk/objc/Framework/Classes/PeerConnection/RTCRtpEncodingParameters+Private.h b/sdk/objc/Framework/Classes/PeerConnection/RTCRtpEncodingParameters+Private.h
index 673a485..c64501f 100644
--- a/sdk/objc/Framework/Classes/PeerConnection/RTCRtpEncodingParameters+Private.h
+++ b/sdk/objc/Framework/Classes/PeerConnection/RTCRtpEncodingParameters+Private.h
@@ -20,8 +20,7 @@
@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
diff --git a/sdk/objc/Framework/Classes/PeerConnection/RTCRtpParameters+Private.h b/sdk/objc/Framework/Classes/PeerConnection/RTCRtpParameters+Private.h
index 4a0daaf..41d1b7c 100644
--- a/sdk/objc/Framework/Classes/PeerConnection/RTCRtpParameters+Private.h
+++ b/sdk/objc/Framework/Classes/PeerConnection/RTCRtpParameters+Private.h
@@ -20,8 +20,7 @@
@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
diff --git a/sdk/objc/Framework/Classes/PeerConnection/RTCRtpReceiver+Private.h b/sdk/objc/Framework/Classes/PeerConnection/RTCRtpReceiver+Private.h
index 63bdfa3..73f68f4 100644
--- a/sdk/objc/Framework/Classes/PeerConnection/RTCRtpReceiver+Private.h
+++ b/sdk/objc/Framework/Classes/PeerConnection/RTCRtpReceiver+Private.h
@@ -30,12 +30,11 @@
@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;
diff --git a/sdk/objc/Framework/Classes/PeerConnection/RTCRtpSender+Private.h b/sdk/objc/Framework/Classes/PeerConnection/RTCRtpSender+Private.h
index e70be83..7164bca 100644
--- a/sdk/objc/Framework/Classes/PeerConnection/RTCRtpSender+Private.h
+++ b/sdk/objc/Framework/Classes/PeerConnection/RTCRtpSender+Private.h
@@ -16,13 +16,11 @@
@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
diff --git a/sdk/objc/Framework/Classes/PeerConnection/RTCSessionDescription+Private.h b/sdk/objc/Framework/Classes/PeerConnection/RTCSessionDescription+Private.h
index 4c58fa7..08a6f55 100644
--- a/sdk/objc/Framework/Classes/PeerConnection/RTCSessionDescription+Private.h
+++ b/sdk/objc/Framework/Classes/PeerConnection/RTCSessionDescription+Private.h
@@ -29,7 +29,7 @@
* description.
*/
- (instancetype)initWithNativeDescription:
- (const webrtc::SessionDescriptionInterface *)nativeDescription;
+ (const webrtc::SessionDescriptionInterface *)nativeDescription;
+ (std::string)stdStringForType:(RTCSdpType)type;
diff --git a/sdk/objc/Framework/Classes/PeerConnection/RTCVideoRendererAdapter+Private.h b/sdk/objc/Framework/Classes/PeerConnection/RTCVideoRendererAdapter+Private.h
index bdec24d..80a2140 100644
--- a/sdk/objc/Framework/Classes/PeerConnection/RTCVideoRendererAdapter+Private.h
+++ b/sdk/objc/Framework/Classes/PeerConnection/RTCVideoRendererAdapter+Private.h
@@ -30,8 +30,7 @@
* 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
diff --git a/sdk/objc/Framework/Classes/PeerConnection/RTCVideoSource+Private.h b/sdk/objc/Framework/Classes/PeerConnection/RTCVideoSource+Private.h
index bd42484..fdb4522 100644
--- a/sdk/objc/Framework/Classes/PeerConnection/RTCVideoSource+Private.h
+++ b/sdk/objc/Framework/Classes/PeerConnection/RTCVideoSource+Private.h
@@ -22,17 +22,16 @@
* 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
diff --git a/sdk/objc/Framework/Classes/PeerConnection/RTCVideoTrack+Private.h b/sdk/objc/Framework/Classes/PeerConnection/RTCVideoTrack+Private.h
index 2cb6a13..14639be 100644
--- a/sdk/objc/Framework/Classes/PeerConnection/RTCVideoTrack+Private.h
+++ b/sdk/objc/Framework/Classes/PeerConnection/RTCVideoTrack+Private.h
@@ -17,8 +17,7 @@
@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
diff --git a/sdk/objc/Framework/Classes/Video/RTCShader.h b/sdk/objc/Framework/Classes/Video/RTCShader.h
index 4d92d3d..67afabb 100644
--- a/sdk/objc/Framework/Classes/Video/RTCShader.h
+++ b/sdk/objc/Framework/Classes/Video/RTCShader.h
@@ -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);
diff --git a/sdk/objc/Framework/Classes/VideoToolbox/nalu_rewriter.cc b/sdk/objc/Framework/Classes/VideoToolbox/nalu_rewriter.cc
index 625fc53..a373050 100644
--- a/sdk/objc/Framework/Classes/VideoToolbox/nalu_rewriter.cc
+++ b/sdk/objc/Framework/Classes/VideoToolbox/nalu_rewriter.cc
@@ -33,7 +33,7 @@
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);
diff --git a/sdk/objc/Framework/Classes/VideoToolbox/nalu_rewriter.h b/sdk/objc/Framework/Classes/VideoToolbox/nalu_rewriter.h
index cd81f12..0155882 100644
--- a/sdk/objc/Framework/Classes/VideoToolbox/nalu_rewriter.h
+++ b/sdk/objc/Framework/Classes/VideoToolbox/nalu_rewriter.h
@@ -33,7 +33,7 @@
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
diff --git a/sdk/objc/Framework/Classes/VideoToolbox/nalu_rewriter_unittest.cc b/sdk/objc/Framework/Classes/VideoToolbox/nalu_rewriter_unittest.cc
index c8de64b..d907ef8 100644
--- a/sdk/objc/Framework/Classes/VideoToolbox/nalu_rewriter_unittest.cc
+++ b/sdk/objc/Framework/Classes/VideoToolbox/nalu_rewriter_unittest.cc
@@ -25,14 +25,11 @@
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 @@
}
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) {