Further unreviewed watchOS build fix: videoPerformanceMetrics unavailable on watchOS.
[WebKit-https.git] / Source / WebCore / platform / graphics / avfoundation / objc / MediaPlayerPrivateAVFoundationObjC.mm
index c5ff0d9..d44a087 100644 (file)
@@ -3263,10 +3263,12 @@ std::optional<VideoPlaybackQualityMetrics> MediaPlayerPrivateAVFoundationObjC::v
     if (![m_videoLayer respondsToSelector:@selector(videoPerformanceMetrics)])
         return std::nullopt;
 
+#if PLATFORM(WATCHOS)
+    return std::nullopt;
+#else
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wunknown-pragmas"
 #pragma clang diagnostic ignored "-Wunguarded-availability-new"
-#if !PLATFORM(WATCHOS)
     auto metrics = [m_videoLayer videoPerformanceMetrics];
     if (!metrics)
         return std::nullopt;
@@ -3274,8 +3276,6 @@ std::optional<VideoPlaybackQualityMetrics> MediaPlayerPrivateAVFoundationObjC::v
     uint32_t displayCompositedFrames = 0;
     if ([metrics respondsToSelector:@selector(numberOfDisplayCompositedVideoFrames)])
         displayCompositedFrames = [metrics numberOfDisplayCompositedVideoFrames];
-#endif
-#pragma clang diagnostic pop
 
     return VideoPlaybackQualityMetrics {
         static_cast<uint32_t>([metrics totalNumberOfVideoFrames]),
@@ -3284,6 +3284,8 @@ std::optional<VideoPlaybackQualityMetrics> MediaPlayerPrivateAVFoundationObjC::v
         [metrics totalFrameDelay],
         displayCompositedFrames,
     };
+#pragma clang diagnostic pop
+#endif
 }
 
 NSArray* assetMetadataKeyNames()