Migrate to modern selector syntax for ObjcVideoEncoderFactory.

Bug: None
Change-Id: I610056b881022bb9408184d1ded4d80eedc410ab
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/173200
Commit-Queue: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31036}
This commit is contained in:
Kári Tristan Helgason 2020-04-08 20:28:23 +02:00 committed by Commit Bot
parent 5185df5cad
commit 8d8bae65e6
2 changed files with 3 additions and 2 deletions

View file

@ -157,7 +157,7 @@ std::vector<SdpVideoFormat> ObjCVideoEncoderFactory::GetSupportedFormats() const
}
std::vector<SdpVideoFormat> ObjCVideoEncoderFactory::GetImplementations() const {
if ([encoder_factory_ respondsToSelector:SEL("implementations")]) {
if ([encoder_factory_ respondsToSelector:@selector(implementations)]) {
std::vector<SdpVideoFormat> supported_formats;
for (RTCVideoCodecInfo *supportedCodec in [encoder_factory_ implementations]) {
SdpVideoFormat format = [supportedCodec nativeSdpVideoFormat];
@ -194,7 +194,7 @@ std::unique_ptr<VideoEncoder> ObjCVideoEncoderFactory::CreateVideoEncoder(
std::unique_ptr<VideoEncoderFactory::EncoderSelectorInterface>
ObjCVideoEncoderFactory::GetEncoderSelector() const {
if ([encoder_factory_ respondsToSelector:SEL("encoderSelector")]) {
if ([encoder_factory_ respondsToSelector:@selector(encoderSelector)]) {
return absl::make_unique<ObjcVideoEncoderSelector>([encoder_factory_ encoderSelector]);
}
return nullptr;

View file

@ -37,6 +37,7 @@ id<RTCVideoEncoderFactory> CreateEncoderFactoryReturning(int return_code) {
id encoderFactoryMock = OCMProtocolMock(@protocol(RTCVideoEncoderFactory));
RTCVideoCodecInfo *supported = [[RTCVideoCodecInfo alloc] initWithName:@"H264" parameters:nil];
OCMStub([encoderFactoryMock supportedCodecs]).andReturn(@[ supported ]);
OCMStub([encoderFactoryMock implementations]).andReturn(@[ supported ]);
OCMStub([encoderFactoryMock createEncoder:[OCMArg any]]).andReturn(encoderMock);
return encoderFactoryMock;
}