Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Processor/Filter

  • Loading branch information...
commit 30275deaab93eef62b4aa11b895266a7fb5020b5 1 parent 97a9fbc
@gabriel authored
Showing with 3,493 additions and 2,644 deletions.
  1. +0 −236 Classes/FFMPEG/FFProcessing.m
  2. +0 −22 Classes/FFMPEG/FFProcessingOptions.m
  3. +0 −176 Classes/FFMPEG/ffe.diff
  4. +1 −1  Classes/{FFMPEG → FFProcessing}/FFCodec.h
  5. +1 −1  Classes/{FFMPEG → FFProcessing}/FFCodec.m
  6. +1 −1  Classes/{FFMPEG → FFProcessing}/FFConverter.h
  7. +1 −1  Classes/{FFMPEG → FFProcessing}/FFConverter.m
  8. 0  Classes/{FFMPEG → FFProcessing}/FFDecoder.h
  9. 0  Classes/{FFMPEG → FFProcessing}/FFDecoder.m
  10. 0  Classes/{FFMPEG → FFProcessing}/FFDecoderOptions.h
  11. 0  Classes/{FFMPEG → FFProcessing}/FFDecoderOptions.m
  12. +1 −1  Classes/{FFMPEG → FFProcessing}/FFEncoder.h
  13. +1 −1  Classes/{FFMPEG → FFProcessing}/FFEncoder.m
  14. 0  Classes/{FFMPEG → FFProcessing}/FFEncoderOptions.h
  15. 0  Classes/{FFMPEG → FFProcessing}/FFEncoderOptions.m
  16. 0  Classes/{FFMPEG → FFProcessing}/FFGLDrawable.h
  17. 0  Classes/{FFMPEG → FFProcessing}/FFGLDrawable.m
  18. +1 −1  Classes/{FFMPEG → FFProcessing}/FFPlayerAppDelegate.h
  19. +1 −1  Classes/{FFMPEG → FFProcessing}/FFPlayerAppDelegate.m
  20. +1 −1  Classes/{FFMPEG → FFProcessing}/FFPlayerView.h
  21. +1 −1  Classes/{FFMPEG → FFProcessing}/FFPlayerView.m
  22. 0  Classes/{FFMPEG → FFProcessing}/FFPresets.h
  23. 0  Classes/{FFMPEG → FFProcessing}/FFPresets.m
  24. +6 −18 Classes/{FFMPEG → FFProcessing}/FFProcessing.h
  25. +148 −0 Classes/FFProcessing/FFProcessing.m
  26. +5 −2 Classes/{FFMPEG → FFProcessing}/FFProcessingQueue.h
  27. +6 −4 Classes/{FFMPEG → FFProcessing}/FFProcessingQueue.m
  28. +1 −1  Classes/{FFMPEG → FFProcessing}/FFProcessingThread.h
  29. +2 −2 Classes/{FFMPEG → FFProcessing}/FFProcessingThread.m
  30. +1 −1  Classes/{FFMPEG → FFProcessing}/FFReadThread.h
  31. +1 −1  Classes/{FFMPEG → FFProcessing}/FFReadThread.m
  32. 0  Classes/{FFMPEG → FFProcessing}/FFReader.h
  33. 0  Classes/{FFMPEG → FFProcessing}/FFReader.m
  34. +1 −1  Classes/{FFMPEG → FFProcessing}/FFUtils.h
  35. +1 −1  Classes/{FFMPEG → FFProcessing}/FFUtils.m
  36. +15 −0 Classes/FFProcessing/Filters/FFEdgeFilter.h
  37. +44 −0 Classes/FFProcessing/Filters/FFEdgeFilter.m
  38. +15 −0 Classes/FFProcessing/Filters/FFFilter.h
  39. 0  Classes/{FFMPEG → FFProcessing}/OpenGL/GHGLCommon.h
  40. 0  Classes/{FFMPEG → FFProcessing}/OpenGL/GHGLDefines.h
  41. 0  Classes/{FFMPEG → FFProcessing}/OpenGL/GHGLTexture.h
  42. 0  Classes/{FFMPEG → FFProcessing}/OpenGL/GHGLTexture.m
  43. 0  Classes/{FFMPEG → FFProcessing}/OpenGL/GHGLUCommon.h
  44. 0  Classes/{FFMPEG → FFProcessing}/OpenGL/GHGLView.h
  45. 0  Classes/{FFMPEG → FFProcessing}/OpenGL/GHGLView.m
  46. 0  Classes/{FFMPEG → FFProcessing}/OpenGL/GHGLViewController.h
  47. 0  Classes/{FFMPEG → FFProcessing}/OpenGL/GHGLViewController.m
  48. 0  Classes/{FFMPEG → FFProcessing}/OpenGL/GHQuaternion.h
  49. 0  Classes/{FFMPEG → FFProcessing}/OpenGL/GHTextureManager.h
  50. 0  Classes/{FFMPEG → FFProcessing}/OpenGL/GHTextureManager.m
  51. +13 −8 Classes/{FFMPEG/FFProcessingOptions.h → FFProcessing/Processors/FFDataMoshProcessor.h}
  52. +89 −0 Classes/FFProcessing/Processors/FFDataMoshProcessor.m
  53. +24 −0 Classes/FFProcessing/Processors/FFEncodeProcessor.h
  54. +90 −0 Classes/FFProcessing/Processors/FFEncodeProcessor.m
  55. +16 −0 Classes/FFProcessing/Processors/FFProcessor.h
  56. 0  Classes/{FFMPEG → FFProcessing}/Test/FFGLTestDrawable.h
  57. 0  Classes/{FFMPEG → FFProcessing}/Test/FFGLTestDrawable.m
  58. 0  Classes/{FFMPEG → FFProcessing}/Test/test.png
  59. +1 −1  Classes/{PixelBleeder → PB}/PBAppDelegate.h
  60. +1 −1  Classes/{PixelBleeder → PB}/PBAppDelegate.m
  61. +1 −1  Classes/{PixelBleeder → PB}/PBApplicationController.h
  62. +5 −2 Classes/{PixelBleeder → PB}/PBApplicationController.m
  63. 0  Classes/{PixelBleeder → PB}/PBMediaChooser.h
  64. 0  Classes/{PixelBleeder → PB}/PBMediaChooser.m
  65. +1 −1  Classes/{PixelBleeder → PB}/PBMediaChooserController.h
  66. +1 −1  Classes/{PixelBleeder → PB}/PBMediaChooserController.m
  67. 0  Classes/{PixelBleeder → PB}/PBMediaListViewController.h
  68. +2 −0  Classes/{PixelBleeder → PB}/PBMediaListViewController.m
  69. +1 −1  Classes/{PixelBleeder → PB}/PBMoviePlayerController.h
  70. +1 −1  Classes/{PixelBleeder → PB}/PBMoviePlayerController.m
  71. +1 −2  Classes/{PixelBleeder → PB}/PBProcessing.h
  72. +19 −8 Classes/{PixelBleeder → PB}/PBProcessing.m
  73. +1 −1  Classes/{PixelBleeder → PB}/PBSaveThread.h
  74. +1 −1  Classes/{PixelBleeder → PB}/PBSaveThread.m
  75. 0  Classes/{PixelBleeder → PB}/UI/PBUIContainer.h
  76. 0  Classes/{PixelBleeder → PB}/UI/PBUIContainer.m
  77. 0  Classes/{PixelBleeder → PB}/UI/PBUIItem.h
  78. 0  Classes/{PixelBleeder → PB}/UI/PBUIItem.m
  79. 0  Classes/{PixelBleeder → PB}/UI/PBUIStatusView.h
  80. 0  Classes/{PixelBleeder → PB}/UI/PBUIStatusView.m
  81. 0  Classes/{PixelBleeder → PB}/UI/PBUITableViewController.h
  82. 0  Classes/{PixelBleeder → PB}/UI/PBUITableViewController.m
  83. +77 −63 FFProcessing.xcodeproj/gabe.mode1v3
  84. +2,823 −2,046 FFProcessing.xcodeproj/gabe.pbxuser
  85. +54 −16 FFProcessing.xcodeproj/project.pbxproj
  86. +1 −1  Libraries/YelpKit/YPCGUtils.h
  87. +1 −1  Libraries/YelpKit/YPCGUtils.m
  88. +1 −1  Libraries/YelpKit/YPDefines.h
  89. +1 −1  Libraries/YelpKit/YPLocalized.h
  90. +1 −1  Libraries/YelpKit/YPLocalized.m
  91. +1 −1  Libraries/YelpKit/iPhone/Buttons/YPUIButton.h
  92. +1 −1  Libraries/YelpKit/iPhone/Buttons/YPUIButton.m
  93. +1 −1  Libraries/YelpKit/iPhone/Buttons/YPUIControl.h
  94. +1 −1  Libraries/YelpKit/iPhone/Buttons/YPUIControl.m
  95. +1 −1  Libraries/YelpKit/iPhone/UI/YPUIAlertView.h
  96. +1 −1  Libraries/YelpKit/iPhone/UI/YPUIAlertView.m
  97. +1 −1  Tests/FFCodecTest.m
  98. +1 −1  Tests/FFEncoderTest.m
  99. +1 −1  Tests/FFProcessingTest.m
  100. +1 −1  main.m
