Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Drawing with NPOT and BGRA

  • Loading branch information...
commit 1882d6857d06414ddfc8659991319a8266a45e80 1 parent 1e69777
@gabriel authored
Showing with 2,395 additions and 3,357 deletions.
  1. +1 −1  Classes/FFProcessing/AVFoundation/FFAVCaptureSessionReader.h
  2. +11 −6 Classes/FFProcessing/AVFoundation/FFAVCaptureSessionReader.m
  3. +2 −3 Classes/FFProcessing/FFGLDrawable.h
  4. +16 −74 Classes/FFProcessing/FFGLDrawable.m
  5. +4 −0 Classes/FFProcessing/FFProcessing.h
  6. +10 −12 Classes/FFProcessing/FFProcessing.m
  7. +1 −0  Classes/FFProcessing/FFTypes.m
  8. +16 −0 Classes/FFProcessing/Filters/FFErodeFilter.h
  9. +36 −0 Classes/FFProcessing/Filters/FFErodeFilter.m
  10. +27 −0 Classes/FFProcessing/OpenGL/GHGLUtils.h
  11. +50 −0 Classes/FFProcessing/OpenGL/GHGLUtils.m
  12. +14 −0 Classes/FFProcessing/OpenGL/GHGLView.h
  13. +93 −1 Classes/FFProcessing/OpenGL/GHGLView.m
  14. +1 −1  Classes/FFProcessing/Processors/FFEncodeProcessor.m
  15. +0 −3  Classes/PB/PBApplicationController.h
  16. +22 −4 Classes/PB/PBApplicationController.m
  17. +4 −0 Classes/PB/PBCameraCaptureController.h
  18. +4 −3 Classes/PB/PBCameraCaptureController.m
  19. +1 −1  Classes/PB/UI/PBUIStatusView.m
  20. +2 −2 Config/Tests.xcconfig
  21. +80 −74 FFProcessing.xcodeproj/gabe.mode1v3
  22. +1,894 −3,137 FFProcessing.xcodeproj/gabe.pbxuser
  23. +64 −13 FFProcessing.xcodeproj/project.pbxproj
  24. BIN  Libraries/libGHUnitIPhone3_0/libGHUnitIPhone3_0.a
  25. BIN  Libraries/libGHUnitIPhone3_0/libGHUnitIPhone4_0.a
  26. +13 −8 Tests/FFEncoderTest.m
  27. +6 −14 Tests/FFProcessingTest.m
  28. +23 −0 Tests/OpenGL/GHGLUtilsTest.m
