Skip to content

Commit

Permalink
Add Video subspec
Browse files Browse the repository at this point in the history
  • Loading branch information
maicki committed Nov 20, 2018
1 parent 9cf54e8 commit ed4ddb8
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 11 deletions.
1 change: 1 addition & 0 deletions AsyncDisplayKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2617,6 +2617,7 @@
"AS_USE_ASSETS_LIBRARY=1",
"AS_USE_MAPKIT=1",
"AS_USE_PHOTOS=1",
"AS_USE_VIDEO=1",
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand Down
5 changes: 5 additions & 0 deletions Source/ASVideoNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0
//

#import <AsyncDisplayKit/ASAvailability.h>
#import <AsyncDisplayKit/ASNetworkImageNode.h>

#if AS_USE_VIDEO

@class AVAsset, AVPlayer, AVPlayerLayer, AVPlayerItem, AVVideoComposition, AVAudioMix;
@protocol ASVideoNodeDelegate;

Expand Down Expand Up @@ -164,3 +167,5 @@ NS_ASSUME_NONNULL_BEGIN
@end

NS_ASSUME_NONNULL_END

#endif
7 changes: 6 additions & 1 deletion Source/ASVideoNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0
//

#import <AsyncDisplayKit/ASVideoNode.h>

#if AS_USE_VIDEO

#import <AVFoundation/AVFoundation.h>
#import <AsyncDisplayKit/ASDisplayNode+FrameworkPrivate.h>
#import <AsyncDisplayKit/ASDisplayNode+Subclasses.h>
#import <AsyncDisplayKit/ASDisplayNodeInternal.h>
#import <AsyncDisplayKit/ASVideoNode.h>
#import <AsyncDisplayKit/ASEqualityHelpers.h>
#import <AsyncDisplayKit/ASInternalHelpers.h>
#import <AsyncDisplayKit/ASDisplayNodeExtras.h>
Expand Down Expand Up @@ -856,3 +859,5 @@ - (void)dealloc
}

@end

#endif
6 changes: 6 additions & 0 deletions Source/ASVideoPlayerNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0
//

#import <AsyncDisplayKit/ASAvailability.h>

#if AS_USE_VIDEO

#if TARGET_OS_IOS
#import <CoreMedia/CoreMedia.h>
#import <AsyncDisplayKit/ASThread.h>
Expand Down Expand Up @@ -217,3 +221,5 @@ NS_ASSUME_NONNULL_BEGIN
@end
NS_ASSUME_NONNULL_END
#endif // TARGET_OS_IOS

#endif
7 changes: 4 additions & 3 deletions Source/ASVideoPlayerNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
// Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0
//

#import <Foundation/Foundation.h>
#import <AsyncDisplayKit/ASVideoPlayerNode.h>

#if AS_USE_VIDEO
#if TARGET_OS_IOS

#import <AsyncDisplayKit/ASVideoPlayerNode.h>

#import <AVFoundation/AVFoundation.h>

#import <AsyncDisplayKit/AsyncDisplayKit.h>
Expand Down Expand Up @@ -1016,3 +1015,5 @@ - (NSString *)timeStringForCMTime:(CMTime)time forTimeLabelType:(ASVideoPlayerNo
@end

#endif // TARGET_OS_IOS

#endif
3 changes: 2 additions & 1 deletion Source/AsyncDisplayKit.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@
#import <AsyncDisplayKit/ASImageNode.h>
#import <AsyncDisplayKit/ASTextNode.h>
#import <AsyncDisplayKit/ASTextNode2.h>
#import <AsyncDisplayKit/ASEditableTextNode.h>
#import <AsyncDisplayKit/ASButtonNode.h>
#import <AsyncDisplayKit/ASMapNode.h>

#import <AsyncDisplayKit/ASVideoNode.h>
#import <AsyncDisplayKit/ASVideoPlayerNode.h>
#import <AsyncDisplayKit/ASEditableTextNode.h>

#import <AsyncDisplayKit/ASImageProtocols.h>
#import <AsyncDisplayKit/ASBasicImageDownloader.h>
Expand Down
5 changes: 5 additions & 0 deletions Source/Base/ASAvailability.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
#define AS_TLS_AVAILABLE 1
#endif

// This needs to stay in sync with Weaver
#ifndef AS_USE_VIDEO
#define AS_USE_VIDEO 0
#endif

#ifndef AS_USE_PHOTOS
#define AS_USE_PHOTOS 0
#endif
Expand Down
12 changes: 7 additions & 5 deletions Texture.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ Pod::Spec.new do |spec|

# Subspecs
spec.subspec 'Core' do |core|

# These will be lowered into subspecs in the future. Only here for ASVideoNode.
core.frameworks = ['AVFoundation', 'CoreMedia']

core.compiler_flags = '-fno-exceptions -Wno-implicit-retain-self'
core.public_header_files = [
'Source/*.h',
Expand Down Expand Up @@ -59,6 +55,12 @@ Pod::Spec.new do |spec|
yoga.dependency 'Texture/Core'
end

spec.subspec 'Video' do |video|
video.frameworks = ['AVFoundation', 'CoreMedia']
video.xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) AS_USE_VIDEO=1' }
video.dependency 'Texture/Core'
end

spec.subspec 'MapKit' do |map|
map.frameworks = ['CoreLocation', 'MapKit']
map.xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) AS_USE_MAPKIT=1' }
Expand All @@ -79,7 +81,7 @@ Pod::Spec.new do |spec|

# Include these by default for backwards compatibility.
# This will change in 3.0.
spec.default_subspecs = 'PINRemoteImage', 'MapKit', 'AssetsLibrary', 'Photos'
spec.default_subspecs = 'Core', 'PINRemoteImage', 'Video', 'MapKit', 'AssetsLibrary', 'Photos'

spec.social_media_url = 'https://twitter.com/TextureiOS'
spec.library = 'c++'
Expand Down
3 changes: 2 additions & 1 deletion examples/ASDKgram/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ target 'Sample' do
pod 'Texture/IGListKit', :path => '../..'
pod 'Texture/PINRemoteImage', :path => '../..'
pod 'Texture/Yoga', :path => '../..'
pod 'Weaver'
pod 'Texture/Video', :path => '../..'
pod 'Weaver', :git => '[email protected]:TextureGroup/Weaver.git', :branch => 'master'
end

0 comments on commit ed4ddb8

Please sign in to comment.