Skip to content

Commit

Permalink
added test app
Browse files Browse the repository at this point in the history
new test app demonstrates texture upload path from AVFoundation to GL textures when using AVFoundation and HapInAVFoundation framework
  • Loading branch information
mrRay committed Jan 30, 2017
1 parent ecc2db1 commit eb0600c
Show file tree
Hide file tree
Showing 33 changed files with 2,902 additions and 0 deletions.
58 changes: 58 additions & 0 deletions HapInAVF Test App/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"images" : [
{
"idiom" : "mac",
"size" : "16x16",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "16x16",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "32x32",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "32x32",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "128x128",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "128x128",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "256x256",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "256x256",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "512x512",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "512x512",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
698 changes: 698 additions & 0 deletions HapInAVF Test App/Base.lproj/MainMenu.xib

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions HapInAVF Test App/HapInAVFAppDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#import <Cocoa/Cocoa.h>
#import <VVBufferPool/VVBufferPool.h>
#import <VVISFKit/VVISFKit.h>
#import <HapInAVFoundation/HapInAVFoundation.h>
#import <AVFoundation/AVFoundation.h>




@interface HapInAVFAppDelegate : NSObject <NSApplicationDelegate> {
IBOutlet NSWindow *window;
IBOutlet VVBufferGLView *view;

CVDisplayLinkRef displayLink; // this "drives" rendering
NSOpenGLContext *sharedCtx; // GL contexts must be in the same sharegroup to share textures between them
CVOpenGLTextureCacheRef texCache;

AVPlayer *player;
AVPlayerItem *playerItem;
BOOL videoPlayerItemIsHap;
AVPlayerItemVideoOutput *nativeAVFOutput; // used if the file being played back is supported natively by AVFoundation
AVPlayerItemHapDXTOutput *hapOutput; // used if the file being played back has a hap track of some sort

ISFGLScene *swizzleScene; // used to convert YCoCg (HapQ) and YCoCg+A (HapQ+A) to RGBA

VVBuffer *lastRenderedBuffer;
}



- (BOOL) loadFileAtPath:(NSString *)n;
- (BOOL) loadFileAtURL:(NSURL *)n;
- (BOOL) loadAsset:(AVAsset *)n;

- (void) renderCallback;

- (VVBuffer *)allocBuffer;

@end





CVReturn displayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp *inNow, const CVTimeStamp *inOutputTime, CVOptionFlags flagsIn, CVOptionFlags *flagsOut, void *displayLinkContext);
Loading

0 comments on commit eb0600c

Please sign in to comment.