View
2  Classes/FFProcessing/AVFoundation/FFAVCaptureSessionReader.h
@@ -3,7 +3,7 @@
// FFProcessing
//
// Created by Gabriel Handford on 5/7/10.
-// Copyright 2010 Yelp. All rights reserved.
+// Copyright 2010. All rights reserved.
//
#import <AVFoundation/AVFoundation.h>
View
17 Classes/FFProcessing/AVFoundation/FFAVCaptureSessionReader.m
@@ -3,7 +3,7 @@
// FFProcessing
//
// Created by Gabriel Handford on 5/7/10.
-// Copyright 2010 Yelp. All rights reserved.
+// Copyright 2010. All rights reserved.
//
#import "FFAVCaptureSessionReader.h"
@@ -11,23 +11,24 @@
#define kCVPixelFormat kCVPixelFormatType_32BGRA
#define kPixelFormat PIX_FMT_BGRA
+#define kConverterPixelFormat PIX_FMT_BGRA
+//#define kConverterPixelFormat PIX_FMT_RGB24
//#define kCVPixelFormat kCVPixelFormatType_24RGB
//#define kPixelFormat PIX_FMT_RGB24
-#define kConverterPixelFormat PIX_FMT_RGB24
@implementation FFAVCaptureSessionReader
- (id)init {
if ((self = [super init])) {
- _avFrame = FFAVFrameNone;
- _converter = [[FFConverter alloc] initWithAVFormat:FFAVFormatMake(512, 512, kConverterPixelFormat)];
+ _avFrame = FFAVFrameNone;
}
return self;
}
- (void)dealloc {
FFAVFrameRelease(_avFrame);
- av_free(_data);
+ // Data is free above since it was set in the FFAVFrame
+ //av_free(_data);
[super dealloc];
}
@@ -63,7 +64,11 @@ - (FFAVFrame)nextFrame:(NSError **)error {
//FFDebug(@"Next frame");
FFAVFrameSetData(_avFrame, _data);
_dataChanged = NO;
- return [_converter scalePicture:_avFrame error:nil];
+ if (_converter) {
+ return [_converter scalePicture:_avFrame error:nil];
+ } else {
+ return _avFrame;
+ }
}
return FFAVFrameNone;
}
View
5 Classes/FFProcessing/FFGLDrawable.h
@@ -9,13 +9,12 @@
#import "GHGLView.h"
#import "FFReader.h"
-@interface FFGLDrawable : NSObject <GHGLViewDrawable> {
+@interface FFGLDrawable : GHGLViewDrawable {
id<FFReader> _reader;
id<FFFilter> _filter;
- GLuint _videoTexture[1];
- BOOL _textureLoaded;
+ GLint _format; // For example, GL_RGB, GL_BGRA
}
View
90 Classes/FFProcessing/FFGLDrawable.m
@@ -8,6 +8,7 @@
#import "FFGLDrawable.h"
#import "FFUtils.h"
+#import "GHGLUtils.h"
@implementation FFGLDrawable
@@ -16,6 +17,7 @@ - (id)initWithReader:(id<FFReader>)reader filter:(id<FFFilter>)filter {
if ((self = [self init])) {
_reader = [reader retain];
_filter = [filter retain];
+ _format = GL_BGRA;
}
return self;
}
@@ -23,80 +25,9 @@ - (id)initWithReader:(id<FFReader>)reader filter:(id<FFFilter>)filter {
- (void)dealloc {
[_reader release];
[_filter release];
- glDeleteTextures(1, &_videoTexture[0]);
[super dealloc];
}
-- (void)setupView:(GHGLView *)view {
- glViewport(0, 0, view.backingWidth, view.backingHeight);
- FFDebug(@"Viewport: (%d, %d, %d, %d)", 0, 0, view.backingWidth, view.backingHeight);
- glMatrixMode(GL_PROJECTION);
-
- glLoadIdentity();
-
- glOrthof(0, view.backingWidth, view.backingHeight, 0, -100, 100);
- glMatrixMode(GL_MODELVIEW);
-
- glEnable(GL_TEXTURE_2D);
- glGenTextures(1, &_videoTexture[0]);
-
-}
-
-- (void)drawInRect:(CGRect)rect {
-
- // Portrait
- /*
- const GLfloat vertices[] = {
- rect.origin.x, rect.origin.y,
- rect.origin.x + rect.size.width, rect.origin.y,
- rect.origin.x, rect.origin.y + rect.size.height,
- rect.origin.x + rect.size.width, rect.origin.y + rect.size.height
- };
-
- // Coords flipped so we appear right side up
- const GLfloat texCoords[] = {
- 0, 0,
- 1, 0,
- 0, 1,
- 1, 1,
- };
- */
-
- // Landscape
- const GLfloat vertices[] = {
- rect.origin.y, rect.origin.x,
- rect.origin.y, rect.origin.x + rect.size.width,
- rect.origin.y + rect.size.height, rect.origin.x,
- rect.origin.y + rect.size.height, rect.origin.x + rect.size.width,
- };
-
- const GLfloat texCoords[] = {
- 0, 1,
- 1, 1,
- 0, 0,
- 1, 0,
- };
-
- glEnable(GL_TEXTURE_2D);
- glBindTexture(GL_TEXTURE_2D, _videoTexture[0]);
- glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
-
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
-
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
- glVertexPointer(2, GL_FLOAT, 0, vertices);
- glTexCoordPointer(2, GL_FLOAT, 0, texCoords);
-
- glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
-
- glDisableClientState(GL_VERTEX_ARRAY);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- glDisable(GL_TEXTURE_2D);
-
-}
-
- (BOOL)drawView:(CGRect)frame inView:(GHGLView *)view {
FFAVFrame avFrame = [_reader nextFrame:nil];
@@ -106,6 +37,14 @@ - (BOOL)drawView:(CGRect)frame inView:(GHGLView *)view {
avFrame = [_filter filterAVFrame:avFrame error:nil];
if (avFrame.frame == NULL) return NO;
}
+
+ /*
+ // NPOT
+ int width = avFrame.avFormat.width;
+ int height = avFrame.avFormat.height;
+ NSUInteger widthPOT = GHGLNextPOT(width);
+ NSUInteger heightPOT = GHGLNextPOT(height);
+ */
uint8_t *nextData = avFrame.frame->data[0];
if (nextData == NULL) return NO;
@@ -118,17 +57,20 @@ - (BOOL)drawView:(CGRect)frame inView:(GHGLView *)view {
glBindTexture(GL_TEXTURE_2D, _videoTexture[0]);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ // You have to do clamp to edge to support NPOT textures
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
if (!_textureLoaded) {
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, avFrame.avFormat.width, avFrame.avFormat.height, 0, GL_RGB, GL_UNSIGNED_BYTE, nextData);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, avFrame.avFormat.width, avFrame.avFormat.height, 0, _format, GL_UNSIGNED_BYTE, nextData);
} else {
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, avFrame.avFormat.width, avFrame.avFormat.height,
- GL_RGB, GL_UNSIGNED_BYTE, nextData);
+ _format, GL_UNSIGNED_BYTE, nextData);
}
GLenum GLError = glGetError();
if (GLError != GL_NO_ERROR) {
- FFDebug(@"GL error: %d", GLError);
+ FFDebug(@"GL error: %@", GHGLErrorDescription(GLError));
return NO;
} else if (!_textureLoaded) {
FFDebug(@"Texture loaded");
View
4 Classes/FFProcessing/FFProcessing.h
@@ -26,6 +26,8 @@
id<FFFilter>_filter;
id<FFProcessor> _processor;
+ BOOL _open;
+
FFDecoder *_decoder;
AVFrame *_decoderFrame;
FFAVFrame _decodedFrame;
@@ -47,4 +49,6 @@
- (void)cancel;
+- (BOOL)close:(NSError **)error;
+
@end
View
22 Classes/FFProcessing/FFProcessing.m
@@ -27,6 +27,7 @@ - (id)initWithProcessor:(id<FFProcessor>)processor filter:(id<FFFilter>)filter {
}
- (void)dealloc {
+ [self close:nil];
[_processor release];
[_filter release];
[super dealloc];
@@ -83,6 +84,7 @@ - (BOOL)_processAtIndex:(NSInteger)index count:(NSInteger)count error:(NSError *
_previousEndPTS = 0;
if (![_processor open:error])
return NO;
+ _open = YES;
}
while (!_cancelled) {
@@ -121,8 +123,7 @@ - (BOOL)_processAtIndex:(NSInteger)index count:(NSInteger)count error:(NSError *
// Last file
if (index == (count - 1)) {
- // TODO(gabe): What to do with errors
- [_processor close:nil];
+ [self close:error];
}
if (_cancelled) {
@@ -138,16 +139,13 @@ - (void)cancel {
_cancelled = YES;
}
-- (void)_converter {
- // Setup converter
- /*!
- _converter = [[FFConverter alloc] initWithSourceWidth:[_options sourceWidth]
- sourceHeight:[_options sourceHeight]
- sourcePixelFormat:[_options sourcePixelFormat]
- destWidth:[_options width]
- destHeight:[_options height]
- destPixelFormat:[_options pixelFormat]];
- */
+- (BOOL)close:(NSError **)error {
+ if (_open) {
+ BOOL closed = [_processor close:error];
+ _open = NO;
+ return closed;
+ }
+ return NO;
}
@end
View
1  Classes/FFProcessing/FFTypes.m
@@ -18,6 +18,7 @@ FFAVFrame FFAVFrameCreate(FFAVFormat avFormat) {
}
void FFAVFrameSetData(FFAVFrame avFrame, uint8_t *data) {
+ // TODO(gabe): Deallocate existing data
avpicture_fill((AVPicture *)avFrame.frame, data, avFrame.avFormat.pixelFormat, avFrame.avFormat.width, avFrame.avFormat.height);
}
View
16 Classes/FFProcessing/Filters/FFErodeFilter.h
@@ -0,0 +1,16 @@
+//
+// FFErodeFilter.h
+// FFProcessing
+//
+// Created by Gabriel Handford on 5/9/10.
+// Copyright 2010. All rights reserved.
+//
+
+#import "cv.h"
+
+
+@interface FFErodeFilter : NSObject {
+ IplImage *_image;
+}
+
+@end
View
36 Classes/FFProcessing/Filters/FFErodeFilter.m
@@ -0,0 +1,36 @@
+//
+// FFErodeFilter.m
+// FFProcessing
+//
+// Created by Gabriel Handford on 5/9/10.
+// Copyright 2010. All rights reserved.
+//
+
+#import "FFErodeFilter.h"
+
+#import "FFTypes.h"
+#import "FFUtils.h"
+
+@implementation FFErodeFilter
+
+- (void)dealloc {
+ if (_image) cvReleaseImage(&_image);
+ [super dealloc];
+}
+
+- (FFAVFrame)filterAVFrame:(FFAVFrame)avFrame error:(NSError **)error {
+
+ CvSize size = cvSize(avFrame.avFormat.width, avFrame.avFormat.height);
+ if (!_image) _image = cvCreateImage(size, IPL_DEPTH_8U, 3);
+
+ _image->imageData = (char *)avFrame.frame->data[0];
+
+ FFDebug(@"Erode");
+ cvErode(_image, _image, NULL, 3);
+
+ avFrame.frame->data[0] = (uint8_t *)_image->imageData;
+
+ return avFrame;
+}
+
+@end
View
27 Classes/FFProcessing/OpenGL/GHGLUtils.h
@@ -0,0 +1,27 @@
+//
+// GHGLUtils.h
+// FFProcessing
+//
+// Created by Gabriel Handford on 5/10/10.
+// Copyright 2010. All rights reserved.
+//
+
+#import <OpenGLES/ES1/gl.h>
+
+/*!
+ Next power of two. Used for padding GL textures.
+ */
+NSUInteger GHGLNextPOT(NSUInteger x);
+
+extern NSString *const GHGLExtension_GL_APPLE_texture_2D_limited_npot;
+extern NSString *const GHGLExtension_GL_IMG_texture_format_BGRA8888;
+
+BOOL GHGLCheckForExtension(NSString *name);
+
+NSString *GHGLErrorDescription(GLenum error);
+
+@interface GHGLUtils : NSObject {
+
+}
+
+@end
View
50 Classes/FFProcessing/OpenGL/GHGLUtils.m
@@ -0,0 +1,50 @@
+//
+// GHGLUtils.m
+// FFProcessing
+//
+// Created by Gabriel Handford on 5/10/10.
+// Copyright 2010. All rights reserved.
+//
+
+#import "GHGLDefines.h"
+#import "GHGLUtils.h"
+
+NSUInteger GHGLNextPOT(NSUInteger x) {
+ x = x - 1;
+ x = x | (x >> 1);
+ x = x | (x >> 2);
+ x = x | (x >> 4);
+ x = x | (x >> 8);
+ x = x | (x >>16);
+ return x + 1;
+}
+
+NSString *const GHGLExtension_GL_APPLE_texture_2D_limited_npot = @"GL_APPLE_texture_2D_limited_npot";
+NSString *const GHGLExtension_GL_IMG_texture_format_BGRA8888 = @"GL_APPLE_texture_format_BGRA8888";
+
+BOOL GHGLCheckForExtension(NSString *name) {
+ static NSArray *ExtensionNames = NULL;
+ if (ExtensionNames == NULL) {
+ NSString *extensionsString = [NSString stringWithCString:(char *)glGetString(GL_EXTENSIONS) encoding:NSASCIIStringEncoding];
+ ExtensionNames = [[extensionsString componentsSeparatedByString:@" "] retain];
+ //GHGLDebug(@"Extension names: %@", ExtensionNames);
+ }
+ return [ExtensionNames containsObject:name];
+}
+
+NSString *GHGLErrorDescription(GLenum GLError) {
+ switch (GLError) {
+ case GL_INVALID_ENUM: return [NSString stringWithFormat:@"GL_INVALID_ENUM (%d)", GLError];
+ case GL_INVALID_VALUE: return [NSString stringWithFormat:@"GL_INVALID_VALUE (%d)", GLError];
+ case GL_INVALID_OPERATION: return [NSString stringWithFormat:@"GL_INVALID_OPERATION (%d)", GLError];
+ case GL_STACK_OVERFLOW: return [NSString stringWithFormat:@"GL_STACK_OVERFLOW (%d)", GLError];
+ case GL_STACK_UNDERFLOW: return [NSString stringWithFormat:@"GL_STACK_UNDERFLOW (%d)", GLError];
+ case GL_OUT_OF_MEMORY: return [NSString stringWithFormat:@"GL_OUT_OF_MEMORY (%d)", GLError];
+ default:
+ return [NSString stringWithFormat:@"Unkown (%d)", GLError];
+ }
+}
+
+@implementation GHGLUtils
+
+@end
View
14 Classes/FFProcessing/OpenGL/GHGLView.h
@@ -34,6 +34,10 @@
id _displayLink;
BOOL _displayLinkSupported;
+ GLint _maxTextureSize;
+ BOOL _supportsBGRA8888;
+ BOOL _supportsNPOT;
+
id<GHGLViewDrawable> _drawable; // weak
}
@@ -48,3 +52,13 @@
- (void)drawView;
@end
+
+
+@interface GHGLViewDrawable : NSObject <GHGLViewDrawable> {
+ GLuint _videoTexture[1];
+ BOOL _textureLoaded;
+}
+
+- (void)drawInRect:(CGRect)rect;
+
+@end
View
94 Classes/FFProcessing/OpenGL/GHGLView.m
@@ -8,7 +8,7 @@
#import "GHGLView.h"
#import "GHGLDefines.h"
-#import "FFUtils.h"
+#import "GHGLUtils.h"
@interface GHGLView ()
@@ -50,6 +50,14 @@ - (id)initWithFrame:(CGRect)frame {
#if kAttemptToUseOpenGLES2
}
#endif
+
+ glGetIntegerv(GL_MAX_TEXTURE_SIZE, &_maxTextureSize);
+ _supportsNPOT = GHGLCheckForExtension(GHGLExtension_GL_APPLE_texture_2D_limited_npot);
+ _supportsBGRA8888 = GHGLCheckForExtension(GHGLExtension_GL_IMG_texture_format_BGRA8888);
+
+ GHGLDebug(@"GL_MAX_TEXTURE_SIZE: %d", _maxTextureSize);
+ GHGLDebug(@"Supports BGRA8888 textures: %d", _supportsBGRA8888);
+ GHGLDebug(@"Supports NPOT textures: %d", _supportsNPOT);
_animationInterval = 1.0 / 10.0;
@@ -177,3 +185,87 @@ - (void)setAnimationInterval:(NSTimeInterval)animationInterval {
}
@end
+
+
+@implementation GHGLViewDrawable
+
+- (void)dealloc {
+ glDeleteTextures(1, &_videoTexture[0]);
+ [super dealloc];
+}
+
+- (void)setupView:(GHGLView *)view {
+ glViewport(0, 0, view.backingWidth, view.backingHeight);
+ GHGLDebug(@"Viewport: (%d, %d, %d, %d)", 0, 0, view.backingWidth, view.backingHeight);
+ glMatrixMode(GL_PROJECTION);
+
+ glLoadIdentity();
+
+ glOrthof(0, view.backingWidth, view.backingHeight, 0, -100, 100);
+ glMatrixMode(GL_MODELVIEW);
+
+ glEnable(GL_TEXTURE_2D);
+ glGenTextures(1, &_videoTexture[0]);
+}
+
+- (void)drawInRect:(CGRect)rect {
+
+ // Portrait
+ /*
+ const GLfloat vertices[] = {
+ rect.origin.x, rect.origin.y,
+ rect.origin.x + rect.size.width, rect.origin.y,
+ rect.origin.x, rect.origin.y + rect.size.height,
+ rect.origin.x + rect.size.width, rect.origin.y + rect.size.height
+ };
+
+ // Coords flipped so we appear right side up
+ const GLfloat texCoords[] = {
+ 0, 0,
+ 1, 0,
+ 0, 1,
+ 1, 1,
+ };
+ */
+
+ // Landscape
+ const GLfloat vertices[] = {
+ rect.origin.y, rect.origin.x,
+ rect.origin.y, rect.origin.x + rect.size.width,
+ rect.origin.y + rect.size.height, rect.origin.x,
+ rect.origin.y + rect.size.height, rect.origin.x + rect.size.width,
+ };
+
+ const GLfloat texCoords[] = {
+ 0, 1,
+ 1, 1,
+ 0, 0,
+ 1, 0,
+ };
+
+ glEnable(GL_TEXTURE_2D);
+ glBindTexture(GL_TEXTURE_2D, _videoTexture[0]);
+ glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+ glVertexPointer(2, GL_FLOAT, 0, vertices);
+ glTexCoordPointer(2, GL_FLOAT, 0, texCoords);
+
+ glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+ glDisable(GL_TEXTURE_2D);
+
+}
+
+- (BOOL)drawView:(CGRect)frame inView:(GHGLView *)view {
+ // Subclasses should implement
+ return NO;
+}
+
+@end
View
2  Classes/FFProcessing/Processors/FFEncodeProcessor.m
@@ -41,7 +41,7 @@ - (BOOL)openEncoderWithAVFormat:(FFAVFormat)avFormat decoder:(FFDecoder *)decode
FFEncoderOptions *options = [[FFEncoderOptions alloc] initWithPath:_encoderOptions.path
format:_encoderOptions.format
codecName:_encoderOptions.codecName
- avFormat:encoderAVFormat
+ avFormat:encoderAVFormat
videoTimeBase:videoTimeBase];
_encoder = [[FFEncoder alloc] initWithOptions:options];
View
3  Classes/PB/PBApplicationController.h
@@ -10,7 +10,6 @@
#import "PBMediaListViewController.h"
#import "PBMoviePlayerController.h"
-#import "PBCameraCaptureController.h"
#import "PBProcessing.h"
#import "PBSaveThread.h"
@@ -20,8 +19,6 @@
PBMoviePlayerController *_moviePlayerController;
PBProcessing *_processing;
- PBCameraCaptureController *_cameraCaptureController;
-
NSURL *_sourceURL;
}
View
26 Classes/PB/PBApplicationController.m
@@ -11,6 +11,9 @@
#import "FFUtils.h"
#import "PBUIItem.h"
#import "YPUIAlertView.h"
+#import "PBCameraCaptureController.h"
+#import "FFCannyEdgeFilter.h"
+#import "FFErodeFilter.h"
@implementation PBApplicationController
@@ -43,7 +46,8 @@ - (void)viewDidLoad {
[items addObject:[PBUIItem text:@"Play Movie" target:self action:@selector(openMoviePlayerController)]];
[items addObject:[PBUIItem text:@"Save" target:self action:@selector(saveMovieToPhotosAlbum)]];
[items addObject:[PBUIItem text:@"Camera Capture" target:self action:@selector(openCameraCapture)]];
-
+ [items addObject:[PBUIItem text:@"Camera Capture (Edge)" target:self action:@selector(openCameraCaptureEdge)]];
+ [items addObject:[PBUIItem text:@"Camera Capture (Test)" target:self action:@selector(openCameraCaptureTest)]];
[self setItems:items];
if (!_mediaListViewController) {
@@ -94,9 +98,23 @@ - (void)saveMovieToPhotosAlbum {
}
- (void)openCameraCapture {
- if (!_cameraCaptureController)
- _cameraCaptureController = [[PBCameraCaptureController alloc] init];
- [self.navigationController pushViewController:_cameraCaptureController animated:YES];
+ PBCameraCaptureController *cameraCaptureController = [[PBCameraCaptureController alloc] init];
+ [self.navigationController pushViewController:cameraCaptureController animated:YES];
+ [cameraCaptureController release];
+}
+
+- (void)openCameraCaptureEdge {
+ PBCameraCaptureController *cameraCaptureController = [[PBCameraCaptureController alloc] init];
+ cameraCaptureController.filter = [[[FFCannyEdgeFilter alloc] init] autorelease];
+ [self.navigationController pushViewController:cameraCaptureController animated:YES];
+ [cameraCaptureController release];
+}
+
+- (void)openCameraCaptureTest {
+ PBCameraCaptureController *cameraCaptureController = [[PBCameraCaptureController alloc] init];
+ cameraCaptureController.filter = [[[FFErodeFilter alloc] init] autorelease];
+ [self.navigationController pushViewController:cameraCaptureController animated:YES];
+ [cameraCaptureController release];
}
- (void)_showError:(NSError *)error {
View
4 Classes/PB/PBCameraCaptureController.h
@@ -14,6 +14,10 @@
@interface PBCameraCaptureController : UIViewController {
FFPlayerView *_playerView;
FFAVCaptureSessionReader *_reader;
+
+ id<FFFilter> _filter;
}
+@property (retain, nonatomic) id<FFFilter> filter;
+
@end
View
7 Classes/PB/PBCameraCaptureController.m
@@ -8,20 +8,21 @@
#import "PBCameraCaptureController.h"
#import "FFUtils.h"
-#import "FFCannyEdgeFilter.h"
@implementation PBCameraCaptureController
+@synthesize filter=_filter;
+
- (void)dealloc {
[_reader release];
[_playerView release];
+ [_filter release];
[super dealloc];
}
- (void)loadView {
_reader = [[FFAVCaptureSessionReader alloc] init];
- id<FFFilter> filter = [[[FFCannyEdgeFilter alloc] init] autorelease];
- _playerView = [[FFPlayerView alloc] initWithFrame:CGRectMake(0, 0, 320, 416) reader:_reader filter:filter];
+ _playerView = [[FFPlayerView alloc] initWithFrame:CGRectMake(0, 0, 320, 416) reader:_reader filter:_filter];
self.view = _playerView;
}
View
2  Classes/PB/UI/PBUIStatusView.m
@@ -7,7 +7,7 @@
//
#import "PBUIStatusView.h"
-
+#import <QuartzCore/QuartzCore.h>
@implementation PBUIStatusView
View
4 Config/Tests.xcconfig
@@ -1,7 +1,7 @@
ARCHS = armv7
VALID_ARCHS = armv7
-HEADER_SEARCH_PATHS = ../ffmpeg-build/ffmpeg-uarch/include/**
+HEADER_SEARCH_PATHS = ../ffmpeg-build/ffmpeg-uarch/include/** Libraries/OpenCV/include/**
GCC_PRECOMPILE_PREFIX_HEADER = YES
ALWAYS_SEARCH_USER_PATHS = NO
ZERO_LINK = NO
@@ -11,5 +11,5 @@ OTHER_LDFLAGS = -ObjC -all_load
GCC_PREFIX_HEADER = $(SYSTEM_LIBRARY_DIR)/Frameworks/UIKit.framework/Headers/UIKit.h
GCC_PRECOMPILE_PREFIX_HEADER = YES
INFOPLIST_FILE = Resources/Tests-Info.plist
-LIBRARY_SEARCH_PATHS = "$(SRCROOT)/Libraries/libGHUnitIPhone3_0" "$(SRCROOT)/../ffmpeg-build/ffmpeg-uarch/lib" "$(SRCROOT)/../ffmpeg-build/x264-uarch/lib" "$(SRCROOT)/../ffmpeg-build/xvid-uarch/lib"
+LIBRARY_SEARCH_PATHS = $(inherited) "$(SRCROOT)/Libraries/libGHUnitIPhone3_0" "$(SRCROOT)/Libraries/OpenCV/lib" "$(SRCROOT)/../ffmpeg-build/ffmpeg-uarch/lib" "$(SRCROOT)/../ffmpeg-build/x264-uarch/lib" "$(SRCROOT)/../ffmpeg-build/xvid-uarch/lib"
COPY_PHASE_STRIP = NO
View
154 FFProcessing.xcodeproj/gabe.mode1v3
@@ -302,22 +302,26 @@
<string>00DDF3FF115F3CC100310925</string>
<string>001E7A7B118FF848009E8C00</string>
<string>008C0A24117A9460002689B8</string>
+ <string>00F824B91165A43600175A32</string>
<string>29B97315FDCFA39411CA2CEA</string>
<string>29B97317FDCFA39411CA2CEA</string>
<string>29B97323FDCFA39411CA2CEA</string>
<string>19C28FACFE9D520D11CA2CBB</string>
<string>1C37FBAC04509CD000000102</string>
+ <string>003AEC561199238D0074D7F0</string>
<string>1C37FAAC04509CD000000102</string>
<string>1C37FABC05509CD000000102</string>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array>
<array>
- <integer>150</integer>
+ <integer>169</integer>
+ <integer>166</integer>
+ <integer>163</integer>
</array>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
- <string>{{0, 47}, {335, 248}}</string>
+ <string>{{0, 2702}, {335, 358}}</string>
</dict>
<key>PBXTopSmartGroupGIDs</key>
<array/>
@@ -329,7 +333,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {352, 266}}</string>
+ <string>{{0, 0}, {352, 376}}</string>
<key>GroupTreeTableConfiguration</key>
<array>
<string>MainColumn</string>
@@ -341,7 +345,7 @@
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
<key>Proportion</key>
- <string>266pt</string>
+ <string>376pt</string>
</dict>
<dict>
<key>ContentConfiguration</key>
@@ -381,16 +385,14 @@
<string>29B97314FDCFA39411CA2CEA</string>
<string>080E96DDFE201D6D7F000001</string>
<string>0007416B1161CDE600D8283B</string>
- <string>00234B91116D900400088651</string>
<string>00129F1911549B3500D09836</string>
<string>00BBEBF911940ABA001BE653</string>
+ <string>00129F2911549B3500D09836</string>
<string>00DDF3E8115F3BB200310925</string>
+ <string>00F57DA511991B0000ED284D</string>
<string>00DB9CCD1164810D002A7F8F</string>
<string>00DDF3FF115F3CC100310925</string>
<string>001E7A7B118FF848009E8C00</string>
- <string>29B97315FDCFA39411CA2CEA</string>
- <string>29B97317FDCFA39411CA2CEA</string>
- <string>29B97323FDCFA39411CA2CEA</string>
<string>1C37FBAC04509CD000000102</string>
<string>1C37FAAC04509CD000000102</string>
<string>1C37FABC05509CD000000102</string>
@@ -398,15 +400,15 @@
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array>
<array>
- <integer>35</integer>
- <integer>33</integer>
- <integer>32</integer>
+ <integer>27</integer>
+ <integer>25</integer>
+ <integer>24</integer>
<integer>1</integer>
<integer>0</integer>
</array>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
- <string>{{0, 519}, {335, 402}}</string>
+ <string>{{0, 389}, {335, 292}}</string>
</dict>
<key>PBXTopSmartGroupGIDs</key>
<array/>
@@ -418,7 +420,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 271}, {352, 420}}</string>
+ <string>{{0, 381}, {352, 310}}</string>
<key>GroupTreeTableConfiguration</key>
<array>
<string>MainColumn</string>
@@ -430,7 +432,7 @@
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
<key>Proportion</key>
- <string>420pt</string>
+ <string>310pt</string>
</dict>
</array>
<key>Proportion</key>
@@ -459,13 +461,11 @@
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>00062D8F1197872800AC040C</string>
+ <string>003AED26119949F90074D7F0</string>
<key>history</key>
<array>
<string>0001B24B11574EB400109D45</string>
<string>00DDF55A115F3F8400310925</string>
- <string>00DDF563115F3F8400310925</string>
- <string>00DDF564115F3F8400310925</string>
<string>00CA10441163148A00664274</string>
<string>00CA111C1163261F00664274</string>
<string>00DB9B2111646A4A002A7F8F</string>
@@ -473,7 +473,6 @@
<string>00DB9BA3116473C5002A7F8F</string>
<string>00DB9C3C11647993002A7F8F</string>
<string>00DB9C4311647993002A7F8F</string>
- <string>00DB9C4411647993002A7F8F</string>
<string>00DB9C4711647993002A7F8F</string>
<string>00DB9C4811647993002A7F8F</string>
<string>00DB9C4A11647993002A7F8F</string>
@@ -481,7 +480,6 @@
<string>00DB9C4C11647993002A7F8F</string>
<string>00DB9C4D11647993002A7F8F</string>
<string>00DB9CFB116484E1002A7F8F</string>
- <string>001736A81165A11E00959279</string>
<string>001736AB1165A11E00959279</string>
<string>001736AC1165A11E00959279</string>
<string>00F824F01165A49700175A32</string>
@@ -543,21 +541,14 @@
<string>000A67EC118E7DE50018CF7C</string>
<string>000A681B118E83360018CF7C</string>
<string>000A681C118E83360018CF7C</string>
- <string>000A6821118E83360018CF7C</string>
<string>000A6824118E83360018CF7C</string>
<string>000A6825118E83360018CF7C</string>
<string>000A6827118E83360018CF7C</string>
- <string>000A6828118E83360018CF7C</string>
<string>000A683B118E852C0018CF7C</string>
- <string>000A683D118E852C0018CF7C</string>
<string>000A6870118E8E250018CF7C</string>
<string>001E7A90118FFA2F009E8C00</string>
- <string>001E7AFB1190038E009E8C00</string>
<string>001E7BC21190087C009E8C00</string>
- <string>001E7BC31190087C009E8C00</string>
- <string>001E7BCF1190090E009E8C00</string>
<string>001E7C12119087FC009E8C00</string>
- <string>00C6EA941193D746001B5EF4</string>
<string>00C6EA951193D746001B5EF4</string>
<string>00C6EA991193D746001B5EF4</string>
<string>00032D981193F832008389DA</string>
@@ -565,7 +556,6 @@
<string>00032D9A1193F832008389DA</string>
<string>00032D9C1193F832008389DA</string>
<string>00032D9D1193F832008389DA</string>
- <string>00BBEB7E1193FC31001BE653</string>
<string>00BBEB8F11940201001BE653</string>
<string>00BBEB9211940201001BE653</string>
<string>00BBEB9611940201001BE653</string>
@@ -575,51 +565,66 @@
<string>00BBEBEF119406DC001BE653</string>
<string>00BBEBFE11940B8D001BE653</string>
<string>00BBEBFF11940B8D001BE653</string>
- <string>00BBEC0311940B8D001BE653</string>
<string>00BBEC0511940B8D001BE653</string>
<string>00BBEC2B11940FBD001BE653</string>
<string>00BBEC3011940FBD001BE653</string>
<string>00062C22119624DF00AC040C</string>
- <string>00062C26119624DF00AC040C</string>
<string>00062C29119624DF00AC040C</string>
<string>00062C2D119624DF00AC040C</string>
<string>00062C9511962D2400AC040C</string>
- <string>00062C9611962D2400AC040C</string>
<string>00062C9811962D2400AC040C</string>
- <string>00062C9911962D2400AC040C</string>
<string>00062C9B11962D2400AC040C</string>
<string>00062C9C11962D2400AC040C</string>
- <string>00062CA011962D2400AC040C</string>
<string>00062CDF119634A000AC040C</string>
<string>00062CE1119634A000AC040C</string>
<string>00062CE2119634A000AC040C</string>
- <string>00062CE3119634A000AC040C</string>
- <string>00062CE4119634A000AC040C</string>
- <string>00062CE5119634A000AC040C</string>
- <string>00062D2411977BDA00AC040C</string>
<string>00062D2511977BDA00AC040C</string>
- <string>00062D2611977BDA00AC040C</string>
- <string>00062D2711977BDA00AC040C</string>
- <string>00062D2B11977BDA00AC040C</string>
- <string>00062D2D11977BDA00AC040C</string>
- <string>00062D2E11977BDA00AC040C</string>
- <string>00062D2F11977BDA00AC040C</string>
<string>00062D3011977BDA00AC040C</string>
- <string>00062D5C119780AC00AC040C</string>
<string>00062D5F119780AC00AC040C</string>
<string>00062D60119780AC00AC040C</string>
<string>00062D63119780AC00AC040C</string>
- <string>00062D841197872800AC040C</string>
- <string>00062D851197872800AC040C</string>
<string>00062D861197872800AC040C</string>
<string>00062D871197872800AC040C</string>
<string>00062D881197872800AC040C</string>
- <string>00062D891197872800AC040C</string>
- <string>00062D8A1197872800AC040C</string>
<string>00062D8B1197872800AC040C</string>
- <string>00062D8C1197872800AC040C</string>
- <string>00062D8D1197872800AC040C</string>
- <string>00062D8E1197872800AC040C</string>
+ <string>00062E2511989D4000AC040C</string>
+ <string>00062E2611989D4000AC040C</string>
+ <string>00062E2811989D4000AC040C</string>
+ <string>00062E2C11989D4000AC040C</string>
+ <string>00062E2D11989D4000AC040C</string>
+ <string>00062E3211989D4000AC040C</string>
+ <string>00062E3311989D4000AC040C</string>
+ <string>00062E3411989D4000AC040C</string>
+ <string>00062E3511989D4000AC040C</string>
+ <string>00062E3611989D4000AC040C</string>
+ <string>00F57D9711991AE100ED284D</string>
+ <string>00F57D9911991AE100ED284D</string>
+ <string>00F57D9A11991AE100ED284D</string>
+ <string>00F57D9B11991AE100ED284D</string>
+ <string>00F57D9E11991AE100ED284D</string>
+ <string>003AEC49119922F90074D7F0</string>
+ <string>003AEC4A119922F90074D7F0</string>
+ <string>003AECB0119937BE0074D7F0</string>
+ <string>003AECB2119937BE0074D7F0</string>
+ <string>003AECB3119937BE0074D7F0</string>
+ <string>003AECB4119937BE0074D7F0</string>
+ <string>003AECB5119937BE0074D7F0</string>
+ <string>003AECB6119937BE0074D7F0</string>
+ <string>003AECB8119937BE0074D7F0</string>
+ <string>003AECBB119937BE0074D7F0</string>
+ <string>003AECDC11993F520074D7F0</string>
+ <string>003AECDD11993F520074D7F0</string>
+ <string>003AECDE11993F520074D7F0</string>
+ <string>003AECDF11993F520074D7F0</string>
+ <string>003AECE011993F520074D7F0</string>
+ <string>003AECE111993F520074D7F0</string>
+ <string>003AECE411993F520074D7F0</string>
+ <string>003AED0F1199464C0074D7F0</string>
+ <string>003AED15119947390074D7F0</string>
+ <string>003AED16119947390074D7F0</string>
+ <string>003AED23119949F90074D7F0</string>
+ <string>003AED24119949F90074D7F0</string>
+ <string>003AED25119949F90074D7F0</string>
</array>
</dict>
<key>SplitCount</key>
@@ -679,11 +684,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>00062C3E119624DF00AC040C</string>
- <string>00062C3F119624DF00AC040C</string>
+ <string>003AEC31119920C20074D7F0</string>
+ <string>003AEC32119920C20074D7F0</string>
<string>1CE0B1FE06471DED0097A5F4</string>
<string>1CE0B1FE06471DED0097A5F4</string>
- <string>00062C40119624DF00AC040C</string>
+ <string>003AEC33119920C20074D7F0</string>
<string>1CE0B20306471E060097A5F4</string>
<string>1CE0B20506471E060097A5F4</string>
</array>
@@ -804,7 +809,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>295143208.62006903</real>
+ <real>295258617.328457</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -821,13 +826,14 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
+ <string>003AED27119949F90074D7F0</string>
<string>1C530D57069F1CE1000CFCEE</string>
- <string>00062C48119624DF00AC040C</string>
- <string>00062C49119624DF00AC040C</string>
- <string>1CD10A99069EF8BA00B06720</string>
+ <string>003AECC4119937BE0074D7F0</string>
+ <string>003AECC5119937BE0074D7F0</string>
<string>1C78EAAD065D492600B07095</string>
- <string>/Users/gabe/Projects/FFProcessing/FFProcessing.xcodeproj</string>
+ <string>1CD10A99069EF8BA00B06720</string>
<string>00129F5B1154A03800D09836</string>
+ <string>/Users/gabe/Projects/FFProcessing/FFProcessing.xcodeproj</string>
</array>
<key>WindowString</key>
<string>0 146 1440 732 0 0 1440 878 </string>
@@ -846,12 +852,14 @@
<key>Dock</key>
<array>
<dict>
+ <key>BecomeActive</key>
+ <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CD0528F0623707200166675</string>
<key>PBXProjectModuleLabel</key>
- <string>FFAVCaptureSessionReader.m</string>
+ <string>FFGLDrawable.m</string>
<key>StatusBarVisibility</key>
<true/>
</dict>
@@ -868,8 +876,6 @@
<string>364pt</string>
</dict>
<dict>
- <key>BecomeActive</key>
- <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
@@ -909,7 +915,7 @@
<key>TableOfContents</key>
<array>
<string>00129F5B1154A03800D09836</string>
- <string>00062C1611961F3300AC040C</string>
+ <string>003AEC30119920C10074D7F0</string>
<string>1CD0528F0623707200166675</string>
<string>XCMainBuildResultsModuleGUID</string>
</array>
@@ -922,7 +928,7 @@
<key>WindowToolGUID</key>
<string>00129F5B1154A03800D09836</string>
<key>WindowToolIsVisible</key>
- <true/>
+ <false/>
</dict>
<dict>
<key>FirstTimeWindowDisplayed</key>
@@ -1031,13 +1037,13 @@
<key>TableOfContents</key>
<array>
<string>1CD10A99069EF8BA00B06720</string>
- <string>00062C41119624DF00AC040C</string>
+ <string>003AEC8B119934AF0074D7F0</string>
<string>1C162984064C10D400B95A72</string>
- <string>00062C42119624DF00AC040C</string>
- <string>00062C43119624DF00AC040C</string>
- <string>00062C44119624DF00AC040C</string>
- <string>00062C45119624DF00AC040C</string>
- <string>00062C46119624DF00AC040C</string>
+ <string>003AEC8C119934AF0074D7F0</string>
+ <string>003AEC8D119934AF0074D7F0</string>
+ <string>003AEC8E119934AF0074D7F0</string>
+ <string>003AEC8F119934AF0074D7F0</string>
+ <string>003AEC90119934AF0074D7F0</string>
</array>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.debugV3</string>
@@ -1071,7 +1077,7 @@
<key>PBXProjectModuleGUID</key>
<string>1CDD528C0622207200134675</string>
<key>PBXProjectModuleLabel</key>
- <string>FFAVCaptureSessionReader.m</string>
+ <string>GHGLTexture.m</string>
<key>StatusBarVisibility</key>
<true/>
</dict>
@@ -1127,8 +1133,8 @@
<key>TableOfContents</key>
<array>
<string>1C530D57069F1CE1000CFCEE</string>
- <string>00062C8111962C7600AC040C</string>
- <string>00062C8211962C7600AC040C</string>
+ <string>003AECAC119937BA0074D7F0</string>
+ <string>003AECAD119937BA0074D7F0</string>
<string>1CDD528C0622207200134675</string>
<string>1CD0528E0623707200166675</string>
</array>
@@ -1193,7 +1199,7 @@
<key>TableOfContents</key>
<array>
<string>1C78EAAD065D492600B07095</string>
- <string>00062C47119624DF00AC040C</string>
+ <string>003AECAE119937BA0074D7F0</string>
<string>1C78EAAC065D492600B07095</string>
</array>
<key>ToolbarConfiguration</key>
@@ -1203,7 +1209,7 @@
<key>WindowToolGUID</key>
<string>1C78EAAD065D492600B07095</string>
<key>WindowToolIsVisible</key>
- <true/>
+ <false/>
</dict>
<dict>
<key>Identifier</key>
View
5,031 FFProcessing.xcodeproj/gabe.pbxuser
1,894 additions, 3,137 deletions not shown
View
77 FFProcessing.xcodeproj/project.pbxproj
@@ -9,8 +9,9 @@
/* Begin PBXBuildFile section */
0001B1D311573C1D00109D45 /* FFProcessing.m in Sources */ = {isa = PBXBuildFile; fileRef = 0001B1D211573C1D00109D45 /* FFProcessing.m */; };
0001B1D61157413D00109D45 /* FFConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 0001B1D51157413D00109D45 /* FFConverter.m */; };
- 00032D861193F7B2008389DA /* PBCameraCaptureController.m in Sources */ = {isa = PBXBuildFile; fileRef = 00032D851193F7B2008389DA /* PBCameraCaptureController.m */; };
00032D871193F7B2008389DA /* PBCameraCaptureController.m in Sources */ = {isa = PBXBuildFile; fileRef = 00032D851193F7B2008389DA /* PBCameraCaptureController.m */; };
+ 00062E001197CD0100AC040C /* FFErodeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 00062DFF1197CD0100AC040C /* FFErodeFilter.m */; };
+ 00062E011197CD0100AC040C /* FFErodeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 00062DFF1197CD0100AC040C /* FFErodeFilter.m */; };
0007418E1161D26C00D8283B /* FFProcessingTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 0007418D1161D26C00D8283B /* FFProcessingTest.m */; };
000A660E118BFCD20018CF7C /* FFFilters.m in Sources */ = {isa = PBXBuildFile; fileRef = 000A660D118BFCD20018CF7C /* FFFilters.m */; };
000A660F118BFCD20018CF7C /* FFFilters.m in Sources */ = {isa = PBXBuildFile; fileRef = 000A660D118BFCD20018CF7C /* FFFilters.m */; };
@@ -76,6 +77,7 @@
00234C96116DB97800088651 /* short2.mov in Resources */ = {isa = PBXBuildFile; fileRef = 00234C94116DB97800088651 /* short2.mov */; };
00235032116EDE5100088651 /* libxvidcore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00235030116EDE5100088651 /* libxvidcore.a */; };
00235033116EDE5100088651 /* libxvidcore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00235030116EDE5100088651 /* libxvidcore.a */; };
+ 003AEC4F119923470074D7F0 /* libGHUnitIPhone4_0.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 003AEC4E1199233E0074D7F0 /* libGHUnitIPhone4_0.a */; };
007B05C011893F34003B3A5B /* FFEdgeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 007B05BF11893F34003B3A5B /* FFEdgeFilter.m */; };
007B05C111893F34003B3A5B /* FFEdgeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 007B05BF11893F34003B3A5B /* FFEdgeFilter.m */; };
007B05EE118942AE003B3A5B /* FFEncodeProcessor.m in Sources */ = {isa = PBXBuildFile; fileRef = 007B05ED118942AE003B3A5B /* FFEncodeProcessor.m */; };
@@ -148,7 +150,6 @@
00BBEBC1119402B5001BE653 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00BBEBC0119402B5001BE653 /* CoreMedia.framework */; };
00BBEBC7119402C6001BE653 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00BBEBC6119402C6001BE653 /* CoreVideo.framework */; };
00BBEBFC11940AEB001BE653 /* FFAVCaptureSessionReader.m in Sources */ = {isa = PBXBuildFile; fileRef = 00BBEBFB11940AEB001BE653 /* FFAVCaptureSessionReader.m */; };
- 00BBEBFD11940AEB001BE653 /* FFAVCaptureSessionReader.m in Sources */ = {isa = PBXBuildFile; fileRef = 00BBEBFB11940AEB001BE653 /* FFAVCaptureSessionReader.m */; };
00C6EA691193CCE0001B5EF4 /* PBCameraPickerCaptureController.m in Sources */ = {isa = PBXBuildFile; fileRef = 00C6EA681193CCE0001B5EF4 /* PBCameraPickerCaptureController.m */; };
00C6EA6A1193CCE0001B5EF4 /* PBCameraPickerCaptureController.m in Sources */ = {isa = PBXBuildFile; fileRef = 00C6EA681193CCE0001B5EF4 /* PBCameraPickerCaptureController.m */; };
00CA0FDA1163034900664274 /* FFReadThread.m in Sources */ = {isa = PBXBuildFile; fileRef = 00CA0FD91163034900664274 /* FFReadThread.m */; };
@@ -173,7 +174,6 @@
00DB9ACC116460D4002A7F8F /* PBProcessing.m in Sources */ = {isa = PBXBuildFile; fileRef = 00DB9ACB116460D4002A7F8F /* PBProcessing.m */; };
00DB9ACD116460D4002A7F8F /* PBProcessing.m in Sources */ = {isa = PBXBuildFile; fileRef = 00DB9ACB116460D4002A7F8F /* PBProcessing.m */; };
00DB9AD0116461CD002A7F8F /* PBApplicationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 00DB9ACF116461CD002A7F8F /* PBApplicationController.m */; };
- 00DB9AD1116461CD002A7F8F /* PBApplicationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 00DB9ACF116461CD002A7F8F /* PBApplicationController.m */; };
00DB9C5C11647A3E002A7F8F /* README in Resources */ = {isa = PBXBuildFile; fileRef = 00129F7E1154A41B00D09836 /* README */; };
00DB9C5D11647A3E002A7F8F /* test.png in Resources */ = {isa = PBXBuildFile; fileRef = 0012A0541154AE3100D09836 /* test.png */; };
00DB9C6311647A3E002A7F8F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; };
@@ -222,8 +222,24 @@
00DDF543115F3F6600310925 /* GHTextureManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 00129F3511549B3500D09836 /* GHTextureManager.m */; };
00DDF545115F3F6C00310925 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD15070DC6FC5B0079059D /* QuartzCore.framework */; };
00DDF547115F3F6F00310925 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00DDF3F5115F3C8F00310925 /* CoreFoundation.framework */; };
+ 00F57D9511991A1200ED284D /* GHGLUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 00F57D9411991A1200ED284D /* GHGLUtils.m */; };
+ 00F57D9611991A1200ED284D /* GHGLUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 00F57D9411991A1200ED284D /* GHGLUtils.m */; };
+ 00F57DA711991B0E00ED284D /* GHGLUtilsTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 00F57DA611991B0E00ED284D /* GHGLUtilsTest.m */; };
+ 00F57DD511991E2E00ED284D /* libcv.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 001E7A7C118FF848009E8C00 /* libcv.a */; };
+ 00F57DD611991E2E00ED284D /* libcvaux.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 001E7A7D118FF848009E8C00 /* libcvaux.a */; };
+ 00F57DD711991E2E00ED284D /* libcxcore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 001E7A7E118FF848009E8C00 /* libcxcore.a */; };
+ 00F57DD811991E2E00ED284D /* libml.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00BBEB6E1193FBCB001BE653 /* libml.a */; };
+ 00F57DD911991E2E00ED284D /* libhighgui.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00BBEB6F1193FBCB001BE653 /* libhighgui.a */; };
+ 00F57DDB11991E3300ED284D /* libstdc++.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 00BBEB741193FBF6001BE653 /* libstdc++.dylib */; };
+ 00F57E0011991EC000ED284D /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00BBEBC0119402B5001BE653 /* CoreMedia.framework */; };
+ 00F57E0111991EC000ED284D /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00BBEBC6119402C6001BE653 /* CoreVideo.framework */; };
+ 00F57E0811991EEE00ED284D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00BBEB5D1193FB9F001BE653 /* CoreGraphics.framework */; };
+ 00F57E0911991EEE00ED284D /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00BBEB5F1193FB9F001BE653 /* MediaPlayer.framework */; };
+ 00F57E0A11991EEE00ED284D /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00BBEB611193FB9F001BE653 /* MobileCoreServices.framework */; };
+ 00F57E0B11991EEE00ED284D /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00BBEB631193FB9F001BE653 /* OpenGLES.framework */; };
+ 00F57E0C11991EEE00ED284D /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00BBEB651193FB9F001BE653 /* UIKit.framework */; };
+ 00F57F191199207500ED284D /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00BBEB811193FC59001BE653 /* AVFoundation.framework */; };
00F824CA1165A43600175A32 /* GHUnitIPhoneTestMain.m in Sources */ = {isa = PBXBuildFile; fileRef = 00F824C41165A43600175A32 /* GHUnitIPhoneTestMain.m */; };
- 00F824CB1165A43600175A32 /* libGHUnitIPhone3_0.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00F824C61165A43600175A32 /* libGHUnitIPhone3_0.a */; };
00F824FD1165A9C400175A32 /* FFCodec.m in Sources */ = {isa = PBXBuildFile; fileRef = 00F824FC1165A9C400175A32 /* FFCodec.m */; };
00F824FE1165A9C400175A32 /* FFCodec.m in Sources */ = {isa = PBXBuildFile; fileRef = 00F824FC1165A9C400175A32 /* FFCodec.m */; };
00F824FF1165A9C400175A32 /* FFCodec.m in Sources */ = {isa = PBXBuildFile; fileRef = 00F824FC1165A9C400175A32 /* FFCodec.m */; };
@@ -240,6 +256,8 @@
0001B1D51157413D00109D45 /* FFConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FFConverter.m; sourceTree = "<group>"; };
00032D841193F7B2008389DA /* PBCameraCaptureController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBCameraCaptureController.h; sourceTree = "<group>"; };
00032D851193F7B2008389DA /* PBCameraCaptureController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBCameraCaptureController.m; sourceTree = "<group>"; };
+ 00062DFE1197CD0100AC040C /* FFErodeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FFErodeFilter.h; sourceTree = "<group>"; };
+ 00062DFF1197CD0100AC040C /* FFErodeFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FFErodeFilter.m; sourceTree = "<group>"; };
0007418D1161D26C00D8283B /* FFProcessingTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FFProcessingTest.m; sourceTree = "<group>"; };
000A660C118BFCD20018CF7C /* FFFilters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FFFilters.h; sourceTree = "<group>"; };
000A660D118BFCD20018CF7C /* FFFilters.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FFFilters.m; sourceTree = "<group>"; };
@@ -303,6 +321,7 @@
00234C93116DB97800088651 /* short1.mov */ = {isa = PBXFileReference; lastKnownFileType = video.quicktime; path = short1.mov; sourceTree = "<group>"; };
00234C94116DB97800088651 /* short2.mov */ = {isa = PBXFileReference; lastKnownFileType = video.quicktime; path = short2.mov; sourceTree = "<group>"; };
00235030116EDE5100088651 /* libxvidcore.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libxvidcore.a; sourceTree = "<group>"; };
+ 003AEC4E1199233E0074D7F0 /* libGHUnitIPhone4_0.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libGHUnitIPhone4_0.a; sourceTree = "<group>"; };
007B05BE11893F34003B3A5B /* FFEdgeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FFEdgeFilter.h; sourceTree = "<group>"; };
007B05BF11893F34003B3A5B /* FFEdgeFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FFEdgeFilter.m; sourceTree = "<group>"; };
007B05C211893FE5003B3A5B /* FFFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FFFilter.h; sourceTree = "<group>"; };
@@ -433,6 +452,9 @@
00DDF3EF115F3C7200310925 /* Tests.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Tests.app; sourceTree = BUILT_PRODUCTS_DIR; };
00DDF3F1115F3C7200310925 /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = "<group>"; };
00DDF3F5115F3C8F00310925 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
+ 00F57D9311991A1200ED284D /* GHGLUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GHGLUtils.h; sourceTree = "<group>"; };
+ 00F57D9411991A1200ED284D /* GHGLUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GHGLUtils.m; sourceTree = "<group>"; };
+ 00F57DA611991B0E00ED284D /* GHGLUtilsTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GHGLUtilsTest.m; sourceTree = "<group>"; };
00F824BA1165A43600175A32 /* GHAsyncTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GHAsyncTestCase.h; sourceTree = "<group>"; };
00F824BB1165A43600175A32 /* GHTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GHTest.h; sourceTree = "<group>"; };
00F824BC1165A43600175A32 /* GHTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GHTestCase.h; sourceTree = "<group>"; };
@@ -445,7 +467,6 @@
00F824C31165A43600175A32 /* GHUnitIPhoneAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GHUnitIPhoneAppDelegate.h; sourceTree = "<group>"; };
00F824C41165A43600175A32 /* GHUnitIPhoneTestMain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GHUnitIPhoneTestMain.m; sourceTree = "<group>"; };
00F824C51165A43600175A32 /* GHUNSObject+Swizzle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "GHUNSObject+Swizzle.h"; sourceTree = "<group>"; };
- 00F824C61165A43600175A32 /* libGHUnitIPhone3_0.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libGHUnitIPhone3_0.a; sourceTree = "<group>"; };
00F824C71165A43600175A32 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
00F824C81165A43600175A32 /* NSException+GHTestFailureExceptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSException+GHTestFailureExceptions.h"; sourceTree = "<group>"; };
00F824C91165A43600175A32 /* NSValue+GHValueFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSValue+GHValueFormatter.h"; sourceTree = "<group>"; };
@@ -499,12 +520,26 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 00F57E0C11991EEE00ED284D /* UIKit.framework in Frameworks */,
+ 003AEC4F119923470074D7F0 /* libGHUnitIPhone4_0.a in Frameworks */,
00DDF50A115F3E0100310925 /* Foundation.framework in Frameworks */,
- 00DDF50B115F3E0200310925 /* libbz2.dylib in Frameworks */,
- 00DDF50C115F3E0200310925 /* libz.dylib in Frameworks */,
00DDF545115F3F6C00310925 /* QuartzCore.framework in Frameworks */,
00DDF547115F3F6F00310925 /* CoreFoundation.framework in Frameworks */,
- 00F824CB1165A43600175A32 /* libGHUnitIPhone3_0.a in Frameworks */,
+ 00F57E0811991EEE00ED284D /* CoreGraphics.framework in Frameworks */,
+ 00F57E0911991EEE00ED284D /* MediaPlayer.framework in Frameworks */,
+ 00F57E0A11991EEE00ED284D /* MobileCoreServices.framework in Frameworks */,
+ 00F57E0B11991EEE00ED284D /* OpenGLES.framework in Frameworks */,
+ 00F57E0011991EC000ED284D /* CoreMedia.framework in Frameworks */,
+ 00F57E0111991EC000ED284D /* CoreVideo.framework in Frameworks */,
+ 00F57F191199207500ED284D /* AVFoundation.framework in Frameworks */,
+ 00F57DDB11991E3300ED284D /* libstdc++.dylib in Frameworks */,
+ 00F57DD511991E2E00ED284D /* libcv.a in Frameworks */,
+ 00F57DD611991E2E00ED284D /* libcvaux.a in Frameworks */,
+ 00F57DD711991E2E00ED284D /* libcxcore.a in Frameworks */,
+ 00F57DD811991E2E00ED284D /* libml.a in Frameworks */,
+ 00F57DD911991E2E00ED284D /* libhighgui.a in Frameworks */,
+ 00DDF50B115F3E0200310925 /* libbz2.dylib in Frameworks */,
+ 00DDF50C115F3E0200310925 /* libz.dylib in Frameworks */,
000DD3BA1166C656007E8546 /* libavcodec.a in Frameworks */,
000DD3BB1166C656007E8546 /* libavdevice.a in Frameworks */,
000DD3BC1166C656007E8546 /* libavfilter.a in Frameworks */,
@@ -670,6 +705,8 @@
00129F3311549B3500D09836 /* GHQuaternion.h */,
00129F3411549B3500D09836 /* GHTextureManager.h */,
00129F3511549B3500D09836 /* GHTextureManager.m */,
+ 00F57D9311991A1200ED284D /* GHGLUtils.h */,
+ 00F57D9411991A1200ED284D /* GHGLUtils.m */,
);
path = OpenGL;
sourceTree = "<group>";
@@ -731,6 +768,8 @@
000A660D118BFCD20018CF7C /* FFFilters.m */,
001E7A87118FFA0B009E8C00 /* FFCannyEdgeFilter.h */,
001E7A88118FFA0B009E8C00 /* FFCannyEdgeFilter.m */,
+ 00062DFE1197CD0100AC040C /* FFErodeFilter.h */,
+ 00062DFF1197CD0100AC040C /* FFErodeFilter.m */,
);
path = Filters;
sourceTree = "<group>";
@@ -899,6 +938,7 @@
00DDF3E8115F3BB200310925 /* Tests */ = {
isa = PBXGroup;
children = (
+ 00F57DA511991B0000ED284D /* OpenGL */,
00DDF3E9115F3BCC00310925 /* FFEncoderTest.m */,
0007418D1161D26C00D8283B /* FFProcessingTest.m */,
00F825001165AE3600175A32 /* FFCodecTest.m */,
@@ -919,9 +959,18 @@
path = Libraries;
sourceTree = "<group>";
};
+ 00F57DA511991B0000ED284D /* OpenGL */ = {
+ isa = PBXGroup;
+ children = (
+ 00F57DA611991B0E00ED284D /* GHGLUtilsTest.m */,
+ );
+ path = OpenGL;
+ sourceTree = "<group>";
+ };
00F824B91165A43600175A32 /* libGHUnitIPhone3_0 */ = {
isa = PBXGroup;
children = (
+ 003AEC4E1199233E0074D7F0 /* libGHUnitIPhone4_0.a */,
00F824BA1165A43600175A32 /* GHAsyncTestCase.h */,
00F824BB1165A43600175A32 /* GHTest.h */,
00F824BC1165A43600175A32 /* GHTestCase.h */,
@@ -934,7 +983,6 @@
00F824C31165A43600175A32 /* GHUnitIPhoneAppDelegate.h */,
00F824C41165A43600175A32 /* GHUnitIPhoneTestMain.m */,
00F824C51165A43600175A32 /* GHUNSObject+Swizzle.h */,
- 00F824C61165A43600175A32 /* libGHUnitIPhone3_0.a */,
00F824C71165A43600175A32 /* Makefile */,
00F824C81165A43600175A32 /* NSException+GHTestFailureExceptions.h */,
00F824C91165A43600175A32 /* NSValue+GHValueFormatter.h */,
@@ -1193,6 +1241,8 @@
00C6EA691193CCE0001B5EF4 /* PBCameraPickerCaptureController.m in Sources */,
00032D871193F7B2008389DA /* PBCameraCaptureController.m in Sources */,
00BBEBFC11940AEB001BE653 /* FFAVCaptureSessionReader.m in Sources */,
+ 00062E011197CD0100AC040C /* FFErodeFilter.m in Sources */,
+ 00F57D9611991A1200ED284D /* GHGLUtils.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1221,7 +1271,6 @@
00CA114A116328BA00664274 /* PBImagePickerController.m in Sources */,
00A313D41163E2B20065101E /* PBMoviePlayerController.m in Sources */,
00DB9ACC116460D4002A7F8F /* PBProcessing.m in Sources */,
- 00DB9AD1116461CD002A7F8F /* PBApplicationController.m in Sources */,
00F824CA1165A43600175A32 /* GHUnitIPhoneTestMain.m in Sources */,
00F824FF1165A9C400175A32 /* FFCodec.m in Sources */,
00F825011165AE3600175A32 /* FFCodecTest.m in Sources */,
@@ -1256,8 +1305,9 @@
000A6664118C02940018CF7C /* FFTypes.m in Sources */,
001E7A8B118FFA0B009E8C00 /* FFCannyEdgeFilter.m in Sources */,
00C6EA6A1193CCE0001B5EF4 /* PBCameraPickerCaptureController.m in Sources */,
- 00032D861193F7B2008389DA /* PBCameraCaptureController.m in Sources */,
- 00BBEBFD11940AEB001BE653 /* FFAVCaptureSessionReader.m in Sources */,
+ 00062E001197CD0100AC040C /* FFErodeFilter.m in Sources */,
+ 00F57D9511991A1200ED284D /* GHGLUtils.m in Sources */,
+ 00F57DA711991B0E00ED284D /* GHGLUtilsTest.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1352,6 +1402,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 00DB9CD11164810D002A7F8F /* Tests.xcconfig */;
buildSettings = {
+ SDKROOT = iphonesimulator4.0;
};
name = Debug;
};
@@ -1359,7 +1410,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 00DB9CD11164810D002A7F8F /* Tests.xcconfig */;
buildSettings = {
- SDKROOT = iphoneos4.0;
+ SDKROOT = iphonesimulator4.0;
};
name = Release;
};
View
BIN  Libraries/libGHUnitIPhone3_0/libGHUnitIPhone3_0.a
Binary file not shown
View
BIN  Libraries/libGHUnitIPhone3_0/libGHUnitIPhone4_0.a
Binary file not shown
View
21 Tests/FFEncoderTest.m
@@ -18,13 +18,18 @@ @implementation FFEncoderTest
- (void)testEncoding {
NSString *path = [[FFUtils documentsDirectory] stringByAppendingPathComponent:@"test.mp4"];
- FFOptions *options = [[FFOptions alloc] initWithWidth:320 height:480 pixelFormat:PIX_FMT_YUV420P];
- FFEncoder *encoder = [[FFEncoder alloc] initWithOptions:options presets:[[[FFPresets alloc] init] autorelease]
- path:path format:nil codecName:nil];
+ NSString *outputFormat = @"mp4";
+ NSString *outputCodecName = @"mpeg4";
+ FFAVFormat avFormat = FFAVFormatMake(320, 480, PIX_FMT_YUV420P);
+
+ FFEncoderOptions *options = [[FFEncoderOptions alloc] initWithPath:path format:outputFormat codecName:outputCodecName
+ avFormat:avFormat
+ videoTimeBase:(AVRational){0,1}];
+ FFEncoder *encoder = [[FFEncoder alloc] initWithOptions:options];
NSError *error = nil;
- AVFrame *picture = FFPictureCreate(PIX_FMT_YUV420P, 320, 480);
- GHAssertNotNULL(picture, nil);
+ FFAVFrame avFrame = FFAVFrameCreate(avFormat);
+ GHAssertNotNULL(avFrame.frame, nil);
GHAssertTrue([encoder open:&error], nil);
@@ -32,15 +37,15 @@ - (void)testEncoding {
// Fill in dummy picture data
for (NSUInteger i = 0; i < 200; i++) {
- FFFillYUVImage(picture, i, 320, 480);
- GHAssertTrue([encoder writeVideoFrame:picture error:&error], nil);
+ FFFillYUVImage(avFrame, i);
+ GHAssertTrue([encoder writeVideoFrame:avFrame.frame error:&error], nil);
}
GHAssertTrue([encoder writeTrailer:&error], nil);
[encoder close];
- FFPictureRelease(picture);
+ FFAVFrameRelease(avFrame);
[encoder release];
}
View
20 Tests/FFProcessingTest.m
@@ -18,24 +18,16 @@ @implementation FFProcessingTest
- (void)test {
//NSURL *URL = [NSURL URLWithString:@"bundle://test.mp4"];
- NSURL *URL = [NSURL URLWithString:@"bundle://pegasus-1958-chiptune.avi"];
- NSString *path = [[FFUtils documentsDirectory] stringByAppendingPathComponent:@"test-processing.mp4"];
- FFProcessing *processing = [[FFProcessing alloc] initWithOutputPath:path outputFormat:nil outputCodecName:nil];
- GHAssertTrue([processing processURL:URL format:nil index:0 count:1 error:nil], nil);
-
- [processing close];
-
+ NSURL *URL = [NSURL URLWithString:@"bundle://pegasus-1958-chiptune.avi"];
+ FFProcessing *processing = [[FFProcessing alloc] initWithProcessor:nil filter:nil];
+ GHAssertTrue([processing processURL:URL format:nil index:0 count:1 error:nil], nil);
[processing release];
}
- (void)testCameraVideo {
- NSURL *URL = [NSURL URLWithString:@"bundle://IMG_0306.MOV"];
- NSString *path = [[FFUtils documentsDirectory] stringByAppendingPathComponent:@"test-mov.mp4"];
- FFProcessing *processing = [[FFProcessing alloc] initWithOutputPath:path outputFormat:nil outputCodecName:nil];
- GHAssertTrue([processing processURL:URL format:nil index:0 count:1 error:nil], nil);
-
- [processing close];
-
+ NSURL *URL = [NSURL URLWithString:@"bundle://IMG_0306.MOV"];
+ FFProcessing *processing = [[FFProcessing alloc] initWithProcessor:nil filter:nil];
+ GHAssertTrue([processing processURL:URL format:nil index:0 count:1 error:nil], nil);
[processing release];
}
View
23 Tests/OpenGL/GHGLUtilsTest.m
@@ -0,0 +1,23 @@
+//
+// GHGLUtilsTest.m
+// FFProcessing
+//
+// Created by Gabriel Handford on 5/10/10.
+// Copyright 2010. All rights reserved.
+//
+
+
+#import "GHUnit.h"
+
+#import "GHGLUtils.h"
+
+@interface GHGLUtilsTest : GHTestCase { }
+@end
+
+@implementation GHGLUtilsTest
+
+- (void)testNextPOT {
+ GHAssertEquals(GHGLNextPOT(255), 256, nil);
+}
+
+@end
Please sign in to comment.
Something went wrong with that request. Please try again.