Build fix after r259385.
Reviewed by David Kilzer, Youenn Fablet.
Convert isStandardFrameSize() into a lambda function since it only has one call site.
* Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm:
(-[RTCVideoEncoderH264 resetCompressionSessionWithPixelFormat:]):
(isStandardFrameSize): Deleted.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@259397 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/ThirdParty/libwebrtc/ChangeLog b/Source/ThirdParty/libwebrtc/ChangeLog
index 4348f71..1109250 100644
--- a/Source/ThirdParty/libwebrtc/ChangeLog
+++ b/Source/ThirdParty/libwebrtc/ChangeLog
@@ -1,3 +1,15 @@
+2020-04-02 Simon Fraser <simon.fraser@apple.com>
+
+ Build fix after r259385.
+
+ Reviewed by David Kilzer, Youenn Fablet.
+
+ Convert isStandardFrameSize() into a lambda function since it only has one call site.
+
+ * Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm:
+ (-[RTCVideoEncoderH264 resetCompressionSessionWithPixelFormat:]):
+ (isStandardFrameSize): Deleted.
+
2020-04-02 Youenn Fablet <youenn@apple.com>
Temporarily restrict kVTVideoEncoderSpecification_RequiredLowLatency use to iOS
diff --git a/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm b/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm
index 5ffe624..94cbc41 100644
--- a/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm
+++ b/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm
@@ -48,34 +48,6 @@
VT_EXPORT const CFStringRef kVTVideoEncoderSpecification_Usage;
VT_EXPORT const CFStringRef kVTCompressionPropertyKey_Usage;
-#if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) && !HAVE_VTB_REQUIREDLOWLATENCY
-static inline bool isStandardFrameSize(int32_t width, int32_t height)
-{
- // FIXME: Envision relaxing this rule, something like width and height dividable by 4 or 8 should be good enough.
- if (width == 1280)
- return height == 720;
- if (width == 720)
- return height == 1280;
- if (width == 960)
- return height == 540;
- if (width == 540)
- return height == 960;
- if (width == 640)
- return height == 480;
- if (width == 480)
- return height == 640;
- if (width == 288)
- return height == 352;
- if (width == 352)
- return height == 288;
- if (width == 320)
- return height == 240;
- if (width == 240)
- return height == 320;
- return false;
-}
-#endif
-
@interface RTCVideoEncoderH264 ()
- (void)frameWasEncoded:(OSStatus)status
@@ -786,6 +758,31 @@
sourceAttributes = nullptr;
}
+ auto isStandardFrameSize = [](int32_t width, int32_t height) {
+ // FIXME: Envision relaxing this rule, something like width and height dividable by 4 or 8 should be good enough.
+ if (width == 1280)
+ return height == 720;
+ if (width == 720)
+ return height == 1280;
+ if (width == 960)
+ return height == 540;
+ if (width == 540)
+ return height == 960;
+ if (width == 640)
+ return height == 480;
+ if (width == 480)
+ return height == 640;
+ if (width == 288)
+ return height == 352;
+ if (width == 352)
+ return height == 288;
+ if (width == 320)
+ return height == 240;
+ if (width == 240)
+ return height == 320;
+ return false;
+ };
+
if (!isStandardFrameSize(_width, _height)) {
_disableEncoding = true;
RTC_LOG(LS_ERROR) << "Using H264 software encoder with non standard size is not supported";