avmedia/source/macavf/framegrabber.mm | 9 +++++++++ avmedia/source/macavf/player.mm | 4 ++++ avmedia/source/macavf/window.mm | 4 ++++ 3 files changed, 17 insertions(+)
New commits: commit e7c4129a5cc55c52c16af049f74cf67c48a10878 Author: Stephan Bergmann <stephan.bergm...@allotropia.de> AuthorDate: Mon Sep 30 10:04:52 2024 +0200 Commit: Stephan Bergmann <stephan.bergm...@allotropia.de> CommitDate: Mon Sep 30 12:07:21 2024 +0200 Silence -Werror,-Wdeprecated-declarations (macOS 15.0) Change-Id: Ic765a5c7259896d7b8caebd50460be57dec9ba64 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174262 Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de> Tested-by: Jenkins diff --git a/avmedia/source/macavf/framegrabber.mm b/avmedia/source/macavf/framegrabber.mm index e0b8bad61171..35f55e87b1b8 100644 --- a/avmedia/source/macavf/framegrabber.mm +++ b/avmedia/source/macavf/framegrabber.mm @@ -44,7 +44,11 @@ FrameGrabber::~FrameGrabber() bool FrameGrabber::create( AVAsset* pMovie ) { +SAL_WNODEPRECATED_DECLARATIONS_PUSH + // 'tracksWithMediaType:' is deprecated: first deprecated in macOS 15.0 - Use + // loadTracksWithMediaType:completionHandler: instead if( [[pMovie tracksWithMediaType:AVMediaTypeVideo] count] == 0) +SAL_WNODEPRECATED_DECLARATIONS_POP { SAL_WARN("avmedia", "AVGrabber::create() found no video content!" ); return false; @@ -63,7 +67,12 @@ uno::Reference< graphic::XGraphic > SAL_CALL FrameGrabber::grabFrame( double fMe return xRet; // get the requested image from the movie + +SAL_WNODEPRECATED_DECLARATIONS_PUSH + // 'copyCGImageAtTime:actualTime:error:' is deprecated: first deprecated in macOS 15.0 - + // Use generateCGImageAsynchronouslyForTime:completionHandler: instead CGImage* pCGImage = [mpImageGen copyCGImageAtTime:CMTimeMakeWithSeconds(fMediaTime,1000) actualTime:nullptr error:nullptr]; +SAL_WNODEPRECATED_DECLARATIONS_PUSH // convert the image to a TIFF-formatted byte-array CFMutableDataRef pCFData = CFDataCreateMutable( kCFAllocatorDefault, 0 ); diff --git a/avmedia/source/macavf/player.mm b/avmedia/source/macavf/player.mm index 401cba74c2d2..190840f6b11f 100644 --- a/avmedia/source/macavf/player.mm +++ b/avmedia/source/macavf/player.mm @@ -295,7 +295,11 @@ awt::Size SAL_CALL Player::getPreferredPlayerWindowSize() awt::Size aSize( 0, 0 ); // default size AVAsset* pMovie = [[mpPlayer currentItem] asset]; +SAL_WNODEPRECATED_DECLARATIONS_PUSH + // 'tracksWithMediaType:' is deprecated: first deprecated in macOS 15.0 - Use + // loadTracksWithMediaType:completionHandler: instead NSArray* pVideoTracks = [pMovie tracksWithMediaType:AVMediaTypeVideo]; +SAL_WNODEPRECATED_DECLARATIONS_POP if ([pVideoTracks count] > 0) { AVAssetTrack* pFirstVideoTrack = static_cast<AVAssetTrack*>([pVideoTracks objectAtIndex:0]); diff --git a/avmedia/source/macavf/window.mm b/avmedia/source/macavf/window.mm index fdb2e50655e8..dbf4b496131f 100644 --- a/avmedia/source/macavf/window.mm +++ b/avmedia/source/macavf/window.mm @@ -42,7 +42,11 @@ Window::Window( Player& i_rPlayer, NSView* i_pParentView ) // check the media asset for video content AVPlayer* pAVPlayer = mrPlayer.getAVPlayer(); AVAsset* pMovie = [[pAVPlayer currentItem] asset]; +SAL_WNODEPRECATED_DECLARATIONS_PUSH + // 'tracksWithMediaType:' is deprecated: first deprecated in macOS 15.0 - Use + // loadTracksWithMediaType:completionHandler: instead const int nVideoCount = [pMovie tracksWithMediaType:AVMediaTypeVideo].count; +SAL_WNODEPRECATED_DECLARATIONS_POP if( nVideoCount <= 0 ) return;