View
236 Classes/FFMPEG/FFProcessing.m
@@ -1,236 +0,0 @@
-//
-// FFProcessing.m
-// FFPlayer
-//
-// Created by Gabriel Handford on 3/21/10.
-// Copyright 2010. All rights reserved.
-//
-
-#import "FFProcessing.h"
-
-#import "FFUtils.h"
-
-@interface FFProcessing ()
-@property (retain, nonatomic) FFProcessingOptions *options;
-- (BOOL)_processAtIndex:(NSInteger)index count:(NSInteger)count error:(NSError **)error;
-@end
-
-@implementation FFProcessing
-
-@synthesize options=_options, delegate=_delegate, cancelled=_cancelled;
-
-- (id)initWithOptions:(FFProcessingOptions *)options {
- if ((self = [super init])) {
- _options = [options retain];
- }
- return self;
-}
-
-- (void)dealloc {
- [self close];
- [_options release];
- [super dealloc];
-}
-
-- (BOOL)_openDecoder:(NSURL *)URL format:(NSString *)format error:(NSError **)error {
- _decoder = [[FFDecoder alloc] init];
-
- if (![_decoder openWithURL:URL format:format error:error]) {
- return NO;
- }
-
- _decoderFrame = avcodec_alloc_frame();
- if (_decoderFrame == NULL) {
- FFSetError(error, FFErrorCodeAllocateFrame, -1, @"Couldn't allocate frame");
- return NO;
- }
-
- return YES;
-}
-
-- (void)_closeDecoder {
- if (_decoderFrame != NULL) {
- av_free(_decoderFrame);
- _decoderFrame = NULL;
- }
- [_decoder release];
- _decoder = nil;
-}
-
-- (BOOL)_openEncoder:(NSError **)error {
-
- // Fill in encoder options (with decoder properties) if not set
- int width = _options.encoderOptions.width;
- int height = _options.encoderOptions.height;
- enum PixelFormat pixelFormat = _options.encoderOptions.pixelFormat;
- AVRational videoTimeBase = _options.encoderOptions.videoTimeBase;
- if (width == 0) width = _decoder.options.width;
- if (height == 0) height = _decoder.options.height;
- if (pixelFormat == PIX_FMT_NONE) pixelFormat = _decoder.options.pixelFormat;
- if (videoTimeBase.num == 0) videoTimeBase = _decoder.options.videoTimeBase;
-
- self.options.encoderOptions = [[FFEncoderOptions alloc] initWithPath:_options.encoderOptions.path
- format:_options.encoderOptions.format
- codecName:_options.encoderOptions.codecName
- width:width
- height:height
- pixelFormat:pixelFormat
- videoTimeBase:videoTimeBase];
-
- _encoder = [[FFEncoder alloc] initWithOptions:self.options.encoderOptions];
-
- if (![_encoder open:error])
- return NO;
-
- return YES;
-}
-
-- (BOOL)processURL:(NSURL *)URL format:(NSString *)format index:(NSInteger)index count:(NSInteger)count error:(NSError **)error {
- if (!error) {
- NSError *processError = nil;
- error = &processError;
- }
- if (![self _openDecoder:URL format:format error:error])
- return NO;
-
- BOOL processed = [self _processAtIndex:index count:count error:error];
-
- if (!processed && *error) {
- [_delegate processing:self didError:*error index:index count:count];
- }
-
- [self _closeDecoder];
- return processed;
-}
-
-- (BOOL)_processAtIndex:(NSInteger)index count:(NSInteger)count error:(NSError **)error {
-
- [_delegate processing:self didStartIndex:index count:count];
-
- _IFrameIndex = 0;
- _PFrameIndex = 0;
- _GOPIndex = 0;
-
- if (!_encoder) {
- _previousEndPTS = 0;
- if (![self _openEncoder:error])
- return NO;
- }
-
- AVFrame *picture = FFPictureCreate(_decoder.options.pixelFormat, _decoder.options.width, _decoder.options.height);
-
- if (index == 0) {
- if (![_encoder writeHeader:error])
- return NO;
- }
-
- while (!_cancelled) {
- *error = nil;
-
- if (![_decoder decodeVideoFrame:_decoderFrame error:error]) {
- if (*error) {
- FFDebug(@"Decode error");
- break;
- }
- //FFDebug(@"Decode buffering, continuing...");
- continue;
- }
-
- //if (_decoderFrame->pict_type == FF_I_TYPE) { }
- //FFDebug(@"Decoded frame, pict_type=%@", NSStringFromAVFramePictType(_decoderFrame->pict_type));
- _decoderFrame->pts += _previousEndPTS;
- //_decoderFrame->pict_type = 0;
-
- [_delegate processing:self didReadFramePTS:[_decoder readVideoPTS] duration:[_decoder videoDuration]
- index:index count:count];
-
- int bytesEncoded = [_encoder encodeVideoFrame:_decoderFrame error:error];
- if (bytesEncoded < 0) {
- FFDebug(@"Encode error");
- break;
- }
-
- if (_cancelled) break;
-
- AVFrame *codedFrame = [_encoder codedFrame];
-
- // If bytesEncoded is zero, there was buffering
- if (bytesEncoded > 0) {
- if (codedFrame->pict_type == FF_I_TYPE) {
- FFDebug(@"I-frame %lld (%d, %d)", codedFrame->pts, _IFrameIndex, _GOPIndex);
- _IFrameIndex++;
- _GOPIndex = 0;
-
- if ((_options.skipEveryIFrameInterval > 0) && // Skipping I-frames is on
- !(index == 0 && _IFrameIndex == 1) && // Don't skip if first I-frame in first input, no matter what options later
- ((index > 0 && _IFrameIndex == 1) || // Skip if first I-frame in subsequent inputs
- (_IFrameIndex % _options.skipEveryIFrameInterval == 0))) // We are on skip interval
- {
- FFDebug(@"Skipping I-frame");
- } else {
- if (![_encoder writeVideoBuffer:error]) break;
- }
-
- } else if (codedFrame->pict_type == FF_P_TYPE) {
- _GOPIndex++;
- if (_options.smoothFrameInterval > 0 && (_PFrameIndex++ % _options.smoothFrameInterval == 0)) {
-
- NSInteger count = _options.smoothFrameRepeat + 1;
- int64_t startPTS = codedFrame->pts;
- int64_t duration = (int64_t)((codedFrame->pts - _previousPTS)/(double)count);
-
- for (int i = 0; i < count; i++) {
- codedFrame->pts = startPTS + (duration * i);
- FFDebug(@"P-frame (duping), %lld (%d/%d)", codedFrame->pts, (i + 1), count);
- if (![_encoder writeVideoBuffer:error]) break;
- }
- } else {
- FFDebug(@"P-frame %lld", codedFrame->pts);
- if (![_encoder writeVideoBuffer:error]) break;
- }
- }
- }
-
- _previousPTS = codedFrame->pts;
- }
-
- _previousEndPTS = _previousPTS + 1; // TODO(gabe): Fix me
-
- if (index == (count - 1)) {
- if (![_encoder writeTrailer:error])
- return NO;
- }
-
- FFPictureRelease(picture);
-
- if (_cancelled) {
- [_delegate processingDidCancel:self];
- return NO;
- } else {
- [_delegate processing:self didFinishIndex:index count:count];
- return YES;
- }
-}
-
-- (void)close {
- [_encoder release];
- _encoder = nil;
-}
-
-- (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]];
- */
-}
-
-@end
View
22 Classes/FFMPEG/FFProcessingOptions.m
@@ -1,22 +0,0 @@
-//
-// FFProcessingOptions.m
-// FFProcessing
-//
-// Created by Gabriel Handford on 4/17/10.
-// Copyright 2010. All rights reserved.
-//
-
-#import "FFProcessingOptions.h"
-
-
-@implementation FFProcessingOptions
-
-@synthesize encoderOptions=_encoderOptions, skipEveryIFrameInterval=_skipEveryIFrameInterval,
-smoothFrameInterval=_smoothFrameInterval, smoothFrameRepeat=_smoothFrameRepeat;
-
-- (void)dealloc {
- [_encoderOptions release];
- [super dealloc];
-}
-
-@end
View
176 Classes/FFMPEG/ffe.diff
@@ -1,176 +0,0 @@
-diff --git a/Classes/FFMPEG/FFEncoder.m b/Classes/FFMPEG/FFEncoder.m
-index 8f2b8ac..d727f6f 100644
---- a/Classes/FFMPEG/FFEncoder.m
-+++ b/Classes/FFMPEG/FFEncoder.m
-@@ -12,7 +12,8 @@
-
- @interface FFEncoder ()
- - (BOOL)_prepareVideo:(NSError **)error;
--- (AVStream *)_addVideoStream:(NSError **)error;
-+- (AVStream *)_addVideoStream:(AVFormatContext *)formatContext error:(NSError **)error;
-+- (BOOL)_openCodec:(AVCodecContext *)codecContext error:(NSError **)error;
- @end
-
- @implementation FFEncoder
-@@ -65,15 +66,11 @@
-
-
- if (outputFormat->video_codec != CODEC_ID_NONE) {
-- _videoStream = [self _addVideoStream:error];
-+ _videoStream = [self _addVideoStream:_formatContext error:error];
- if (!_videoStream) {
- [self close];
- return NO;
-- }
--
-- // Some formats want stream headers to be separate
-- if (outputFormat->flags & AVFMT_GLOBALHEADER)
-- _videoStream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
-+ }
- }
-
- /*!
-@@ -110,10 +107,9 @@
- return YES;
- }
-
--/* add a video output stream */
--- (AVStream *)_addVideoStream:(NSError **)error {
-+- (AVStream *)_addVideoStream:(AVFormatContext *)formatContext error:(NSError **)error {
-
-- AVStream *stream = av_new_stream(_formatContext, 0);
-+ AVStream *stream = av_new_stream(formatContext, 0);
-
- if (!stream) {
- FFSetError(error, FFErrorCodeAllocStream, @"Couldn't allocate stream");
-@@ -121,51 +117,106 @@
- }
-
- AVCodecContext *codecContext = stream->codec;
-- codecContext->codec_id = _formatContext->oformat->video_codec;
-+ AVOutputFormat *outputFormat = formatContext->oformat;
-+
-+ //avcodec_get_context_defaults2(codecContext, CODEC_TYPE_VIDEO);
-+
-+ codecContext->codec_id = outputFormat->video_codec;
-+
- codecContext->codec_type = CODEC_TYPE_VIDEO;
-
- codecContext->bit_rate = _videoBitRate;
-+
- // Resolution must be a multiple of two
- codecContext->width = _width;
- codecContext->height = _height;
-
-- /*
-- time_base: this is the fundamental unit of time (in seconds) in terms
-- of which frame timestamps are represented. for fixed-fps content,
-- timebase should be 1/framerate and timestamp increments should be
-- identically 1.
-- */
-- codecContext->time_base.den = 25; // Frames per second
-- codecContext->time_base.num = 1;
-- codecContext->gop_size = 12; /* emit one intra frame every twelve frames at most */
- codecContext->pix_fmt = _pixelFormat;
-
-+ codecContext->gop_size = 12; /* emit one intra frame every twelve frames at most */
-+
-+ /*!
- if (codecContext->codec_id == CODEC_ID_MPEG2VIDEO) {
- // For testing, we also add B frames
- codecContext->max_b_frames = 2;
- }
-
- if (codecContext->codec_id == CODEC_ID_MPEG1VIDEO){
-- /* Needed to avoid using macroblocks in which some coeffs overflow.
-- This does not happen with normal video, it just happens here as
-- the motion of the chroma plane does not match the luma plane. */
-+ // Needed to avoid using macroblocks in which some coeffs overflow.
-+ // This does not happen with normal video, it just happens here as
-+ // the motion of the chroma plane does not match the luma plane.
- codecContext->mb_decision = 2;
- }
-+ */
-+
-+ // To try
-+ //codecContext->max_b_frames = 0;
-+
-+ /*!
-+ // QScale?
-+ codecContext->flags |= CODEC_FLAG_QSCALE;
-+ codecContext->global_quality = stream->quality = FF_QP2LAMBDA * video_qscale;
-+ */
-+
-+ //AVRational fps = (AVRational){25, 1};
-+ /*
-+ time_base: This is the fundamental unit of time (in seconds) in terms
-+ of which frame timestamps are represented. for fixed-fps content,
-+ timebase should be 1/framerate and timestamp increments should be
-+ identically 1.
-+ */
-+ //codecContext->time_base.num = fps.den; // fps is inverse of time_base
-+ //codecContext->time_base.den = fps.num;
-+
-+ codecContext->time_base.den = 25; // Frames per second
-+ codecContext->time_base.num = 1;
-+
-+ if (![self _openCodec:codecContext error:error]) {
-+ return NULL;
-+ }
-+
-+ AVCodec *codec = codecContext->codec;
-+
-+ /*!
-+ if (codec->supported_framerates) {
-+ fps = codec->supported_framerates[av_find_nearest_q_idx(fps, codec->supported_framerates)];
-+ codecContext->time_base.num = fps.den; // fps is inverse of time_base
-+ codecContext->time_base.den = fps.num;
-+ }
-+ */
-+
-+ // Some formats want stream headers to be separate
-+ if (outputFormat->flags & AVFMT_GLOBALHEADER)
-+ codecContext->flags |= CODEC_FLAG_GLOBAL_HEADER;
-
- return stream;
- }
-
-+- (BOOL)_openCodec:(AVCodecContext *)codecContext error:(NSError **)error {
-+ AVCodec *codec = avcodec_find_encoder(codecContext->codec_id);
-+ if (!codec) {
-+ FFSetError(error, FFErrorCodeCodecNotFound, @"Codec (encoder) not found");
-+ return NO;
-+ }
-+ FFDebug(@"Codec (encoder) found");
-+ if (avcodec_open(codecContext, codec) < 0) {
-+ FFSetError(error, FFErrorCodeCodecOpen, @"Couldn't open codec (encoder)");
-+ return NO;
-+ }
-+ return YES;
-+}
-+
- - (BOOL)_prepareVideo:(NSError **)error {
- AVCodecContext *codecContext = _videoStream->codec;
-
- AVCodec *codec = avcodec_find_encoder(codecContext->codec_id);
- if (!codec) {
-- FFSetError(error, FFErrorCodeVideoCodecNotFound, @"Codec not found");
-+ FFSetError(error, FFErrorCodeCodecNotFound, @"Codec not found");
- return NO;
- }
-
- if (avcodec_open(codecContext, codec) < 0) {
-- FFSetError(error, FFErrorCodeVideoCodecOpen, @"Couldn't open codec");
-+ FFSetError(error, FFErrorCodeCodecOpen, @"Couldn't open codec");
- return NO;
- }
-
-@@ -218,7 +269,7 @@
- }
-
- if (!(_formatContext->oformat->flags & AVFMT_NOFILE)) {
-- url_fclose(_formatContext->pb);
-+ if (_formatContext->pb != NULL) url_fclose(_formatContext->pb);
- }
-
- av_free(_formatContext);
View
2  Classes/FFMPEG/FFCodec.h → Classes/FFProcessing/FFCodec.h
@@ -1,6 +1,6 @@
//
// FFCodec.h
-// FFPlayer
+// FFProcessing
//
// Created by Gabriel Handford on 4/1/10.
// Copyright 2010. All rights reserved.
View
2  Classes/FFMPEG/FFCodec.m → Classes/FFProcessing/FFCodec.m
@@ -1,6 +1,6 @@
//
// FFCodec.m
-// FFPlayer
+// FFProcessing
//
// Created by Gabriel Handford on 4/1/10.
// Copyright 2010. All rights reserved.
View
2  Classes/FFMPEG/FFConverter.h → Classes/FFProcessing/FFConverter.h
@@ -1,6 +1,6 @@
//
// FFConverter.h
-// FFPlayer
+// FFProcessing
//
// Created by Gabriel Handford on 3/21/10.
// Copyright 2010. All rights reserved.
View
2  Classes/FFMPEG/FFConverter.m → Classes/FFProcessing/FFConverter.m
@@ -1,6 +1,6 @@
//
// FFConverter.m
-// FFPlayer
+// FFProcessing
//
// Created by Gabriel Handford on 3/21/10.
// Copyright 2010. All rights reserved.
View
0  Classes/FFMPEG/FFDecoder.h → Classes/FFProcessing/FFDecoder.h
File renamed without changes
View
0  Classes/FFMPEG/FFDecoder.m → Classes/FFProcessing/FFDecoder.m
File renamed without changes
View
0  Classes/FFMPEG/FFDecoderOptions.h → Classes/FFProcessing/FFDecoderOptions.h
File renamed without changes
View
0  Classes/FFMPEG/FFDecoderOptions.m → Classes/FFProcessing/FFDecoderOptions.m
File renamed without changes
View
2  Classes/FFMPEG/FFEncoder.h → Classes/FFProcessing/FFEncoder.h
@@ -1,6 +1,6 @@
//
// FFEncoder.h
-// FFPlayer
+// FFProcessing
//
// Created by Gabriel Handford on 3/24/10.
// Copyright 2010. All rights reserved.
View
2  Classes/FFMPEG/FFEncoder.m → Classes/FFProcessing/FFEncoder.m
@@ -1,6 +1,6 @@
//
// FFEncoder.m
-// FFPlayer
+// FFProcessing
//
// Created by Gabriel Handford on 3/24/10.
// Copyright 2010. All rights reserved.
View
0  Classes/FFMPEG/FFEncoderOptions.h → Classes/FFProcessing/FFEncoderOptions.h
File renamed without changes
View
0  Classes/FFMPEG/FFEncoderOptions.m → Classes/FFProcessing/FFEncoderOptions.m
File renamed without changes
View
0  Classes/FFMPEG/FFGLDrawable.h → Classes/FFProcessing/FFGLDrawable.h
File renamed without changes
View
0  Classes/FFMPEG/FFGLDrawable.m → Classes/FFProcessing/FFGLDrawable.m
File renamed without changes
View
2  Classes/FFMPEG/FFPlayerAppDelegate.h → Classes/FFProcessing/FFPlayerAppDelegate.h
@@ -1,5 +1,5 @@
//
-// FFPlayerAppDelegate.h
+// FFProcessingAppDelegate.h
// FFMPEG
//
// Created by Gabriel Handford on 3/4/10.
View
2  Classes/FFMPEG/FFPlayerAppDelegate.m → Classes/FFProcessing/FFPlayerAppDelegate.m
@@ -1,5 +1,5 @@
//
-// FFPlayerAppDelegate.m
+// FFProcessingAppDelegate.m
// FFMPEG
//
// Created by Gabriel Handford on 3/4/10.
View
2  Classes/FFMPEG/FFPlayerView.h → Classes/FFProcessing/FFPlayerView.h
@@ -1,5 +1,5 @@
//
-// FFPlayerView.h
+// FFProcessingView.h
// Steer
//
// Created by Gabriel Handford on 3/10/10.
View
2  Classes/FFMPEG/FFPlayerView.m → Classes/FFProcessing/FFPlayerView.m
@@ -1,5 +1,5 @@
//
-// FFPlayerView.m
+// FFProcessingView.m
//
// Created by Gabriel Handford on 3/10/10.
// Copyright 2010. All rights reserved.
View
0  Classes/FFMPEG/FFPresets.h → Classes/FFProcessing/FFPresets.h
File renamed without changes
View
0  Classes/FFMPEG/FFPresets.m → Classes/FFProcessing/FFPresets.m
File renamed without changes
View
24 Classes/FFMPEG/FFProcessing.h → Classes/FFProcessing/FFProcessing.h
@@ -1,14 +1,14 @@
//
// FFProcessing.h
-// FFPlayer
+// FFProcessing
//
// Created by Gabriel Handford on 3/21/10.
// Copyright 2010. All rights reserved.
//
#import "FFDecoder.h"
-#import "FFEncoder.h"
-#import "FFProcessingOptions.h"
+#import "FFFilter.h"
+#import "FFProcessor.h"
@class FFProcessing;
@@ -23,39 +23,27 @@
@interface FFProcessing : NSObject {
- FFProcessingOptions *_options;
+ id<FFFilter>_filter;
+ id<FFProcessor> _processor;
FFDecoder *_decoder;
AVFrame *_decoderFrame;
- FFEncoder *_encoder;
-
id<FFProcessingDelegate> _delegate; // Weak
- int64_t _previousPTS;
int64_t _previousEndPTS;
-
- NSInteger _IFrameIndex;
- NSInteger _PFrameIndex;
- NSInteger _GOPIndex;
-
- NSInteger _frameIndex;
- NSInteger _frameCount;
BOOL _cancelled;
}
-@property (readonly, retain, nonatomic) FFProcessingOptions *options;
@property (readonly, nonatomic, getter=isCancelled) BOOL cancelled;
@property (assign, nonatomic) id<FFProcessingDelegate> delegate;
-- (id)initWithOptions:(FFProcessingOptions *)options;
+- (id)initWithProcessor:(id<FFProcessor>)processor filter:(id<FFFilter>)filter;
- (BOOL)processURL:(NSURL *)URL format:(NSString *)format index:(NSInteger)index count:(NSInteger)count error:(NSError **)error;
- (void)cancel;
-- (void)close;
-
@end
View
148 Classes/FFProcessing/FFProcessing.m
@@ -0,0 +1,148 @@
+//
+// FFProcessing.m
+// FFProcessing
+//
+// Created by Gabriel Handford on 3/21/10.
+// Copyright 2010. All rights reserved.
+//
+
+#import "FFProcessing.h"
+
+#import "FFUtils.h"
+
+@interface FFProcessing ()
+- (BOOL)_processAtIndex:(NSInteger)index count:(NSInteger)count error:(NSError **)error;
+@end
+
+@implementation FFProcessing
+
+@synthesize delegate=_delegate, cancelled=_cancelled;
+
+- (id)initWithProcessor:(id<FFProcessor>)processor filter:(id<FFFilter>)filter {
+ if ((self = [super init])) {
+ _processor = [processor retain];
+ _filter = [filter retain];
+ }
+ return self;
+}
+
+- (void)dealloc {
+ [_processor release];
+ [_filter release];
+ [super dealloc];
+}
+
+- (BOOL)_openDecoder:(NSURL *)URL format:(NSString *)format error:(NSError **)error {
+ _decoder = [[FFDecoder alloc] init];
+
+ if (![_decoder openWithURL:URL format:format error:error]) {
+ return NO;
+ }
+
+ _decoderFrame = avcodec_alloc_frame();
+ if (_decoderFrame == NULL) {
+ FFSetError(error, FFErrorCodeAllocateFrame, -1, @"Couldn't allocate frame");
+ return NO;
+ }
+
+ return YES;
+}
+
+- (void)_closeDecoder {
+ if (_decoderFrame != NULL) {
+ av_free(_decoderFrame);
+ _decoderFrame = NULL;
+ }
+ [_decoder release];
+ _decoder = nil;
+}
+
+- (BOOL)processURL:(NSURL *)URL format:(NSString *)format index:(NSInteger)index count:(NSInteger)count error:(NSError **)error {
+ if (!error) {
+ NSError *processError = nil;
+ error = &processError;
+ }
+ if (![self _openDecoder:URL format:format error:error])
+ return NO;
+
+ BOOL processed = [self _processAtIndex:index count:count error:error];
+
+ if (!processed && *error) {
+ [_delegate processing:self didError:*error index:index count:count];
+ }
+
+ [self _closeDecoder];
+ return processed;
+}
+
+- (BOOL)_processAtIndex:(NSInteger)index count:(NSInteger)count error:(NSError **)error {
+
+ [_delegate processing:self didStartIndex:index count:count];
+
+ if (index == 0) {
+ _previousEndPTS = 0;
+ if (![_processor open:error])
+ return NO;
+ }
+
+ while (!_cancelled) {
+ *error = nil;
+
+ if (![_decoder decodeVideoFrame:_decoderFrame error:error]) {
+ if (*error) {
+ FFDebug(@"Decode error");
+ break;
+ }
+ //FFDebug(@"Decode buffering, continuing...");
+ continue;
+ }
+
+ //FFDebug(@"Decoded frame, pict_type=%@", NSStringFromAVFramePictType(_decoderFrame->pict_type));
+ _decoderFrame->pts += _previousEndPTS;
+
+ [_delegate processing:self didReadFramePTS:[_decoder readVideoPTS] duration:[_decoder videoDuration]
+ index:index count:count];
+
+ // Apply filter
+ if (_filter)
+ _decoderFrame = [_filter filterFrame:_decoderFrame decoder:_decoder];
+
+ // Run processor
+ if (![_processor processFrame:_decoderFrame decoder:_decoder index:index error:error])
+ break;
+ }
+
+ _previousEndPTS = _decoderFrame->pts + 1; // TODO(gabe): Fix me
+
+ // Last file
+ if (index == (count - 1)) {
+ // TODO(gabe): What to do with errors
+ [_processor close:nil];
+ }
+
+ if (_cancelled) {
+ [_delegate processingDidCancel:self];
+ return NO;
+ } else {
+ [_delegate processing:self didFinishIndex:index count:count];
+ return YES;
+ }
+}
+
+- (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]];
+ */
+}
+
+@end
View
7 Classes/FFMPEG/FFProcessingQueue.h → Classes/FFProcessing/FFProcessingQueue.h
@@ -22,17 +22,20 @@
@interface FFProcessingQueue : NSObject <FFProcessingDelegate> {
- FFProcessingOptions *_options;
+
FFProcessing *_processing;
NSMutableArray *_items;
NSInteger _index;
+ id<FFProcessor> _processor;
+ id<FFFilter> _filter;
+
id<FFProcessingQueueDelegate> _delegate;
}
@property (assign, nonatomic) id<FFProcessingQueueDelegate> delegate;
-- (id)initWithOptions:(FFProcessingOptions *)options;
+- (id)initWithProcessor:(id<FFProcessor>)processor filter:(id<FFFilter>)filter;
- (void)close;
View
10 Classes/FFMPEG/FFProcessingQueue.m → Classes/FFProcessing/FFProcessingQueue.m
@@ -20,9 +20,10 @@ - (id)init {
return self;
}
-- (id)initWithOptions:(FFProcessingOptions *)options {
+- (id)initWithProcessor:(id<FFProcessor>)processor filter:(id<FFFilter>)filter {
if ((self = [self init])) {
- _options = [options retain];
+ _processor = [processor retain];
+ _filter = [filter retain];
}
return self;
}
@@ -30,7 +31,8 @@ - (id)initWithOptions:(FFProcessingOptions *)options {
- (void)dealloc {
[self close];
[_items release];
- [_options release];
+ [_processor release];
+ [_filter release];
[_processing release];
[super dealloc];
}
@@ -63,7 +65,7 @@ - (BOOL)processNext {
}
if (!_processing) {
- _processing = [(FFProcessing *)[FFProcessing alloc] initWithOptions:_options];
+ _processing = [(FFProcessing *)[FFProcessing alloc] initWithProcessor:_processor filter:_filter];
_processing.delegate = self;
}
View
2  Classes/FFMPEG/FFProcessingThread.h → Classes/FFProcessing/FFProcessingThread.h
@@ -28,6 +28,6 @@
@property (assign, nonatomic) id<FFProcessingThreadDelegate> delegate;
-- (id)initWithOptions:(FFProcessingOptions *)options items:(NSArray *)items;
+- (id)initWithProcessor:(id<FFProcessor>)processor filter:(id<FFFilter>)filter items:(NSArray *)items;
@end
View
4 Classes/FFMPEG/FFProcessingThread.m → Classes/FFProcessing/FFProcessingThread.m
@@ -14,9 +14,9 @@ @implementation FFProcessingThread
@synthesize delegate=_delegate;
-- (id)initWithOptions:(FFProcessingOptions *)options items:(NSArray *)items {
+- (id)initWithProcessor:(id<FFProcessor>)processor filter:(id<FFFilter>)filter items:(NSArray *)items {
if ((self = [self init])) {
- _processingQueue = [(FFProcessingQueue *)[FFProcessingQueue alloc] initWithOptions:options];
+ _processingQueue = [(FFProcessingQueue *)[FFProcessingQueue alloc] initWithProcessor:processor filter:filter];
_processingQueue.delegate = self;
[_processingQueue addItems:items];
}
View
2  Classes/FFMPEG/FFReadThread.h → Classes/FFProcessing/FFReadThread.h
@@ -1,6 +1,6 @@
//
// FFReadThread.h
-// FFPlayer
+// FFProcessing
//
// Created by Gabriel Handford on 3/30/10.
// Copyright 2010. All rights reserved.
View
2  Classes/FFMPEG/FFReadThread.m → Classes/FFProcessing/FFReadThread.m
@@ -1,6 +1,6 @@
//
// FFReadThread.m
-// FFPlayer
+// FFProcessing
//
// Created by Gabriel Handford on 3/30/10.
// Copyright 2010. All rights reserved.
View
0  Classes/FFMPEG/FFReader.h → Classes/FFProcessing/FFReader.h
File renamed without changes
View
0  Classes/FFMPEG/FFReader.m → Classes/FFProcessing/FFReader.m
File renamed without changes
View
2  Classes/FFMPEG/FFUtils.h → Classes/FFProcessing/FFUtils.h
@@ -1,6 +1,6 @@
//
// FFUtils.h
-// FFPlayer
+// FFProcessing
//
// Created by Gabriel Handford on 3/24/10.
// Copyright 2010. All rights reserved.
View
2  Classes/FFMPEG/FFUtils.m → Classes/FFProcessing/FFUtils.m
@@ -1,6 +1,6 @@
//
// FFUtils.m
-// FFPlayer
+// FFProcessing
//
// Created by Gabriel Handford on 3/24/10.
// Copyright 2010. All rights reserved.
View
15 Classes/FFProcessing/Filters/FFEdgeFilter.h
@@ -0,0 +1,15 @@
+//
+// FFEdgeFilter.h
+// FFProcessing
+//
+// Created by Gabriel Handford on 4/28/10.
+// Copyright 2010. All rights reserved.
+//
+
+#import "FFFilter.h"
+
+@interface FFEdgeFilter : NSObject <FFFilter> {
+
+}
+
+@end
View
44 Classes/FFProcessing/Filters/FFEdgeFilter.m
@@ -0,0 +1,44 @@
+//
+// FFEdgeFilter.m
+// FFProcessing
+//
+// Created by Gabriel Handford on 4/28/10.
+// Copyright 2010. All rights reserved.
+//
+
+#import "FFEdgeFilter.h"
+
+#import "libavcodec/avcodec.h"
+#import "FFUtils.h"
+
+@implementation FFEdgeFilter
+
+- (AVFrame *)filterFrame:(AVFrame *)frame decoder:(FFDecoder *)decoder {
+ int x = 0;
+ int y = 0;
+ int width = decoder.options.width;
+ int height = decoder.options.height;
+
+ int index = 0;
+
+ while (y < height) {
+ int p = (x * 3) + (y * frame->linesize[index]);
+ //FFDebug(@"p=%d", p);
+ int8_t r = frame->data[index][p];
+ int8_t g = frame->data[index][p + 1];
+ int8_t b = frame->data[index][p + 2];
+
+ frame->data[index][p] = r;
+ frame->data[index][p + 1] = b;
+ frame->data[index][p + 2] = g;
+
+ x++;
+ if (x >= width) {
+ x = 0;
+ y++;
+ }
+ }
+ return frame;
+}
+
+@end
View
15 Classes/FFProcessing/Filters/FFFilter.h
@@ -0,0 +1,15 @@
+//
+// FFFilter.h
+// FFProcessing
+//
+// Created by Gabriel Handford on 4/28/10.
+// Copyright 2010. All rights reserved.
+//
+
+#import "libavcodec/avcodec.h"
+#import "FFDecoder.h"
+
+@protocol FFFilter <NSObject>
+- (AVFrame *)filterFrame:(AVFrame *)frame decoder:(FFDecoder *)decoder;
+@end
+
View
0  Classes/FFMPEG/OpenGL/GHGLCommon.h → Classes/FFProcessing/OpenGL/GHGLCommon.h
File renamed without changes
View
0  Classes/FFMPEG/OpenGL/GHGLDefines.h → Classes/FFProcessing/OpenGL/GHGLDefines.h
File renamed without changes
View
0  Classes/FFMPEG/OpenGL/GHGLTexture.h → Classes/FFProcessing/OpenGL/GHGLTexture.h
File renamed without changes
View
0  Classes/FFMPEG/OpenGL/GHGLTexture.m → Classes/FFProcessing/OpenGL/GHGLTexture.m
File renamed without changes
View
0  Classes/FFMPEG/OpenGL/GHGLUCommon.h → Classes/FFProcessing/OpenGL/GHGLUCommon.h
File renamed without changes
View
0  Classes/FFMPEG/OpenGL/GHGLView.h → Classes/FFProcessing/OpenGL/GHGLView.h
File renamed without changes
View
0  Classes/FFMPEG/OpenGL/GHGLView.m → Classes/FFProcessing/OpenGL/GHGLView.m
File renamed without changes
View
0  Classes/FFMPEG/OpenGL/GHGLViewController.h → .../FFProcessing/OpenGL/GHGLViewController.h
File renamed without changes
View
0  Classes/FFMPEG/OpenGL/GHGLViewController.m → .../FFProcessing/OpenGL/GHGLViewController.m
File renamed without changes
View
0  Classes/FFMPEG/OpenGL/GHQuaternion.h → Classes/FFProcessing/OpenGL/GHQuaternion.h
File renamed without changes
View
0  Classes/FFMPEG/OpenGL/GHTextureManager.h → ...es/FFProcessing/OpenGL/GHTextureManager.h
File renamed without changes
View
0  Classes/FFMPEG/OpenGL/GHTextureManager.m → ...es/FFProcessing/OpenGL/GHTextureManager.m
File renamed without changes
View
21 Classes/FFMPEG/FFProcessingOptions.h → ...ocessing/Processors/FFDataMoshProcessor.h
@@ -1,23 +1,28 @@
//
-// FFProcessingOptions.h
+// FFDataMoshProcessor.h
// FFProcessing
//
-// Created by Gabriel Handford on 4/17/10.
+// Created by Gabriel Handford on 4/28/10.
// Copyright 2010. All rights reserved.
//
-#import "FFEncoderOptions.h"
+#import "FFEncodeProcessor.h"
-@interface FFProcessingOptions : NSObject {
-
- FFEncoderOptions *_encoderOptions;
+
+@interface FFDataMoshProcessor : FFEncodeProcessor {
NSInteger _skipEveryIFrameInterval;
NSInteger _smoothFrameInterval;
- NSInteger _smoothFrameRepeat;
+ NSInteger _smoothFrameRepeat;
+
+ // Stats
+ NSInteger _IFrameIndex;
+ NSInteger _PFrameIndex;
+ NSInteger _GOPIndex;
+ int64_t _previousPTS;
+
}
-@property (retain, nonatomic) FFEncoderOptions *encoderOptions;
@property (assign, nonatomic) NSInteger skipEveryIFrameInterval; // How often to skip I-frames: 0=off, 1=every, 2=every other, 3=every third, ...
@property (assign, nonatomic) NSInteger smoothFrameInterval; // How often to duplicate P-frames: 0=off, 1=every, 2=every other, ...
@property (assign, nonatomic) NSInteger smoothFrameRepeat; // When smoothing a frame, how many frames to repeat
View
89 Classes/FFProcessing/Processors/FFDataMoshProcessor.m
@@ -0,0 +1,89 @@
+//
+// FFDataMoshProcessor.m
+// FFProcessing
+//
+// Created by Gabriel Handford on 4/28/10.
+// Copyright 2010. All rights reserved.
+//
+
+#import "FFDataMoshProcessor.h"
+#import "FFUtils.h"
+
+@implementation FFDataMoshProcessor
+
+@synthesize skipEveryIFrameInterval=_skipEveryIFrameInterval, smoothFrameInterval=_smoothFrameInterval, smoothFrameRepeat=_smoothFrameRepeat;
+
+- (void)reset {
+ _IFrameIndex = 0;
+ _PFrameIndex = 0;
+ _GOPIndex = 0;
+ _previousPTS = 0;
+}
+
+- (BOOL)open:(NSError **)error {
+ [self reset];
+ return YES;
+}
+
+- (BOOL)processFrame:(AVFrame *)frame decoder:(FFDecoder *)decoder index:(NSInteger)index error:(NSError **)error {
+
+ if (!_encoder) {
+ if (![self openEncoderWithDecoder:decoder error:error])
+ return NO;
+ }
+
+ int bytesEncoded = [_encoder encodeVideoFrame:frame error:error];
+ if (bytesEncoded < 0) {
+ FFDebug(@"Encode error");
+ return NO;
+ }
+
+ // If bytesEncoded is zero, there was buffering
+ if (bytesEncoded == 0)
+ return NO;
+
+ AVFrame *codedFrame = [_encoder codedFrame];
+
+ if (codedFrame->pict_type == FF_I_TYPE) {
+ FFDebug(@"I-frame %lld (%d, %d)", codedFrame->pts, _IFrameIndex, _GOPIndex);
+ _IFrameIndex++;
+ _GOPIndex = 0;
+
+ if ((_skipEveryIFrameInterval > 0) && // Skipping I-frames is on
+ !(index == 0 && _IFrameIndex == 1) && // Don't skip if first I-frame in first input, no matter what options
+ ((index > 0 && _IFrameIndex == 1) || // Skip if first I-frame in subsequent inputs
+ (_IFrameIndex % _skipEveryIFrameInterval == 0))) // We are on skip interval
+ {
+ FFDebug(@"Skipping I-frame");
+ } else {
+ if (![_encoder writeVideoBuffer:error])
+ return NO;
+ }
+
+ } else if (codedFrame->pict_type == FF_P_TYPE) {
+ _GOPIndex++;
+ if (_smoothFrameInterval > 0 && (_PFrameIndex++ % _smoothFrameInterval == 0) && _previousPTS > 0) {
+
+ NSInteger count = _smoothFrameRepeat + 1;
+ int64_t startPTS = codedFrame->pts;
+ int64_t duration = (int64_t)((codedFrame->pts - _previousPTS)/(double)count);
+
+ for (int i = 0; i < count; i++) {
+ codedFrame->pts = startPTS + (duration * i);
+ FFDebug(@"P-frame (duping), %lld (%d/%d)", codedFrame->pts, (i + 1), count);
+ if (![_encoder writeVideoBuffer:error])
+ return NO;
+ }
+ } else {
+ FFDebug(@"P-frame %lld", codedFrame->pts);
+ if (![_encoder writeVideoBuffer:error])
+ return NO;
+ }
+ }
+
+ _previousPTS = codedFrame->pts;
+
+ return YES;
+}
+
+@end
View
24 Classes/FFProcessing/Processors/FFEncodeProcessor.h
@@ -0,0 +1,24 @@
+//
+// FFEncodeProcessor.h
+// FFProcessing
+//
+// Created by Gabriel Handford on 4/28/10.
+// Copyright 2010. All rights reserved.
+//
+
+#import "FFProcessor.h"
+#import "FFEncoder.h"
+#import "FFEncoderOptions.h"
+
+@interface FFEncodeProcessor : NSObject <FFProcessor> {
+
+ FFEncoder *_encoder;
+ FFEncoderOptions *_encoderOptions;
+
+}
+
+- (id)initWithEncoderOptions:(FFEncoderOptions *)encoderOptions;
+
+- (BOOL)openEncoderWithDecoder:(FFDecoder *)decoder error:(NSError **)error;
+
+@end
View
90 Classes/FFProcessing/Processors/FFEncodeProcessor.m
@@ -0,0 +1,90 @@
+//
+// FFEncodeProcessor.m
+// FFProcessing
+//
+// Created by Gabriel Handford on 4/28/10.
+// Copyright 2010. All rights reserved.
+//
+
+#import "FFEncodeProcessor.h"
+#import "FFUtils.h"
+
+@implementation FFEncodeProcessor
+
+- (id)initWithEncoderOptions:(FFEncoderOptions *)encoderOptions {
+ if ((self = [self init])) {
+ _encoderOptions = [encoderOptions retain];
+ }
+ return self;
+}
+
+- (void)dealloc {
+ [_encoderOptions release];
+ [_encoder release];
+ [super dealloc];
+}
+
+- (BOOL)open:(NSError **)error {
+ return YES;
+}
+
+- (BOOL)openEncoderWithDecoder:(FFDecoder *)decoder error:(NSError **)error {
+
+ // Fill in encoder options (with decoder properties) if not set
+ int width = _encoderOptions.width;
+ int height = _encoderOptions.height;
+ enum PixelFormat pixelFormat = _encoderOptions.pixelFormat;
+ AVRational videoTimeBase = _encoderOptions.videoTimeBase;
+ if (width == 0) width = decoder.options.width;
+ if (height == 0) height = decoder.options.height;
+ if (pixelFormat == PIX_FMT_NONE) pixelFormat = decoder.options.pixelFormat;
+ if (videoTimeBase.num == 0) videoTimeBase = decoder.options.videoTimeBase;
+
+ FFEncoderOptions *options = [[FFEncoderOptions alloc] initWithPath:_encoderOptions.path
+ format:_encoderOptions.format
+ codecName:_encoderOptions.codecName
+ width:width
+ height:height
+ pixelFormat:pixelFormat
+ videoTimeBase:videoTimeBase];
+
+ _encoder = [[FFEncoder alloc] initWithOptions:options];
+ [options release];
+
+ if ([_encoder open:error]) {
+ return [_encoder writeHeader:error];
+ }
+ return NO;
+}
+
+- (BOOL)close:(NSError **)error {
+ [_encoder writeTrailer:error]; // TODO: return NO on error
+ [_encoder close];
+ [_encoder release];
+ _encoder = nil;
+ return YES;
+}
+
+- (BOOL)processFrame:(AVFrame *)frame decoder:(FFDecoder *)decoder index:(NSInteger)index error:(NSError **)error {
+
+ if (!_encoder) {
+ if (![self openEncoderWithDecoder:decoder error:error])
+ return NO;
+ }
+
+ int bytesEncoded = [_encoder encodeVideoFrame:frame error:error];
+ if (bytesEncoded < 0) {
+ FFDebug(@"Encode error");
+ return NO;
+ }
+
+ // If bytesEncoded is zero, there was buffering
+ if (bytesEncoded == 0) {
+ return NO;
+ }
+
+ return [_encoder writeVideoBuffer:error];
+
+}
+
+@end
View
16 Classes/FFProcessing/Processors/FFProcessor.h
@@ -0,0 +1,16 @@
+//
+// FFProcessor.h
+// FFProcessing
+//
+// Created by Gabriel Handford on 4/28/10.
+// Copyright 2010. All rights reserved.
+//
+
+#import "FFDecoder.h"
+#import "libavcodec/avcodec.h"
+
+@protocol FFProcessor <NSObject>
+- (BOOL)open:(NSError **)error;
+- (BOOL)processFrame:(AVFrame *)frame decoder:(FFDecoder *)decoder index:(NSInteger)index error:(NSError **)error;
+- (BOOL)close:(NSError **)error;
+@end
View
0  Classes/FFMPEG/Test/FFGLTestDrawable.h → Classes/FFProcessing/Test/FFGLTestDrawable.h
File renamed without changes
View
0  Classes/FFMPEG/Test/FFGLTestDrawable.m → Classes/FFProcessing/Test/FFGLTestDrawable.m
File renamed without changes
View
0  Classes/FFMPEG/Test/test.png → Classes/FFProcessing/Test/test.png
File renamed without changes
View
2  Classes/PixelBleeder/PBAppDelegate.h → Classes/PB/PBAppDelegate.h
@@ -1,6 +1,6 @@
//
// PBAppDelegate.h
-// FFPlayer
+// FFProcessing
//
// Created by Gabriel Handford on 3/30/10.
// Copyright 2010. All rights reserved.
View
2  Classes/PixelBleeder/PBAppDelegate.m → Classes/PB/PBAppDelegate.m
@@ -1,6 +1,6 @@
//
// PBAppDelegate.m
-// FFPlayer
+// FFProcessing
//
// Created by Gabriel Handford on 3/30/10.
// Copyright 2010. All rights reserved.
View
2  ...es/PixelBleeder/PBApplicationController.h → Classes/PB/PBApplicationController.h
@@ -1,6 +1,6 @@
//
// PBApplicationController.h
-// FFPlayer
+// FFProcessing
//
// Created by Gabriel Handford on 3/31/10.
// Copyright 2010. All rights reserved.
View
7 ...es/PixelBleeder/PBApplicationController.m → Classes/PB/PBApplicationController.m
@@ -1,6 +1,6 @@
//
// PBApplicationController.m
-// FFPlayer
+// FFProcessing
//
// Created by Gabriel Handford on 3/31/10.
// Copyright 2010. All rights reserved.
@@ -39,7 +39,7 @@ - (void)viewDidLoad {
NSMutableArray *items = [NSMutableArray array];
[items addObject:[PBUIItem text:@"Media" target:self action:@selector(selectMedia) accessoryType:UITableViewCellAccessoryDisclosureIndicator]];
- [items addObject:[PBUIItem text:@"Mosh" target:self action:@selector(process)]];
+ [items addObject:[PBUIItem text:@"Process" target:self action:@selector(process)]];
[items addObject:[PBUIItem text:@"Play" target:self action:@selector(openMoviePlayerController)]];
[items addObject:[PBUIItem text:@"Save" target:self action:@selector(saveMovieToPhotosAlbum)]];
@@ -47,6 +47,9 @@ - (void)viewDidLoad {
if (!_mediaListViewController) {
_mediaListViewController = [[PBMediaListViewController alloc] init];
+ //[_mediaListViewController addMediaItem:[NSURL URLWithString:@"bundle://short1.mov"]];
+ [_mediaListViewController addMediaItem:[NSURL URLWithString:@"bundle://short2.mov"]];
+ [_mediaListViewController reloadData];
}
}
View
0  Classes/PixelBleeder/PBMediaChooser.h → Classes/PB/PBMediaChooser.h
File renamed without changes
View
0  Classes/PixelBleeder/PBMediaChooser.m → Classes/PB/PBMediaChooser.m
File renamed without changes
View
2  ...s/PixelBleeder/PBMediaChooserController.h → Classes/PB/PBMediaChooserController.h
@@ -1,6 +1,6 @@
//
// PBMediaChooserController.h
-// FFPlayer
+// FFProcessing
//
// Created by Gabriel Handford on 3/30/10.
// Copyright 2010. All rights reserved.
View
2  ...s/PixelBleeder/PBMediaChooserController.m → Classes/PB/PBMediaChooserController.m
@@ -1,6 +1,6 @@
//
// PBMediaChooserController.m
-// FFPlayer
+// FFProcessing
//
// Created by Gabriel Handford on 3/30/10.
// Copyright 2010. All rights reserved.
View
0  .../PixelBleeder/PBMediaListViewController.h → Classes/PB/PBMediaListViewController.h
File renamed without changes
View
2  .../PixelBleeder/PBMediaListViewController.m → Classes/PB/PBMediaListViewController.m
@@ -8,6 +8,7 @@
#import "PBMediaListViewController.h"
+#import "FFUtils.h"
@implementation PBMediaListViewController
@@ -44,6 +45,7 @@ - (void)_select:(id)context {
}
- (void)addMediaItem:(NSURL *)URL {
+ URL = [FFUtils resolvedURLForURL:URL];
NSString *text = [[URL path] lastPathComponent];
[self addItem:[PBUIItem text:text target:self action:@selector(_select:) context:URL]];
}
View
2  ...es/PixelBleeder/PBMoviePlayerController.h → Classes/PB/PBMoviePlayerController.h
@@ -1,6 +1,6 @@
//
// PBMoviePlayerController.h
-// FFPlayer
+// FFProcessing
//
// Created by Gabriel Handford on 3/31/10.
// Copyright 2010. All rights reserved.
View
2  ...es/PixelBleeder/PBMoviePlayerController.m → Classes/PB/PBMoviePlayerController.m
@@ -1,6 +1,6 @@
//
// PBMoviePlayerController.m
-// FFPlayer
+// FFProcessing
//
// Created by Gabriel Handford on 3/31/10.
// Copyright 2010. All rights reserved.
View
3  Classes/PixelBleeder/PBProcessing.h → Classes/PB/PBProcessing.h
@@ -1,13 +1,12 @@
//
// PBProcessing.h
-// FFPlayer
+// FFProcessing
//
// Created by Gabriel Handford on 3/31/10.
// Copyright 2010. All rights reserved.
//
#import "FFProcessingThread.h"
-#import "FFProcessingOptions.h"
@class PBProcessing;
View
27 Classes/PixelBleeder/PBProcessing.m → Classes/PB/PBProcessing.m
@@ -1,6 +1,6 @@
//
// PBProcessing.m
-// FFPlayer
+// FFProcessing
//
// Created by Gabriel Handford on 3/31/10.
// Copyright 2010. All rights reserved.
@@ -11,6 +11,10 @@
#import "FFUtils.h"
#import "FFProcessing.h"
+#import "FFEncodeProcessor.h"
+#import "FFDataMoshProcessor.h"
+#import "FFEdgeFilter.h"
+
@interface PBProcessing ()
@property (retain, nonatomic) NSString *outputPath;
@end
@@ -40,18 +44,25 @@ - (void)startWithItems:(NSArray *)items {
NSString *outputCodecName = @"mpeg4";
NSString *outputPath = [[FFUtils documentsDirectory] stringByAppendingPathComponent:[NSString stringWithFormat:@"mosh.mp4", outputFormat]];
- FFProcessingOptions *options = [[[FFProcessingOptions alloc] init] autorelease];
- options.encoderOptions = [[[FFEncoderOptions alloc] initWithPath:outputPath format:outputFormat codecName:outputCodecName
- width:0 height:0 pixelFormat:PIX_FMT_NONE videoTimeBase:(AVRational){0,0}] autorelease];
- options.skipEveryIFrameInterval = 1;
- options.smoothFrameInterval = 2;
- options.smoothFrameRepeat = 2;
+ FFEncoderOptions *encoderOptions = [[[FFEncoderOptions alloc] initWithPath:outputPath format:outputFormat codecName:outputCodecName
+ width:0 height:0 pixelFormat:PIX_FMT_NONE videoTimeBase:(AVRational){0,0}] autorelease];
+
+ /*!
+ FFDataMoshProcessor *processor = [[[FFDataMoshProcessor alloc] initWithEncoderOptions:encoderOptions] autorelease];
+ processor.skipEveryIFrameInterval = 1;
+ processor.smoothFrameInterval = 2;
+ processor.smoothFrameRepeat = 2;
+ */
+
+ id<FFProcessor> processor = [[[FFEncodeProcessor alloc] initWithEncoderOptions:encoderOptions] autorelease];
+
+ id<FFFilter> filter = [[[FFEdgeFilter alloc] init] autorelease];
[outputPath retain];
[_outputPath release];
_outputPath = outputPath;
- _processingThread = [[FFProcessingThread alloc] initWithOptions:options items:items];
+ _processingThread = [[FFProcessingThread alloc] initWithProcessor:processor filter:filter items:items];
_processingThread.delegate = self;
[_processingThread start];
View
2  Classes/PixelBleeder/PBSaveThread.h → Classes/PB/PBSaveThread.h
@@ -3,7 +3,7 @@
// FFProcessing
//
// Created by Gabriel Handford on 4/22/10.
-// Copyright 2010 Yelp. All rights reserved.
+// Copyright 2010. All rights reserved.
//
@class PBSaveThread;
View
2  Classes/PixelBleeder/PBSaveThread.m → Classes/PB/PBSaveThread.m
@@ -3,7 +3,7 @@
// FFProcessing
//
// Created by Gabriel Handford on 4/22/10.
-// Copyright 2010 Yelp. All rights reserved.
+// Copyright 2010. All rights reserved.
//
#import "PBSaveThread.h"
View
0  Classes/PixelBleeder/UI/PBUIContainer.h → Classes/PB/UI/PBUIContainer.h
File renamed without changes
View
0  Classes/PixelBleeder/UI/PBUIContainer.m → Classes/PB/UI/PBUIContainer.m
File renamed without changes
View
0  Classes/PixelBleeder/UI/PBUIItem.h → Classes/PB/UI/PBUIItem.h
File renamed without changes
View
0  Classes/PixelBleeder/UI/PBUIItem.m → Classes/PB/UI/PBUIItem.m
File renamed without changes
View
0  Classes/PixelBleeder/UI/PBUIStatusView.h → Classes/PB/UI/PBUIStatusView.h
File renamed without changes
View
0  Classes/PixelBleeder/UI/PBUIStatusView.m → Classes/PB/UI/PBUIStatusView.m
File renamed without changes
View
0  ...PixelBleeder/UI/PBUITableViewController.h → Classes/PB/UI/PBUITableViewController.h
File renamed without changes
View
0  ...PixelBleeder/UI/PBUITableViewController.m → Classes/PB/UI/PBUITableViewController.m
File renamed without changes
View
140 FFProcessing.xcodeproj/gabe.mode1v3
@@ -309,13 +309,14 @@
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array>
<array>
- <integer>74</integer>
- <integer>70</integer>
+ <integer>56</integer>
+ <integer>28</integer>
+ <integer>1</integer>
<integer>0</integer>
</array>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
- <string>{{0, 1026}, {278, 323}}</string>
+ <string>{{0, 824}, {278, 290}}</string>
</dict>
<key>PBXTopSmartGroupGIDs</key>
<array/>
@@ -327,7 +328,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {295, 341}}</string>
+ <string>{{0, 0}, {295, 308}}</string>
<key>GroupTreeTableConfiguration</key>
<array>
<string>MainColumn</string>
@@ -339,7 +340,7 @@
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
<key>Proportion</key>
- <string>341pt</string>
+ <string>308pt</string>
</dict>
<dict>
<key>ContentConfiguration</key>
@@ -379,8 +380,9 @@
<string>29B97314FDCFA39411CA2CEA</string>
<string>080E96DDFE201D6D7F000001</string>
<string>0007416B1161CDE600D8283B</string>
- <string>00234B91116D900400088651</string>
<string>00129F1911549B3500D09836</string>
+ <string>007B05E1118941E9003B3A5B</string>
+ <string>007B05B911893EDB003B3A5B</string>
<string>00DDF3E8115F3BB200310925</string>
<string>00DB9CCD1164810D002A7F8F</string>
<string>000DD3CF1166C669007E8546</string>
@@ -396,14 +398,14 @@
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array>
<array>
- <integer>21</integer>
+ <integer>13</integer>
<integer>2</integer>
<integer>1</integer>
<integer>0</integer>
</array>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
- <string>{{0, 103}, {278, 327}}</string>
+ <string>{{0, 172}, {278, 360}}</string>
</dict>
<key>PBXTopSmartGroupGIDs</key>
<array/>
@@ -415,7 +417,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 346}, {295, 345}}</string>
+ <string>{{0, 313}, {295, 378}}</string>
<key>GroupTreeTableConfiguration</key>
<array>
<string>MainColumn</string>
@@ -427,7 +429,7 @@
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
<key>Proportion</key>
- <string>345pt</string>
+ <string>378pt</string>
</dict>
</array>
<key>Proportion</key>
@@ -444,7 +446,7 @@
<key>PBXProjectModuleGUID</key>
<string>1CE0B20306471E060097A5F4</string>
<key>PBXProjectModuleLabel</key>
- <string>PBApplicationController.m</string>
+ <string>FFEdgeFilter.m</string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
@@ -452,11 +454,11 @@
<key>PBXProjectModuleGUID</key>
<string>1CE0B20406471E060097A5F4</string>
<key>PBXProjectModuleLabel</key>
- <string>PBApplicationController.m</string>
+ <string>FFEdgeFilter.m</string>
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>00D84CC1118179B400280DBE</string>
+ <string>007B071911896E4B003B3A5B</string>
<key>history</key>
<array>
<string>00129F871154A43400D09836</string>
@@ -481,7 +483,6 @@
<string>00DB9BA6116473C5002A7F8F</string>
<string>00DB9C3C11647993002A7F8F</string>
<string>00DB9C3D11647993002A7F8F</string>
- <string>00DB9C3F11647993002A7F8F</string>
<string>00DB9C4311647993002A7F8F</string>
<string>00DB9C4411647993002A7F8F</string>
<string>00DB9C4511647993002A7F8F</string>
@@ -493,7 +494,6 @@
<string>00DB9C4B11647993002A7F8F</string>
<string>00DB9C4C11647993002A7F8F</string>
<string>00DB9C4D11647993002A7F8F</string>
- <string>00DB9C4F11647993002A7F8F</string>
<string>00DB9CFB116484E1002A7F8F</string>
<string>001736A81165A11E00959279</string>
<string>001736AB1165A11E00959279</string>
@@ -535,7 +535,6 @@
<string>00234D72116DCBD000088651</string>
<string>00235124116EF93700088651</string>
<string>0023515F116EFFB400088651</string>
- <string>00E58E021172A3F90037E3C8</string>
<string>0085315A1176E34200F9310E</string>
<string>0085315C1176E34200F9310E</string>
<string>008531841176E5FB00F9310E</string>
@@ -544,24 +543,14 @@
<string>008531F01176EDF800F9310E</string>
<string>008532781176FD5800F9310E</string>
<string>0085327C1176FD5800F9310E</string>
- <string>0085327F1176FD5800F9310E</string>
<string>008532931176FE4900F9310E</string>
<string>008C09E2117A883C002689B8</string>
- <string>008C09E5117A883C002689B8</string>
<string>008C09E6117A883C002689B8</string>
- <string>008C09E7117A883C002689B8</string>
- <string>008C0A0B117A8EAF002689B8</string>
<string>008C0A0C117A8EAF002689B8</string>
<string>008C0A0D117A8EAF002689B8</string>
<string>008C0A0E117A8EAF002689B8</string>
<string>008C0A39117A964E002689B8</string>
<string>008C0A59117AB975002689B8</string>
- <string>008C0A92117AC650002689B8</string>
- <string>008C0A93117AC650002689B8</string>
- <string>0090EBB8118006D000453CA5</string>
- <string>0090EBB9118006D000453CA5</string>
- <string>0090EBD41180082F00453CA5</string>
- <string>0090EBD51180082F00453CA5</string>
<string>0090EF1811801EDA00453CA5</string>
<string>0090EF1911801EDA00453CA5</string>
<string>0090EF1A11801EDA00453CA5</string>
@@ -574,10 +563,8 @@
<string>0090EFB21180422D00453CA5</string>
<string>00D84BBF1181670A00280DBE</string>
<string>00D84BC01181670A00280DBE</string>
- <string>00D84BC21181670A00280DBE</string>
<string>00D84BC31181670A00280DBE</string>
<string>00D84BC41181670A00280DBE</string>
- <string>00D84BC51181670A00280DBE</string>
<string>00D84BC81181677400280DBE</string>
<string>00D84C321181717800280DBE</string>
<string>00D84C331181717800280DBE</string>
@@ -587,18 +574,44 @@
<string>00D84C381181717800280DBE</string>
<string>00D84C391181717800280DBE</string>
<string>00D84C44118171EE00280DBE</string>
- <string>00D84C45118171EE00280DBE</string>
- <string>00D84C661181767000280DBE</string>
- <string>00D84C671181767000280DBE</string>
- <string>00D84C681181767000280DBE</string>
<string>00D84C691181767000280DBE</string>
- <string>00D84C6A1181767000280DBE</string>
<string>00D84C6B1181767000280DBE</string>
- <string>00D84C6C1181767000280DBE</string>
<string>00D84C6F1181767000280DBE</string>
<string>00D84C7D1181771D00280DBE</string>
<string>00D84CB91181795E00280DBE</string>
- <string>00D84CBA1181795E00280DBE</string>
+ <string>007B05B311893EA9003B3A5B</string>
+ <string>007B05B611893EC1003B3A5B</string>
+ <string>007B05D7118941CE003B3A5B</string>
+ <string>007B05D8118941CE003B3A5B</string>
+ <string>007B060111894948003B3A5B</string>
+ <string>007B067D118962DF003B3A5B</string>
+ <string>007B067E118962DF003B3A5B</string>
+ <string>007B067F118962DF003B3A5B</string>
+ <string>007B0680118962DF003B3A5B</string>
+ <string>007B0681118962DF003B3A5B</string>
+ <string>007B0682118962DF003B3A5B</string>
+ <string>007B0684118962DF003B3A5B</string>
+ <string>007B0685118962DF003B3A5B</string>
+ <string>007B0686118962DF003B3A5B</string>
+ <string>007B0688118962DF003B3A5B</string>
+ <string>007B06A5118963BF003B3A5B</string>
+ <string>007B06AF118963FD003B3A5B</string>
+ <string>007B06B511896418003B3A5B</string>
+ <string>007B06BD11896476003B3A5B</string>
+ <string>007B06C3118964AD003B3A5B</string>
+ <string>007B06DC11896B16003B3A5B</string>
+ <string>007B06DF11896B16003B3A5B</string>
+ <string>007B06E011896B16003B3A5B</string>
+ <string>007B06E111896B16003B3A5B</string>
+ <string>007B06E211896B16003B3A5B</string>
+ <string>007B06E311896B16003B3A5B</string>
+ <string>007B06E411896B16003B3A5B</string>
+ <string>007B06F311896B5F003B3A5B</string>
+ <string>007B070011896D7E003B3A5B</string>
+ <string>007B070211896D7E003B3A5B</string>
+ <string>007B070F11896DFC003B3A5B</string>
+ <string>007B071111896DFC003B3A5B</string>
+ <string>007B071211896DFC003B3A5B</string>
</array>
</dict>
<key>SplitCount</key>
@@ -610,14 +623,14 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {1140, 686}}</string>
+ <string>{{0, 0}, {1140, 480}}</string>
<key>RubberWindowFrame</key>
<string>0 146 1440 732 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>686pt</string>
+ <string>480pt</string>
</dict>
<dict>
<key>ContentConfiguration</key>
@@ -630,14 +643,14 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 691}, {1140, 0}}</string>
+ <string>{{0, 485}, {1140, 206}}</string>
<key>RubberWindowFrame</key>
<string>0 146 1440 732 0 0 1440 878 </string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
<key>Proportion</key>
- <string>0pt</string>
+ <string>206pt</string>
</dict>
</array>
<key>Proportion</key>
@@ -658,11 +671,11 @@
</array>
<key>TableOfContents</key>
<array>
- <string>00D84BB01181646E00280DBE</string>
- <string>00D84BB11181646E00280DBE</string>
+ <string>007B05A311893C52003B3A5B</string>
+ <string>007B05A411893C52003B3A5B</string>
<string>1CE0B1FE06471DED0097A5F4</string>
<string>1CE0B1FE06471DED0097A5F4</string>
- <string>00D84BB21181646E00280DBE</string>
+ <string>007B05A511893C52003B3A5B</string>
<string>1CE0B20306471E060097A5F4</string>
<string>1CE0B20506471E060097A5F4</string>
</array>
@@ -783,7 +796,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>293697972.26136202</real>
+ <real>294219339.87822801</real>
<key>ToolbarConfigUserDefaultsMinorVersion</key>
<string>2</string>
<key>ToolbarDisplayMode</key>
@@ -800,13 +813,14 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
- <string>00D84C1311816BD100280DBE</string>
- <string>00D84C0C11816B6300280DBE</string>
- <string>1C78EAAD065D492600B07095</string>
+ <string>007B071A11896E4B003B3A5B</string>
+ <string>007B069E1189635F003B3A5B</string>
+ <string>007B0692118962DF003B3A5B</string>
<string>1CD10A99069EF8BA00B06720</string>
<string>1C530D57069F1CE1000CFCEE</string>
- <string>00129F5B1154A03800D09836</string>
+ <string>1C78EAAD065D492600B07095</string>
<string>/Users/gabe/Projects/FFProcessing/FFProcessing.xcodeproj</string>
+ <string>00129F5B1154A03800D09836</string>
</array>
<key>WindowString</key>
<string>0 146 1440 732 0 0 1440 878 </string>
@@ -825,14 +839,12 @@
<key>Dock</key>
<array>
<dict>
- <key>BecomeActive</key>
- <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CD0528F0623707200166675</string>
<key>PBXProjectModuleLabel</key>
- <string>PBApplicationController.m</string>
+ <string>FFEdgeFilter.m</string>
<key>StatusBarVisibility</key>
<true/>
</dict>
@@ -849,6 +861,8 @@
<string>364pt</string>
</dict>
<dict>
+ <key>BecomeActive</key>
+ <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
@@ -888,7 +902,7 @@
<key>TableOfContents</key>
<array>
<string>00129F5B1154A03800D09836</string>
- <string>00D84BB31181646E00280DBE</string>
+ <string>007B05A611893C52003B3A5B</string>
<string>1CD0528F0623707200166675</string>
<string>XCMainBuildResultsModuleGUID</string>
</array>
@@ -901,7 +915,7 @@
<key>WindowToolGUID</key>
<string>00129F5B1154A03800D09836</string>
<key>WindowToolIsVisible</key>
- <false/>
+ <true/>
</dict>
<dict>
<key>FirstTimeWindowDisplayed</key>
@@ -1010,13 +1024,13 @@
<key>TableOfContents</key>
<array>
<string>1CD10A99069EF8BA00B06720</string>
- <string>00D84C0411816B6300280DBE</string>
+ <string>007B068A118962DF003B3A5B</string>
<string>1C162984064C10D400B95A72</string>
- <string>00D84C0511816B6300280DBE</string>
- <string>00D84C0611816B6300280DBE</string>
- <string>00D84C0711816B6300280DBE</string>
- <string>00D84C0811816B6300280DBE</string>
- <string>00D84C0911816B6300280DBE</string>
+ <string>007B068B118962DF003B3A5B</string>
+ <string>007B068C118962DF003B3A5B</string>
+ <string>007B068D118962DF003B3A5B</string>
+ <string>007B068E118962DF003B3A5B</string>
+ <string>007B068F118962DF003B3A5B</string>
</array>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.debugV3</string>
@@ -1050,7 +1064,7 @@
<key>PBXProjectModuleGUID</key>
<string>1CDD528C0622207200134675</string>
<key>PBXProjectModuleLabel</key>
- <string>FFUtils.m</string>
+ <string>FFEdgeFilter.m</string>
<key>StatusBarVisibility</key>
<true/>
</dict>
@@ -1106,8 +1120,8 @@
<key>TableOfContents</key>
<array>
<string>1C530D57069F1CE1000CFCEE</string>
- <string>00D84BB8118166DE00280DBE</string>
- <string>00D84BB9118166DE00280DBE</string>
+ <string>007B05AE11893E9A003B3A5B</string>
+ <string>007B05AF11893E9A003B3A5B</string>
<string>1CDD528C0622207200134675</string>
<string>1CD0528E0623707200166675</string>
</array>
@@ -1172,7 +1186,7 @@
<key>TableOfContents</key>
<array>
<string>1C78EAAD065D492600B07095</string>
- <string>00D84C0A11816B6300280DBE</string>
+ <string>007B0690118962DF003B3A5B</string>
<string>1C78EAAC065D492600B07095</string>
</array>
<key>ToolbarConfiguration</key>
@@ -1182,7 +1196,7 @@
<key>WindowToolGUID</key>
<string>1C78EAAD065D492600B07095</string>
<key>WindowToolIsVisible</key>
- <false/>
+ <true/>
</dict>
<dict>
<key>Identifier</key>
View
4,869 FFProcessing.xcodeproj/gabe.pbxuser
2,823 additions, 2,046 deletions not shown
View
70 FFProcessing.xcodeproj/project.pbxproj
@@ -64,6 +64,14 @@
00235031116EDE5100088651 /* libxvidcore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00235030116EDE5100088651 /* libxvidcore.a */; };
00235032116EDE5100088651 /* libxvidcore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00235030116EDE5100088651 /* libxvidcore.a */; };
00235033116EDE5100088651 /* libxvidcore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00235030116EDE5100088651 /* libxvidcore.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 */; };
+ 007B05EF118942AE003B3A5B /* FFEncodeProcessor.m in Sources */ = {isa = PBXBuildFile; fileRef = 007B05ED118942AE003B3A5B /* FFEncodeProcessor.m */; };
+ 007B05F0118942AE003B3A5B /* FFEncodeProcessor.m in Sources */ = {isa = PBXBuildFile; fileRef = 007B05ED118942AE003B3A5B /* FFEncodeProcessor.m */; };
+ 007B05F3118942D5003B3A5B /* FFDataMoshProcessor.m in Sources */ = {isa = PBXBuildFile; fileRef = 007B05F2118942D5003B3A5B /* FFDataMoshProcessor.m */; };
+ 007B05F4118942D5003B3A5B /* FFDataMoshProcessor.m in Sources */ = {isa = PBXBuildFile; fileRef = 007B05F2118942D5003B3A5B /* FFDataMoshProcessor.m */; };
+ 007B05F5118942D5003B3A5B /* FFDataMoshProcessor.m in Sources */ = {isa = PBXBuildFile; fileRef = 007B05F2118942D5003B3A5B /* FFDataMoshProcessor.m */; };
0085314B1176E0F700F9310E /* PBUIContainer.m in Sources */ = {isa = PBXBuildFile; fileRef = 0085314A1176E0F700F9310E /* PBUIContainer.m */; };
0085314C1176E0F700F9310E /* PBUIContainer.m in Sources */ = {isa = PBXBuildFile; fileRef = 0085314A1176E0F700F9310E /* PBUIContainer.m */; };
0085314D1176E0F700F9310E /* PBUIContainer.m in Sources */ = {isa = PBXBuildFile; fileRef = 0085314A1176E0F700F9310E /* PBUIContainer.m */; };
@@ -88,9 +96,6 @@
008C0A31117A9460002689B8 /* GHNSInvocation+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 008C0A26117A9460002689B8 /* GHNSInvocation+Utils.m */; };
008C0A32117A9460002689B8 /* GHNSInvocationProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = 008C0A28117A9460002689B8 /* GHNSInvocationProxy.m */; };
008C0A33117A9460002689B8 /* GHNSObject+Invocation.m in Sources */ = {isa = PBXBuildFile; fileRef = 008C0A2A117A9460002689B8 /* GHNSObject+Invocation.m */; };
- 008C0A6F117AC261002689B8 /* FFProcessingOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 008C0A6E117AC261002689B8 /* FFProcessingOptions.m */; };
- 008C0A70117AC261002689B8 /* FFProcessingOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 008C0A6E117AC261002689B8 /* FFProcessingOptions.m */; };
- 008C0A71117AC261002689B8 /* FFProcessingOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 008C0A6E117AC261002689B8 /* FFProcessingOptions.m */; };
0090ED4B11800FFF00453CA5 /* YPUIButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 0090ED4711800FFF00453CA5 /* YPUIButton.m */; };
0090ED4C11800FFF00453CA5 /* YPCGUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 0090ED4911800FFF00453CA5 /* YPCGUtils.m */; };
0090ED4D11800FFF00453CA5 /* YPUIButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 0090ED4711800FFF00453CA5 /* YPUIButton.m */; };
@@ -270,6 +275,14 @@
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>"; };
+ 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>"; };
+ 007B05E2118941F0003B3A5B /* FFProcessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FFProcessor.h; sourceTree = "<group>"; };
+ 007B05EC118942AE003B3A5B /* FFEncodeProcessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FFEncodeProcessor.h; sourceTree = "<group>"; };
+ 007B05ED118942AE003B3A5B /* FFEncodeProcessor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FFEncodeProcessor.m; sourceTree = "<group>"; };
+ 007B05F1118942D5003B3A5B /* FFDataMoshProcessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FFDataMoshProcessor.h; sourceTree = "<group>"; };
+ 007B05F2118942D5003B3A5B /* FFDataMoshProcessor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FFDataMoshProcessor.m; sourceTree = "<group>"; };
008531491176E0F700F9310E /* PBUIContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBUIContainer.h; sourceTree = "<group>"; };
0085314A1176E0F700F9310E /* PBUIContainer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PBUIContainer.m; sourceTree = "<group>"; };
008531AF1176E79D00F9310E /* PBUIStatusView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PBUIStatusView.h; sourceTree = "<group>"; };
@@ -288,8 +301,6 @@
008C0A29117A9460002689B8 /* GHNSObject+Invocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "GHNSObject+Invocation.h"; sourceTree = "<group>"; };
008C0A2A117A9460002689B8 /* GHNSObject+Invocation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "GHNSObject+Invocation.m"; sourceTree = "<group>"; };
008C0A64117AB985002689B8 /* GHKitDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GHKitDefines.h; sourceTree = "<group>"; };
- 008C0A6D117AC261002689B8 /* FFProcessingOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FFProcessingOptions.h; sourceTree = "<group>"; };
- 008C0A6E117AC261002689B8 /* FFProcessingOptions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FFProcessingOptions.m; sourceTree = "<group>"; };
0090ED4611800FFF00453CA5 /* YPUIButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YPUIButton.h; sourceTree = "<group>"; };
0090ED4711800FFF00453CA5 /* YPUIButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = YPUIButton.m; sourceTree = "<group>"; };
0090ED4811800FFF00453CA5 /* YPCGUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = YPCGUtils.h; sourceTree = "<group>"; };
@@ -491,7 +502,7 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
- 0007416B1161CDE600D8283B /* PixelBleeder */ = {
+ 0007416B1161CDE600D8283B /* PB */ = {
isa = PBXGroup;
children = (
00234B91116D900400088651 /* UI */,
@@ -512,7 +523,7 @@
00D84C1B11816F3100280DBE /* PBSaveThread.h */,
00D84C1C11816F3100280DBE /* PBSaveThread.m */,
);
- path = PixelBleeder;
+ path = PB;
sourceTree = "<group>";
};
000DD3B21166C656007E8546 /* ffmpeg */ = {
@@ -556,9 +567,11 @@
path = "../ffmpeg-build/x264-uarch/lib";
sourceTree = SOURCE_ROOT;
};
- 00129F1911549B3500D09836 /* FFMPEG */ = {
+ 00129F1911549B3500D09836 /* FFProcessing */ = {
isa = PBXGroup;
children = (
+ 007B05E1118941E9003B3A5B /* Processors */,
+ 007B05B911893EDB003B3A5B /* Filters */,
0012A0511154AE3100D09836 /* Test */,
00129F2911549B3500D09836 /* OpenGL */,
00129F1D11549B3500D09836 /* FFGLDrawable.h */,
@@ -571,8 +584,6 @@
00129F2811549B3500D09836 /* FFPlayerView.m */,
0001B1D111573C1D00109D45 /* FFProcessing.h */,
0001B1D211573C1D00109D45 /* FFProcessing.m */,
- 008C0A6D117AC261002689B8 /* FFProcessingOptions.h */,
- 008C0A6E117AC261002689B8 /* FFProcessingOptions.m */,
008532531176F5B300F9310E /* FFProcessingThread.h */,
008532541176F5B300F9310E /* FFProcessingThread.m */,
008532581176F69A00F9310E /* FFProcessingQueue.h */,
@@ -596,7 +607,7 @@
00D16AAE1167DD9C00D025EF /* FFPresets.h */,
00D16AAF1167DD9C00D025EF /* FFPresets.m */,
);
- path = FFMPEG;
+ path = FFProcessing;
sourceTree = "<group>";
};
00129F2911549B3500D09836 /* OpenGL */ = {
@@ -652,6 +663,28 @@
path = "../ffmpeg-build/xvid-uarch/lib";
sourceTree = SOURCE_ROOT;
};
+ 007B05B911893EDB003B3A5B /* Filters */ = {
+ isa = PBXGroup;
<