Fix the build with newer clang and other custom configuration options
[WebKit-https.git] / Source / WebCore / platform / spi / mac / AVFoundationSPI.h
1 /*
2  * Copyright (C) 2015 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #import "SoftLinking.h"
27 #import <objc/runtime.h>
28
29 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
30
31 #if USE(APPLE_INTERNAL_SDK)
32
33 #import <AVFoundation/AVOutputContext.h>
34 #import <AVFoundation/AVPlayer_Private.h>
35
36 #else
37
38 #import <AVFoundation/AVPlayer.h>
39
40 NS_ASSUME_NONNULL_BEGIN
41
42 @class AVOutputContext;
43 @interface AVOutputContext : NSObject <NSSecureCoding>
44 @property (nonatomic, readonly) NSString *deviceName;
45 + (instancetype)outputContext;
46 @end
47
48 @interface AVPlayer (AVPlayerExternalPlaybackSupportPrivate)
49 @property (nonatomic, retain) AVOutputContext *outputContext;
50 @end
51
52 NS_ASSUME_NONNULL_END
53
54 #endif
55
56 #endif // ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
57
58 #if USE(APPLE_INTERNAL_SDK)
59 #import <AVFoundation/AVAssetCache_Private.h>
60 #else
61 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000)
62 #import <AVFoundation/AVAssetCache.h>
63 #else
64 @interface AVAssetCache : NSObject
65 @end
66 #endif
67 NS_ASSUME_NONNULL_BEGIN
68 @interface AVAssetCache ()
69 + (AVAssetCache *)assetCacheWithURL:(NSURL *)URL;
70 - (id)initWithURL:(NSURL *)URL;
71 - (NSArray *)allKeys;
72 - (NSDate *)lastModifiedDateOfEntryForKey:(NSString *)key;
73 - (void)removeEntryForKey:(NSString *)key;
74 @property (nonatomic, readonly, copy) NSURL *URL;
75 @end
76 NS_ASSUME_NONNULL_END
77 #endif
78
79 #if PLATFORM(IOS)
80
81 #if HAVE(AVKIT) && USE(APPLE_INTERNAL_SDK)
82
83 #import <AVFoundation/AVPlayerLayer_Private.h>
84 #import <AVKit/AVPlayerViewController_WebKitOnly.h>
85
86 #else
87
88 #import <AVFoundation/AVPlayerLayer.h>
89
90 #endif
91
92 #if !HAVE(AVKIT) || !USE(APPLE_INTERNAL_SDK)
93
94 @interface AVPlayerLayer (AVPlayerLayerPictureInPictureModeSupportPrivate)
95 - (void)setPIPModeEnabled:(BOOL)flag;
96 @end
97
98 #endif
99
100 #endif // PLATFORM(IOS)
101
102 // FIXME: Wrap in a #if USE(APPLE_INTERNAL_SDK) once this SPI lands
103 #import <AVFoundation/AVAssetResourceLoader.h>
104
105 NS_ASSUME_NONNULL_BEGIN
106
107 @interface AVAssetResourceLoader (AVAssetResourceLoaderPrivate)
108 @property (nonatomic, readonly) id<NSURLSessionDataDelegate> URLSessionDataDelegate;
109 @property (nonatomic, readonly) NSOperationQueue *URLSessionDataDelegateQueue;
110 @property (nonatomic, nullable, retain) NSURLSession *URLSession;
111 @end
112
113 NS_ASSUME_NONNULL_END