Index: webrtc/sdk/objc/Framework/Classes/RTCRtpSender.mm |
diff --git a/webrtc/sdk/objc/Framework/Classes/RTCRtpSender.mm b/webrtc/sdk/objc/Framework/Classes/RTCRtpSender.mm |
index 3d413dc16013d6eb902bf42f692e556b25840d22..9ecf0ae5ae91876fcb852ed82a73ffad8a3d8878 100644 |
--- a/webrtc/sdk/objc/Framework/Classes/RTCRtpSender.mm |
+++ b/webrtc/sdk/objc/Framework/Classes/RTCRtpSender.mm |
@@ -21,16 +21,6 @@ |
rtc::scoped_refptr<webrtc::RtpSenderInterface> _nativeRtpSender; |
} |
-- (instancetype)initWithNativeRtpSender: |
- (rtc::scoped_refptr<webrtc::RtpSenderInterface>)nativeRtpSender { |
- NSParameterAssert(nativeRtpSender); |
- if (self = [super init]) { |
- _nativeRtpSender = nativeRtpSender; |
- RTCLogInfo(@"RTCRtpSender(%p): created sender: %@", self, self.description); |
- } |
- return self; |
-} |
- |
- (NSString *)senderId { |
return [NSString stringForStdString:_nativeRtpSender->id()]; |
} |
@@ -67,4 +57,38 @@ |
self.senderId]; |
} |
+- (BOOL)isEqual:(id)object { |
+ if (self == object) { |
+ return YES; |
+ } |
+ if (object == nil) { |
+ return NO; |
+ } |
+ if (![object isMemberOfClass:[self class]]) { |
+ return NO; |
+ } |
+ RTCRtpSender *sender = (RTCRtpSender *)object; |
+ return _nativeRtpSender == sender.nativeRtpSender; |
+} |
+ |
+- (NSUInteger)hash { |
+ return (NSUInteger)_nativeRtpSender.get(); |
+} |
+ |
+#pragma mark - Private |
+ |
+- (rtc::scoped_refptr<webrtc::RtpSenderInterface>)nativeRtpSender { |
+ return _nativeRtpSender; |
+} |
+ |
+- (instancetype)initWithNativeRtpSender: |
+ (rtc::scoped_refptr<webrtc::RtpSenderInterface>)nativeRtpSender { |
+ NSParameterAssert(nativeRtpSender); |
+ if (self = [super init]) { |
+ _nativeRtpSender = nativeRtpSender; |
+ RTCLogInfo(@"RTCRtpSender(%p): created sender: %@", self, self.description); |
+ } |
+ return self; |
+} |
+ |
@end |