Add equality method for RTCVideoCodecInfo.
This is useful for various reasons. Bug: None Change-Id: I8658f8b19829cc8470789c13ff3af6466f200f00 Reviewed-on: https://webrtc-review.googlesource.com/4383 Reviewed-by: Anders Carlsson <andersc@webrtc.org> Commit-Queue: Kári Helgason <kthelgason@webrtc.org> Cr-Commit-Position: refs/heads/master@{#20018}
This commit is contained in:
committed by
Commit Bot
parent
a81403fd16
commit
3935c34cbc
@ -62,6 +62,28 @@
|
||||
return codec;
|
||||
}
|
||||
|
||||
- (BOOL)isEqualToCodecInfo:(RTCVideoCodecInfo *)info {
|
||||
if (!info ||
|
||||
self.payload != info.payload ||
|
||||
![self.name isEqualToString:info.name] ||
|
||||
![self.parameters isEqualToDictionary:info.parameters]) {
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)isEqual:(id)object {
|
||||
if (self == object)
|
||||
return YES;
|
||||
if (![object isKindOfClass:[self class]])
|
||||
return NO;
|
||||
return [self isEqualToCodecInfo:object];
|
||||
}
|
||||
|
||||
- (NSUInteger)hash {
|
||||
return [self.name hash] ^ self.payload ^ [self.parameters hash];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation RTCVideoEncoderQpThresholds
|
||||
|
||||
Reference in New Issue
Block a user