ObjC: Deprecate codec settings parameter in startDecode method.

This parameter is being removed from the C++ API, remove it from the
ObjC API also. It was never used for anything by the H264 decoder.

Bug: webrtc:9107
Change-Id: I5222eac932a4e7d4129d803f8126b5e8d0b027b6
Reviewed-on: https://webrtc-review.googlesource.com/66740
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Commit-Queue: Anders Carlsson <andersc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22730}
This commit is contained in:
Anders Carlsson 2018-04-04 12:49:43 +02:00 committed by Commit Bot
parent 98ee49d5fb
commit 2a1bbc3422
5 changed files with 25 additions and 6 deletions

View File

@ -35,6 +35,11 @@
RTC_NOTREACHED();
}
- (NSInteger)startDecodeWithNumberOfCores:(int)numberOfCores {
RTC_NOTREACHED();
return 0;
}
- (NSInteger)startDecodeWithSettings:(RTCVideoEncoderSettings *)settings
numberOfCores:(int)numberOfCores {
RTC_NOTREACHED();

View File

@ -92,6 +92,10 @@ void decompressionOutputCallback(void *decoderRef,
[self setVideoFormat:nullptr];
}
- (NSInteger)startDecodeWithNumberOfCores:(int)numberOfCores {
return WEBRTC_VIDEO_CODEC_OK;
}
- (NSInteger)startDecodeWithSettings:(RTCVideoEncoderSettings *)settings
numberOfCores:(int)numberOfCores {
return WEBRTC_VIDEO_CODEC_OK;

View File

@ -166,7 +166,8 @@ RTC_EXPORT
- (void)setCallback:(RTCVideoDecoderCallback)callback;
- (NSInteger)startDecodeWithSettings:(RTCVideoEncoderSettings *)settings
numberOfCores:(int)numberOfCores;
numberOfCores:(int)numberOfCores
DEPRECATED_MSG_ATTRIBUTE("use startDecodeWithNumberOfCores: instead");
- (NSInteger)releaseDecoder;
- (NSInteger)decode:(RTCEncodedImage *)encodedImage
missingFrames:(BOOL)missingFrames
@ -175,6 +176,10 @@ RTC_EXPORT
renderTimeMs:(int64_t)renderTimeMs;
- (NSString *)implementationName;
// TODO(andersc): Make non-optional when `startDecodeWithSettings:numberOfCores:` is removed.
@optional
- (NSInteger)startDecodeWithNumberOfCores:(int)numberOfCores;
@end
NS_ASSUME_NONNULL_END

View File

@ -37,9 +37,15 @@ class ObjCVideoDecoder : public VideoDecoder {
: decoder_(decoder), implementation_name_([decoder implementationName].stdString) {}
int32_t InitDecode(const VideoCodec *codec_settings, int32_t number_of_cores) {
RTCVideoEncoderSettings *settings =
[[RTCVideoEncoderSettings alloc] initWithNativeVideoCodec:codec_settings];
return [decoder_ startDecodeWithSettings:settings numberOfCores:number_of_cores];
if ([decoder_ respondsToSelector:@selector(startDecodeWithNumberOfCores:)]) {
return [decoder_ startDecodeWithNumberOfCores:number_of_cores];
} else {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
RTCVideoEncoderSettings *settings = [[RTCVideoEncoderSettings alloc] init];
return [decoder_ startDecodeWithSettings:settings numberOfCores:number_of_cores];
#pragma clang diagnostic pop
}
}
int32_t Decode(const EncodedImage &input_image,

View File

@ -23,8 +23,7 @@
id<RTCVideoDecoderFactory> CreateDecoderFactoryReturning(int return_code) {
id decoderMock = OCMProtocolMock(@protocol(RTCVideoDecoder));
OCMStub([decoderMock startDecodeWithSettings:[OCMArg any] numberOfCores:1])
.andReturn(return_code);
OCMStub([decoderMock startDecodeWithNumberOfCores:1]).andReturn(return_code);
OCMStub([decoderMock decode:[OCMArg any]
missingFrames:NO
fragmentationHeader:[OCMArg any]