From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 80F1348492 for ; Tue, 5 Dec 2023 14:16:21 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 42FB468CE3F; Tue, 5 Dec 2023 16:16:18 +0200 (EET) Received: from shout02.mail.de (shout02.mail.de [62.201.172.25]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5B01E68CCBF for ; Tue, 5 Dec 2023 16:16:12 +0200 (EET) Received: from postfix02.mail.de (postfix02.bt.mail.de [10.0.121.126]) by shout02.mail.de (Postfix) with ESMTP id B770C240E2A for ; Tue, 5 Dec 2023 15:16:11 +0100 (CET) Received: from smtp01.mail.de (smtp03.bt.mail.de [10.0.121.213]) by postfix02.mail.de (Postfix) with ESMTP id 9DC70A03C3 for ; Tue, 5 Dec 2023 15:16:11 +0100 (CET) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp01.mail.de (Postfix) with ESMTPSA id 7386E240AC9 for ; Tue, 5 Dec 2023 15:16:11 +0100 (CET) Message-ID: Date: Tue, 5 Dec 2023 15:16:10 +0100 MIME-Version: 1.0 Content-Language: en-US To: ffmpeg-devel@ffmpeg.org References: In-Reply-To: X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate: clean X-purgate-size: 2003 X-purgate-ID: 154282::1701785771-4DE241F9-ABD793E8/0/0 Subject: Re: [FFmpeg-devel] [PATCH] avdevice/avfoundation: replace AVCaptureDevice with new api X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Thilo Borgmann via ffmpeg-devel Reply-To: FFmpeg development discussions and patches Cc: Thilo Borgmann Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Hi, Am 05.12.23 um 14:33 schrieb xufuji456 via ffmpeg-devel: > Building with iOS platform, the compiler has a warning: "'devicesWithMediaType:' is deprecated: first deprecated in iOS 10.0 - Use AVCaptureDeviceDiscoverySession instead" > > Signed-off-by: xufuji456 <839789740@qq.com> > --- > libavdevice/avfoundation.m | 25 ++++++++++++++++++++----- > 1 file changed, 20 insertions(+), 5 deletions(-) > > diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m > index 36ad834753..1bc99d543a 100644 > --- a/libavdevice/avfoundation.m > +++ b/libavdevice/avfoundation.m > @@ -761,6 +761,21 @@ static int get_audio_config(AVFormatContext *s) > return 0; > } > > +static NSArray* getDevicesWithMediaType(AVMediaType mediaType) { > +#if ((TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MAX_ALLOWED >= 100000) || (TARGET_OS_OSX && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101500)) > + if (@available(macOS 10.15, iOS 10.0, *)) { The preprocessor guard is meant to void the @available condition. Also something appears not yet to achieve what you want, as on MacOS 13.4 I still get the deprication warning: libavdevice/avfoundation.m:776:29: warning: 'devicesWithMediaType:' is deprecated: first deprecated in macOS 10.15 - Use AVCaptureDeviceDiscoverySession instead. [-Wdeprecated-declarations] return [AVCaptureDevice devicesWithMediaType:mediaType]; > + AVCaptureDeviceDiscoverySession *captureDeviceDiscoverySession = > + [AVCaptureDeviceDiscoverySession > + discoverySessionWithDeviceTypes:@[AVCaptureDeviceTypeBuiltInWideAngleCamera] > + mediaType:mediaType > + position:AVCaptureDevicePositionUnspecified]; > + return [captureDeviceDiscoverySession devices]; > + } > +#endif why not #else... #endif ? > + // fallback > + return [AVCaptureDevice devicesWithMediaType:mediaType]; > +} > + Thanks, Thilo _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".