Deprecate RTCRtpFragmentationHeader argument for objc decoders.

Bug: webrtc:6471
Change-Id: Id542360c470ed0ea13b7e963f11bcd50d52c1d43
Reviewed-on: https://webrtc-review.googlesource.com/72442
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Anders Carlsson <andersc@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23036}
This commit is contained in:
Niels Möller
2018-04-26 09:54:25 +02:00
committed by Commit Bot
parent 530a55fc86
commit c199fae89f
5 changed files with 56 additions and 13 deletions

View File

@ -24,12 +24,20 @@
id<RTCVideoDecoderFactory> CreateDecoderFactoryReturning(int return_code) {
id decoderMock = OCMProtocolMock(@protocol(RTCVideoDecoder));
OCMStub([decoderMock startDecodeWithNumberOfCores:1]).andReturn(return_code);
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
OCMStub([decoderMock decode:[OCMArg any]
missingFrames:NO
fragmentationHeader:[OCMArg any]
codecSpecificInfo:[OCMArg any]
renderTimeMs:0])
.andReturn(return_code);
#pragma clang diagnostic pop
OCMStub([decoderMock decode:[OCMArg any]
missingFrames:NO
codecSpecificInfo:[OCMArg any]
renderTimeMs:0])
.andReturn(return_code);
OCMStub([decoderMock releaseDecoder]).andReturn(return_code);
id decoderFactoryMock = OCMProtocolMock(@protocol(RTCVideoDecoderFactory));
@ -73,22 +81,20 @@ TEST(ObjCVideoDecoderFactoryTest, DecodeReturnsOKOnSuccess) {
webrtc::VideoDecoder *decoder = GetObjCDecoder(CreateOKDecoderFactory());
webrtc::EncodedImage encoded_image;
webrtc::RTPFragmentationHeader header;
webrtc::CodecSpecificInfo info;
info.codecType = webrtc::kVideoCodecH264;
EXPECT_EQ(decoder->Decode(encoded_image, false, &header, &info, 0), WEBRTC_VIDEO_CODEC_OK);
EXPECT_EQ(decoder->Decode(encoded_image, false, nullptr, &info, 0), WEBRTC_VIDEO_CODEC_OK);
}
TEST(ObjCVideoDecoderFactoryTest, DecodeReturnsErrorOnFail) {
webrtc::VideoDecoder *decoder = GetObjCDecoder(CreateErrorDecoderFactory());
webrtc::EncodedImage encoded_image;
webrtc::RTPFragmentationHeader header;
webrtc::CodecSpecificInfo info;
info.codecType = webrtc::kVideoCodecH264;
EXPECT_EQ(decoder->Decode(encoded_image, false, &header, &info, 0), WEBRTC_VIDEO_CODEC_ERROR);
EXPECT_EQ(decoder->Decode(encoded_image, false, nullptr, &info, 0), WEBRTC_VIDEO_CODEC_ERROR);
}
TEST(ObjCVideoDecoderFactoryTest, ReleaseDecodeReturnsOKOnSuccess) {