diff mbox series

[FFmpeg-devel] avfoundation: Fix building on iOS

Message ID 20200430103413.69715-1-martin@martin.st
State Accepted
Commit c810a9502cebe32e1dd08ee3d0d17053dde44aa9
Headers show
Series [FFmpeg-devel] avfoundation: Fix building on iOS | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Martin Storsjö April 30, 2020, 10:34 a.m. UTC
Apparently the changes from 3c9185bf3a83395d12a987f626dbdb985eac4320
aren't enough; even with that in place, I got errors like this
when trying to build for iOS:

src/libavdevice/avfoundation.m:135:5: error:
      'AVCaptureDeviceTransportControlsPlaybackMode' is unavailable: not
      available on iOS
    AVCaptureDeviceTransportControlsPlaybackMode observed_mode;
    ^
---
 libavdevice/avfoundation.m | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Thilo Borgmann April 30, 2020, 1:15 p.m. UTC | #1
Am 30.04.20 um 12:34 schrieb Martin Storsjö:
> Apparently the changes from 3c9185bf3a83395d12a987f626dbdb985eac4320
> aren't enough; even with that in place, I got errors like this
> when trying to build for iOS:
>
> src/libavdevice/avfoundation.m:135:5: error:
>       'AVCaptureDeviceTransportControlsPlaybackMode' is unavailable: not
>       available on iOS
>     AVCaptureDeviceTransportControlsPlaybackMode observed_mode;
>     ^
> ---
>  libavdevice/avfoundation.m | 4 ++++
>  1 file changed, 4 insertions(+)

Pushed, thanks!

-Thilo
diff mbox series

Patch

diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m
index 0b1888693f..59d5b0af4f 100644
--- a/libavdevice/avfoundation.m
+++ b/libavdevice/avfoundation.m
@@ -132,7 +132,9 @@ 
     CMSampleBufferRef         current_audio_frame;
 
     AVCaptureDevice          *observed_device;
+#if !TARGET_OS_IPHONE && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
     AVCaptureDeviceTransportControlsPlaybackMode observed_mode;
+#endif
     int                      observed_quit;
 } AVFContext;
 
@@ -200,6 +202,7 @@  - (void)observeValueForKeyPath:(NSString *)keyPath
                         change:(NSDictionary *)change
                        context:(void *)context {
     if (context == _context) {
+#if !TARGET_OS_IPHONE && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
         AVCaptureDeviceTransportControlsPlaybackMode mode =
             [change[NSKeyValueChangeNewKey] integerValue];
 
@@ -209,6 +212,7 @@  - (void)observeValueForKeyPath:(NSString *)keyPath
             }
             _context->observed_mode = mode;
         }
+#endif
     } else {
         [super observeValueForKeyPath: keyPath
                              ofObject: object