diff options
author | Stephan Bergmann <stephan.bergmann@allotropia.de> | 2024-09-30 10:04:52 +0200 |
---|---|---|
committer | Stephan Bergmann <stephan.bergmann@allotropia.de> | 2024-09-30 12:07:21 +0200 |
commit | e7c4129a5cc55c52c16af049f74cf67c48a10878 (patch) | |
tree | 365b088147feb3b7da1b235337221ea8a52686db /avmedia | |
parent | c3b3b27e57e476ba0ee7060ccd2fccd687188893 (diff) |
Silence -Werror,-Wdeprecated-declarations (macOS 15.0)
Change-Id: Ic765a5c7259896d7b8caebd50460be57dec9ba64
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174262
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Tested-by: Jenkins
Diffstat (limited to 'avmedia')
-rw-r--r-- | avmedia/source/macavf/framegrabber.mm | 9 | ||||
-rw-r--r-- | avmedia/source/macavf/player.mm | 4 | ||||
-rw-r--r-- | avmedia/source/macavf/window.mm | 4 |
3 files changed, 17 insertions, 0 deletions
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; |