mac os 编译webrtc 报错screen_capturer_mac.mm:500:5: error: 'CGDisplayStreamStop' is only available on macOS 13.0 or newer [-Werror,-Wunguarded-availability-new]

../../modules/desktop_capture/mac/screen_capturer_mac.mm:462:11: error: 'CGDisplayStreamUpdateGetRects' is only available on macOS 13.0 or newer [-Werror,-Wunguarded-availability-new]
  462 |           CGDisplayStreamUpdateGetRects(updateRef, kCGDisplayStreamUpdateDirtyRects, &count);
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayStream.h:106:37: note: 'CGDisplayStreamUpdateGetRects' has been marked as being introduced in macOS 13.0 here, but the deployment target is macOS 10.15.0
  106 | CG_EXTERN const CGRect * __nullable CGDisplayStreamUpdateGetRects(CGDisplayStreamUpdateRef __nullable updateRef,
      |                                     ^
../../modules/desktop_capture/mac/screen_capturer_mac.mm:462:11: note: enclose 'CGDisplayStreamUpdateGetRects' in an @available check to silence this warning
  461 |       const CGRect* rects =
  462 |           CGDisplayStreamUpdateGetRects(updateRef, kCGDisplayStreamUpdateDirtyRects, &count);
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  463 |       if (count != 0) {
  464 |         // According to CGDisplayStream.h, it's safe to call
  465 |         // CGDisplayStreamStop() from within the callback.
  466 |         ScreenRefresh(display_id, count, rects, display_origin, frame_surface);
  467 |       }
      |
../../modules/desktop_capture/mac/screen_capturer_mac.mm:472:44: error: 'kCGDisplayStreamShowCursor' is only available on macOS 13.0 or newer [-Werror,-Wunguarded-availability-new]
  472 |                            (const void*[]){kCGDisplayStreamShowCursor},
      |                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayStream.h:195:30: note: 'kCGDisplayStreamShowCursor' has been marked as being introduced in macOS 13.0 here, but the deployment target is macOS 10.15.0
  195 | CG_EXTERN const CFStringRef  kCGDisplayStreamShowCursor CG_AVAILABLE_BUT_DEPRECATED(13.0, 14.0, "Please use ScreenCaptureKit API's SCStreamConfiguration showsCursor property instead");  /* CFBoolean - defaults to false */
      |                              ^
../../modules/desktop_capture/mac/screen_capturer_mac.mm:472:44: note: enclose 'kCGDisplayStreamShowCursor' in an @available check to silence this warning
  470 |     rtc::ScopedCFTypeRef<CFDictionaryRef> properties_dict(
  471 |         CFDictionaryCreate(kCFAllocatorDefault,
  472 |                            (const void*[]){kCGDisplayStreamShowCursor},
      |                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
  473 |                            (const void*[]){kCFBooleanFalse},
  474 |                            1,
  475 |                            &kCFTypeDictionaryKeyCallBacks,
  476 |                            &kCFTypeDictionaryValueCallBacks));
  477 |
  478 |     CGDisplayStreamRef display_stream = CGDisplayStreamCreate(
  479 |         display_id, pixel_width, pixel_height, 'BGRA', properties_dict.get(), handler);
      |
../../modules/desktop_capture/mac/screen_capturer_mac.mm:478:41: error: 'CGDisplayStreamCreate' is only available on macOS 13.0 or newer [-Werror,-Wunguarded-availability-new]
  478 |     CGDisplayStreamRef display_stream = CGDisplayStreamCreate(
      |                                         ^~~~~~~~~~~~~~~~~~~~~
../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayStream.h:243:41: note: 'CGDisplayStreamCreate' has been marked as being introduced in macOS 13.0 here, but the deployment target is macOS 10.15.0
  243 | CG_EXTERN CGDisplayStreamRef __nullable CGDisplayStreamCreate(CGDirectDisplayID display,
      |                                         ^
../../modules/desktop_capture/mac/screen_capturer_mac.mm:478:41: note: enclose 'CGDisplayStreamCreate' in an @available check to silence this warning
  478 |     CGDisplayStreamRef display_stream = CGDisplayStreamCreate(
      |                                         ^~~~~~~~~~~~~~~~~~~~~
  479 |         display_id, pixel_width, pixel_height, 'BGRA', properties_dict.get(), handler);
  480 |
  481 |     if (display_stream) {
  482 |       CGError error = CGDisplayStreamStart(display_stream);
  483 |       if (error != kCGErrorSuccess) return false;
  484 |
  485 |       CFRunLoopSourceRef source = CGDisplayStreamGetRunLoopSource(display_stream);
  486 |       CFRunLoopAddSource(CFRunLoopGetCurrent(), source, kCFRunLoopCommonModes);
  487 |       display_streams_.push_back(display_stream);
  488 |     }
      |
../../modules/desktop_capture/mac/screen_capturer_mac.mm:482:23: error: 'CGDisplayStreamStart' is only available on macOS 13.0 or newer [-Werror,-Wunguarded-availability-new]
  482 |       CGError error = CGDisplayStreamStart(display_stream);
      |                       ^~~~~~~~~~~~~~~~~~~~
../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayStream.h:273:19: note: 'CGDisplayStreamStart' has been marked as being introduced in macOS 13.0 here, but the deployment target is macOS 10.15.0
  273 | CG_EXTERN CGError CGDisplayStreamStart(CGDisplayStreamRef cg_nullable displayStream)
      |                   ^
../../modules/desktop_capture/mac/screen_capturer_mac.mm:482:23: note: enclose 'CGDisplayStreamStart' in an @available check to silence this warning
  482 |       CGError error = CGDisplayStreamStart(display_stream);
      |                       ^~~~~~~~~~~~~~~~~~~~
  483 |       if (error != kCGErrorSuccess) return false;
      |
../../modules/desktop_capture/mac/screen_capturer_mac.mm:485:35: error: 'CGDisplayStreamGetRunLoopSource' is only available on macOS 13.0 or newer [-Werror,-Wunguarded-availability-new]
  485 |       CFRunLoopSourceRef source = CGDisplayStreamGetRunLoopSource(display_stream);
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayStream.h:295:41: note: 'CGDisplayStreamGetRunLoopSource' has been marked as being introduced in macOS 13.0 here, but the deployment target is macOS 10.15.0
  295 | CG_EXTERN CFRunLoopSourceRef __nullable CGDisplayStreamGetRunLoopSource(CGDisplayStreamRef cg_nullable displayStream)
      |                                         ^
../../modules/desktop_capture/mac/screen_capturer_mac.mm:485:35: note: enclose 'CGDisplayStreamGetRunLoopSource' in an @available check to silence this warning
  485 |       CFRunLoopSourceRef source = CGDisplayStreamGetRunLoopSource(display_stream);
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  486 |       CFRunLoopAddSource(CFRunLoopGetCurrent(), source, kCFRunLoopCommonModes);
      |
../../modules/desktop_capture/mac/screen_capturer_mac.mm:498:33: error: 'CGDisplayStreamGetRunLoopSource' is only available on macOS 13.0 or newer [-Werror,-Wunguarded-availability-new]
  498 |     CFRunLoopSourceRef source = CGDisplayStreamGetRunLoopSource(stream);
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayStream.h:295:41: note: 'CGDisplayStreamGetRunLoopSource' has been marked as being introduced in macOS 13.0 here, but the deployment target is macOS 10.15.0
  295 | CG_EXTERN CFRunLoopSourceRef __nullable CGDisplayStreamGetRunLoopSource(CGDisplayStreamRef cg_nullable displayStream)
      |                                         ^
../../modules/desktop_capture/mac/screen_capturer_mac.mm:498:33: note: enclose 'CGDisplayStreamGetRunLoopSource' in an @available check to silence this warning
  498 |     CFRunLoopSourceRef source = CGDisplayStreamGetRunLoopSource(stream);
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  499 |     CFRunLoopRemoveSource(CFRunLoopGetCurrent(), source, kCFRunLoopCommonModes);
      |
../../modules/desktop_capture/mac/screen_capturer_mac.mm:500:5: error: 'CGDisplayStreamStop' is only available on macOS 13.0 or newer [-Werror,-Wunguarded-availability-new]
  500 |     CGDisplayStreamStop(stream);
      |     ^~~~~~~~~~~~~~~~~~~
../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayStream.h:285:19: note: 'CGDisplayStreamStop' has been marked as being introduced in macOS 13.0 here, but the deployment target is macOS 10.15.0
  285 | CG_EXTERN CGError CGDisplayStreamStop(CGDisplayStreamRef cg_nullable displayStream)
      |                   ^
../../modules/desktop_capture/mac/screen_capturer_mac.mm:500:5: note: enclose 'CGDisplayStreamStop' in an @available check to silence this warning
  500 |     CGDisplayStreamStop(stream);
      |     ^~~~~~~~~~~~~~~~~~~
7 errors generated.
[15/6442] CXX obj/modules/pacing/pacing_unittests/packet_router_unittest.o
ninja: build stopped: subcommand failed.

报错信息如上.

解决方法: 

refs: https://hg.mozilla.org/mozilla-central/rev/8443a5cec0ac (看这个就够了)

 https://bugzilla.mozilla.org/show_bug.cgi?id=1832717

posted @ 2023-11-06 15:14  yushimeng  阅读(145)  评论(0编辑  收藏  举报