Added files back

This commit is contained in:
Zakk 2012-10-21 23:53:17 -04:00
parent 5612d650ce
commit e391580c21
430 changed files with 76297 additions and 0 deletions

50
CocoaSplit/AVFCapture.h Normal file
View file

@ -0,0 +1,50 @@
//
// AVFCapture.h
// H264Streamer
//
// Created by Zakk on 9/3/12.
// Copyright (c) 2012 Zakk. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <VideoToolbox/VideoToolbox.h>
#import <AVFoundation/AVFoundation.h>
#import "CaptureSessionProtocol.h"
@interface AVFCapture : NSObject <CaptureSessionProtocol, AVCaptureVideoDataOutputSampleBufferDelegate, AVCaptureAudioDataOutputSampleBufferDelegate>
{
AVCaptureSession *_capture_session;
dispatch_queue_t _video_capture_queue;
dispatch_queue_t _audio_capture_queue;
AVCaptureVideoDataOutput *_video_capture_output;
AVCaptureAudioDataOutput *_audio_capture_output;
CVImageBufferRef _currentFrame;
}
@property (strong) AVCaptureDevice *videoInputDevice;
@property (strong) AVCaptureDevice *audioInputDevice;
@property (strong) id audioDelegate;
@property (strong) id videoDelegate;
@property (assign) int videoCaptureFPS;
@property (assign) int audioBitrate;
@property (assign) int audioSamplerate;
-(bool) startCaptureSession:(NSError **)error;
-(bool) stopCaptureSession;
@end

347
CocoaSplit/AVFCapture.m Normal file
View file

@ -0,0 +1,347 @@
//
// AVFCapture.m
// H264Streamer
//
// Created by Zakk on 9/3/12.
// Copyright (c) 2012 Zakk. All rights reserved.
//
#import "AVFCapture.h"
#import "AbstractCaptureDevice.h"
@implementation AVFCapture
-(void) setVideoDimensions:(int)width height:(int)height
{
return;
}
-(bool) providesVideo
{
return YES;
}
-(bool) providesAudio
{
return YES;
}
-(bool) setActiveAudioDevice:(id)audioDevice
{
_audioInputDevice = audioDevice;
return YES;
}
-(bool) setActiveVideoDevice:(AbstractCaptureDevice *)newDev
{
_videoInputDevice = [newDev captureDevice];
return YES;
}
-(NSArray *) availableVideoDevices
{
NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
NSMutableArray *retArray = [[NSMutableArray alloc] init];
AVCaptureDevice *devinstance;
for(devinstance in devices)
{
[retArray addObject:[[AbstractCaptureDevice alloc] initWithName:[devinstance localizedName] device:devinstance uniqueID:devinstance.uniqueID]];
}
return (NSArray *)retArray;
}
-(bool) stopCaptureSession
{
if (_capture_session)
{
[_capture_session stopRunning];
_capture_session = nil;
_video_capture_queue = nil;
_videoInputDevice = nil;
_video_capture_output = nil;
_audio_capture_output = nil;
_audioInputDevice = nil;
_audio_capture_queue = nil;
}
return YES;
}
/*
-(void)grabPhoto
{
if (!_staticImage)
{
AVCaptureConnection *av_conn;
av_conn = [_capture_output connectionWithMediaType:AVMediaTypeVideo];
[_capture_output captureStillImageAsynchronouslyFromConnection:av_conn completionHandler:^(CMSampleBufferRef sampleBuffer, NSError *error) {
CVImageBufferRef videoFrame = CMSampleBufferGetImageBuffer(sampleBuffer);
//Should I copy the Image Buffer? instead of just retaining it?
CVPixelBufferRetain(videoFrame);
[_videoDelegate captureOutputVideo:self didOutputSampleBuffer:sampleBuffer didOutputImage:videoFrame];
_staticImage = videoFrame;
//CVPixelBufferRelease(videoFrame);
}];
} else {
[_videoDelegate captureOutputVideo:self didOutputSampleBuffer:nil didOutputImage:_staticImage];
}
}
*/
-(bool) startCaptureSession:(NSError **)error
{
if (_capture_session.isRunning)
return YES;
if (!_capture_session)
{
if (error)
{
*error = [NSError errorWithDomain:@"videoCapture" code:110 userInfo:@{NSLocalizedDescriptionKey : @"No active capture session"}];
}
return NO;
}
_video_capture_queue = dispatch_queue_create("VideoQueue", NULL);
[_video_capture_output setSampleBufferDelegate:self queue:_video_capture_queue];
_audio_capture_queue = dispatch_queue_create("AudioQueue", NULL);
[_audio_capture_output setSampleBufferDelegate:self queue:_audio_capture_queue];
[_capture_session startRunning];
return YES;
}
-(bool) setupCaptureSession:(NSError **)therror
{
AVCaptureDeviceInput *video_capture_input;
AVCaptureDeviceInput *audio_capture_input;
if (_capture_session)
return YES;
NSLog(@"Starting setup capture");
if (_videoDelegate || _audioDelegate)
{
_capture_session = [[AVCaptureSession alloc] init];
}
if (_videoDelegate)
{
if (!_videoInputDevice)
{
NSLog(@"No video input device");
*therror = [NSError errorWithDomain:@"videoCapture" code:100 userInfo:@{NSLocalizedDescriptionKey : @"Must select video capture device first"}];
return NO;
}
_capture_session = [[AVCaptureSession alloc] init];
video_capture_input = [AVCaptureDeviceInput deviceInputWithDevice:_videoInputDevice error:therror];
if (!video_capture_input)
{
NSLog(@"No video capture input?");
return NO;
}
if ([_capture_session canAddInput:video_capture_input])
{
[_capture_session addInput:video_capture_input];
} else {
NSLog(@"Can't add video_capture_input");
*therror = [NSError errorWithDomain:@"videoCapture" code:120 userInfo:@{NSLocalizedDescriptionKey : @"Could not add video input to capture session"}];
return NO;
}
_video_capture_output = [[AVCaptureVideoDataOutput alloc] init];
if ([_capture_session canAddOutput:_video_capture_output])
{
[_capture_session addOutput:_video_capture_output];
} else {
NSLog(@"Can't add video capture output");
*therror = [NSError errorWithDomain:@"videoCapture" code:130 userInfo:@{NSLocalizedDescriptionKey : @"Could not add video output to capture session"}];
return NO;
}
}
if (_audioDelegate)
{
if (_audioInputDevice)
{
audio_capture_input = [AVCaptureDeviceInput deviceInputWithDevice:_audioInputDevice error:therror];
if (!audio_capture_input)
{
NSLog(@"No audio capture input?");
return NO;
}
if ([_capture_session canAddInput:audio_capture_input])
{
[_capture_session addInput:audio_capture_input];
} else {
NSLog(@"Can't add audio input?");
*therror = [NSError errorWithDomain:@"audioCapture" code:220 userInfo:@{NSLocalizedDescriptionKey : @"Could not add audio input to capture session"}];
return NO;
}
_audio_capture_output = [[AVCaptureAudioDataOutput alloc] init];
_audio_capture_output.audioSettings = @{AVFormatIDKey: [NSNumber numberWithInt:kAudioFormatMPEG4AAC],
AVSampleRateKey: [NSNumber numberWithFloat: 44100.0],
AVEncoderBitRateKey: [NSNumber numberWithInt:_audioBitrate*1000 ],
AVNumberOfChannelsKey: @2
};
if ([_capture_session canAddOutput:_audio_capture_output])
{
[_capture_session addOutput:_audio_capture_output];
} else {
NSLog(@"Can't add audio capture output");
*therror = [NSError errorWithDomain:@"audioCapture" code:230 userInfo:@{NSLocalizedDescriptionKey : @"Could not add audio output to capture session"}];
return NO;
}
} else {
NSLog(@"No audio device?");
*therror = [NSError errorWithDomain:@"audioCapture" code:240 userInfo:@{NSLocalizedDescriptionKey : @"Must select audio capture device first"}];
return NO;
}
}
return YES;
}
void PixelBufferRelease(void *releaseRefCon, const void *baseAddress)
{
if (baseAddress)
free((void *)baseAddress);
}
- (CVImageBufferRef) getCurrentFrame
{
//copy the current frame to a new pixel buffer
//If I don't copy the pixel buffers, sometimes they just generate exceptions, even if I retain them and lock them. Assuming
//the IOSurface is being reclaimed or something
//There may be a better way to do this?
CVImageBufferRef newbuf = NULL;
void *bufbytes;
void *current_base;
size_t width;
size_t height;
size_t bytesPerRow;
@synchronized(self)
{
if (_currentFrame)
{
CVPixelBufferLockBaseAddress(_currentFrame, 1);
width = CVPixelBufferGetWidth(_currentFrame);
height = CVPixelBufferGetHeight(_currentFrame);
bytesPerRow = CVPixelBufferGetBytesPerRow(_currentFrame);
bufbytes = malloc(height*bytesPerRow);
current_base = CVPixelBufferGetBaseAddress(_currentFrame);
memcpy(bufbytes, current_base, height*bytesPerRow);
CVPixelBufferCreateWithBytes(NULL, width, height, CVPixelBufferGetPixelFormatType(_currentFrame), bufbytes, bytesPerRow, PixelBufferRelease, NULL, NULL, &newbuf);
CVBufferPropagateAttachments(_currentFrame, newbuf);
CVPixelBufferUnlockBaseAddress(_currentFrame, 1);
}
}
return newbuf;
}
- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection
{
if (connection.output == _video_capture_output)
{
CVImageBufferRef videoFrame = CMSampleBufferGetImageBuffer(sampleBuffer);
@synchronized(self)
{
if (_currentFrame)
{
CVPixelBufferRelease(_currentFrame);
}
CVPixelBufferRetain(videoFrame);
_currentFrame = videoFrame;
}
} else if (connection.output == _audio_capture_output) {
[_audioDelegate captureOutputAudio:self didOutputSampleBuffer:sampleBuffer];
}
}
@end

View file

@ -0,0 +1,23 @@
//
// AbstractCaptureDevice.h
// H264Streamer
//
// Created by Zakk on 9/7/12.
// Copyright (c) 2012 Zakk. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface AbstractCaptureDevice : NSObject
@property (weak) id captureDevice;
@property (strong) NSString * captureName;
@property (strong) NSString *uniqueID;
-(id) initWithName:(NSString *)name device:(id)device uniqueID:(NSString *) uniqueID;
-(bool) isEqual:(id)object;
@end

View file

@ -0,0 +1,39 @@
//
// AbstractCaptureDevice.m
// H264Streamer
//
// Created by Zakk on 9/7/12.
// Copyright (c) 2012 Zakk. All rights reserved.
//
//Why does this class exist?
//It makes it easy to bind the list to an NSArrayController; Using an NSDictionaryController requires the device to be
//copyable, and AVCaptureDevice isn't :(
#import "AbstractCaptureDevice.h"
@implementation AbstractCaptureDevice
-(id) initWithName:(NSString *)name device:(id)device uniqueID:(NSString *)uniqueID
{
self = [super init];
if (self)
{
self.captureName = name;
self.captureDevice = device;
self.uniqueID = uniqueID;
}
return self;
}
-(bool) isEqual:(id)object;
{
return [self.uniqueID isEqualToString:((AbstractCaptureDevice *)object).uniqueID];
}
@end

26
CocoaSplit/AppDelegate.h Normal file
View file

@ -0,0 +1,26 @@
//
// AppDelegate.h
// H264Streamer
//
// Created by Zakk on 9/2/12.
// Copyright (c) 2012 Zakk. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import <QTKit/QTKit.h>
#import "CaptureController.h"
@interface AppDelegate : NSObject <NSApplicationDelegate>
{
}
@property (unsafe_unretained) IBOutlet CaptureController *captureController;
@property (unsafe_unretained) IBOutlet NSWindow *window;
@end

35
CocoaSplit/AppDelegate.m Normal file
View file

@ -0,0 +1,35 @@
//
// AppDelegate.m
// H264Streamer
//
// Created by Zakk on 9/2/12.
// Copyright (c) 2012 Zakk. All rights reserved.
//
#import "AppDelegate.h"
#import <AVFoundation/AVFoundation.h>
@implementation AppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
[self.captureController loadSettings];
// Insert code here to initialize your application
}
-(void) applicationWillTerminate: (NSNotification *)notification
{
[self.captureController saveSettings];
}
@end

View file

@ -0,0 +1,107 @@
//
// CaptureController.h
// H264Streamer
//
// Created by Zakk on 9/2/12.
// Copyright (c) 2012 Zakk. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#import <VideoToolbox/VideoToolbox.h>
#import "AVFCapture.h"
#import <CoreMedia/CoreMedia.h>
#import "FFMpegTask.h"
#import "CaptureSessionProtocol.h"
#import "AbstractCaptureDevice.h"
void VideoCompressorReceiveFrame(void *, void *, OSStatus , VTEncodeInfoFlags , CMSampleBufferRef );
@interface CaptureController : NSObject <CaptureDataReceiverDelegateProtocol> {
id _video_capture_session;
id _audio_capture_session;
VTCompressionSessionRef _compression_session;
NSTimer *_captureTimer;
long long _frameCount;
CFAbsoluteTime _firstFrameTime;
AVAssetWriter *_asset_writer;
NSString *_selectedVideoType;
}
- (IBAction)addStreamingService:(id)sender;
- (IBAction)streamButtonPushed:(id)sender;
- (IBAction)openCreateSheet:(id)sender;
- (IBAction)videoRefresh:(id)sender;
- (IBAction)closeCreateSheet:(id)sender;
@property (weak) NSString *selectedVideoType;
@property (strong) NSArray *videoTypes;
@property (strong) NSMutableArray *ffmpeg_objects;
@property (weak) NSString *streamingServiceServer;
@property (weak) NSString *streamingServiceKey;
@property (weak) NSString *streamingDestination;
@property (weak) NSString *selectedDestinationType;
@property (strong) IBOutlet NSWindow *createSheet;
@property (strong) NSDictionary *destinationTypes;
@property (strong) NSMutableArray *captureDestinations;
@property (weak) NSIndexSet *selectedCaptureDestinations;
@property (assign) int captureVideoAverageBitrate;
@property (assign) int captureHeight;
@property (assign) int captureWidth;
@property (assign) int audioBitrate;
@property (assign) int audioSamplerate;
- (IBAction)removeDestination:(id)sender;
@property (weak) NSArray *videoCaptureDevices;
@property (weak) NSArray *audioCaptureDevices;
@property (strong) FFMpegTask *ffmpeg_obj;
@property (strong) AVAssetWriterInput *video_writer;
@property (strong) AVAssetWriterInput *audio_writer;
@property (weak) AbstractCaptureDevice *selectedVideoCapture;
@property (weak) AVCaptureDevice *selectedAudioCapture;
@property (assign) int captureFPS;
@property (weak) NSString *ffmpeg_path;
- (void)saveSettings;
- (void)loadSettings;
@end

View file

@ -0,0 +1,583 @@
//
// CaptureController.m
// H264Streamer
//
// Created by Zakk on 9/2/12.
// Copyright (c) 2012 Zakk. All rights reserved.
//
#import "CaptureController.h"
#import "FFMpegTask.h"
#import "SyphonCapture.h"
#import "OutputDestination.h"
#import "DesktopCapture.h"
#import <IOSurface/IOSurface.h>
@implementation CaptureController
-(IBAction)openCreateSheet:(id)sender
{
if (!_createSheet)
{
NSString *panelName;
self.streamingDestination = nil;
if ([self.selectedDestinationType isEqualToString:@"file"])
{
panelName = @"FilePanel";
} else {
panelName = @"StreamServicePanel";
}
[NSBundle loadNibNamed:panelName owner:self];
}
[NSApp beginSheet:self.createSheet modalForWindow:[[NSApp delegate] window] modalDelegate:self didEndSelector:NULL contextInfo:NULL];
}
-(IBAction)closeCreateSheet:(id)sender
{
[NSApp endSheet:self.createSheet];
[self.createSheet close];
self.createSheet = nil;
}
-(void) selectedAudioCaptureFromID:(NSString *)uniqueID
{
self.selectedAudioCapture = [AVCaptureDevice deviceWithUniqueID:uniqueID];
}
-(void) selectedVideoCaptureFromID:(NSString *)uniqueID
{
AbstractCaptureDevice *dummydev = [[AbstractCaptureDevice alloc] init];
dummydev.uniqueID = uniqueID;
NSUInteger sidx;
sidx = [self.videoCaptureDevices indexOfObject:dummydev];
if (sidx == NSNotFound)
{
self.selectedVideoCapture = nil;
} else {
self.selectedVideoCapture = [self.videoCaptureDevices objectAtIndex:sidx];
}
}
-(IBAction) videoRefresh:(id)sender
{
self.videoCaptureDevices = [_video_capture_session availableVideoDevices];
if (self.selectedVideoCapture)
{
NSUInteger sidx;
sidx = [self.videoCaptureDevices indexOfObject:self.selectedVideoCapture];
if (sidx == NSNotFound)
{
self.selectedVideoCapture = nil;
} else {
self.selectedVideoCapture = [self.videoCaptureDevices objectAtIndex:sidx];
}
}
}
-(NSString *) selectedVideoType
{
return _selectedVideoType;
}
-(void) setSelectedVideoType:(NSString *)selectedVideoType
{
if ([selectedVideoType isEqualToString:@"Desktop"])
{
_video_capture_session = [[DesktopCapture alloc ] init];
} else if ([selectedVideoType isEqualToString:@"AVFoundation"]) {
_video_capture_session = [[AVFCapture alloc] init];
} else {
_video_capture_session = nil;
}
if (!_video_capture_session)
{
_audio_capture_session = nil;
_selectedVideoType = nil;
}
if ([_video_capture_session providesAudio])
{
_audio_capture_session = _video_capture_session;
} else {
_audio_capture_session = [[AVFCapture alloc] init];
}
self.videoCaptureDevices = [_video_capture_session availableVideoDevices];
self.audioCaptureDevices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeAudio];
self.selectedVideoCapture = nil;
_selectedVideoType = selectedVideoType;
}
-(id) init
{
if (self = [super init])
{
/*
self.destinationTypes = @{
@"twitchtv" : @"Twitch.tv/Justin.tv",
@"own3dtv" : @"Own3d.tv",
@"file" : @"Local File" };
*/
dispatch_source_t sigsrc = dispatch_source_create(DISPATCH_SOURCE_TYPE_SIGNAL, SIGPIPE, 0, dispatch_get_global_queue(0, 0));
dispatch_source_set_event_handler(sigsrc, ^{ return;});
dispatch_resume(sigsrc);
self.destinationTypes = @{@"file" : @"Local File",
@"rtmp" : @"RTMP Stream"};
self.videoTypes = @[@"Desktop", @"AVFoundation"];
self.selectedVideoType = [self.videoTypes objectAtIndex:0];
}
return self;
}
- (NSString *) saveFilePath
{
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *saveFolder = @"~/Library/Application Support/H264Streamer";
saveFolder = [saveFolder stringByExpandingTildeInPath];
if ([fileManager fileExistsAtPath:saveFolder] == NO)
{
[fileManager createDirectoryAtPath:saveFolder withIntermediateDirectories:NO attributes:nil error:nil];
}
NSString *saveFile = @"H264Streamer.settings";
return [saveFolder stringByAppendingPathComponent:saveFile];
}
-(void) saveSettings
{
NSString *path = [self saveFilePath];
NSMutableDictionary *saveRoot;
saveRoot = [NSMutableDictionary dictionary];
[saveRoot setValue: [NSNumber numberWithInt:self.captureWidth] forKey:@"captureWidth"];
[saveRoot setValue: [NSNumber numberWithInt:self.captureHeight] forKey:@"captureHeight"];
[saveRoot setValue: [NSNumber numberWithInt:self.captureFPS] forKey:@"captureFPS"];
[saveRoot setValue: [NSNumber numberWithInt:self.captureVideoAverageBitrate] forKey:@"captureVideoAverageBitrate"];
[saveRoot setValue: [NSNumber numberWithInt:self.audioBitrate] forKey:@"audioBitrate"];
[saveRoot setValue: [NSNumber numberWithInt:self.audioSamplerate] forKey:@"audioSamplerate"];
[saveRoot setValue: self.selectedVideoCapture.uniqueID forKey:@"videoCaptureID"];
[saveRoot setValue: self.selectedAudioCapture.uniqueID forKey:@"audioCaptureID"];
[saveRoot setValue: self.captureDestinations forKey:@"captureDestinations"];
[NSKeyedArchiver archiveRootObject:saveRoot toFile:path];
}
-(void) loadSettings
{
NSString *path = [self saveFilePath];
NSDictionary *saveRoot;
saveRoot = [NSKeyedUnarchiver unarchiveObjectWithFile:path];
self.captureWidth = [[saveRoot valueForKey:@"captureWidth"] intValue];
self.captureHeight = [[saveRoot valueForKey:@"captureHeight"] intValue];
self.captureFPS = [[saveRoot valueForKey:@"captureFPS"] intValue];
self.captureVideoAverageBitrate = [[saveRoot valueForKey:@"captureVideoAverageBitrate"] intValue];
self.audioBitrate = [[saveRoot valueForKey:@"audioBitrate"] intValue];
self.audioSamplerate = [[saveRoot valueForKey:@"audioSamplerate"] intValue];
self.captureDestinations = [saveRoot valueForKey:@"captureDestinations"];
if (!self.captureDestinations)
{
self.captureDestinations = [[NSMutableArray alloc] init];
}
NSString *videoID = [saveRoot valueForKey:@"videoCaptureID"];
[self selectedVideoCaptureFromID:videoID];
NSString *audioID = [saveRoot valueForKey:@"audioCaptureID"];
[self selectedAudioCaptureFromID:audioID];
}
- (IBAction)ffmpegPathPushed:(id)sender {
NSOpenPanel *filepanel = [NSOpenPanel openPanel];
[filepanel setCanChooseFiles:YES];
[filepanel setAllowsMultipleSelection:FALSE];
if ([filepanel runModal] == NSOKButton)
{
NSURL *fpath = [filepanel URL];
[[[NSUserDefaultsController sharedUserDefaultsController] values] setValue:[fpath path] forKey:@"ffmpeg_path"];
}
}
- (IBAction)addStreamingService:(id)sender {
OutputDestination *newDest;
newDest = [[OutputDestination alloc] initWithType:_selectedDestinationType];
newDest.server_name = _streamingServiceServer;
newDest.stream_key = _streamingServiceKey;
newDest.destination = _streamingDestination;
[[self mutableArrayValueForKey:@"captureDestinations"] addObject:newDest];
[self closeCreateSheet:nil];
}
- (IBAction)streamButtonPushed:(id)sender {
NSButton *button = (NSButton *)sender;
if ([button state] == NSOnState)
{
// We should already have a capture session from init since we need it to figure out device lists.
NSError *error;
bool success;
[_audio_capture_session setActiveAudioDevice:_selectedAudioCapture];
[_video_capture_session setActiveVideoDevice:_selectedVideoCapture];
[_video_capture_session setVideoCaptureFPS:_captureFPS];
[_video_capture_session setVideoDelegate:self];
[_video_capture_session setVideoDimensions:_captureWidth height:_captureHeight];
[_audio_capture_session setAudioDelegate:self];
[_audio_capture_session setAudioBitrate:_audioBitrate];
[_audio_capture_session setAudioSamplerate:_audioSamplerate];
success = [_video_capture_session setupCaptureSession:&error];
if (!success)
{
[NSApp presentError:error];
[sender setNextState];
return;
}
success = [_audio_capture_session setupCaptureSession:&error];
if (!success)
{
[NSApp presentError:error];
[sender setNextState];
return;
}
success = [self setupCompression:&error];
if (!success)
{
NSLog(@"Failed compression setup");
[NSApp presentError:error];
[sender setNextState];
return;
}
_ffmpeg_objects = [[NSMutableArray alloc] init];
OutputDestination *output;
for (output in _captureDestinations)
{
FFMpegTask *newout;
newout = [[FFMpegTask alloc] init];
newout.height = _captureHeight;
newout.width = _captureWidth;
newout.framerate = _captureFPS;
newout.stream_output = output.destination;
newout.stream_format = output.output_format;
newout.samplerate = _audioSamplerate;
[_ffmpeg_objects addObject:newout];
}
success = [_video_capture_session startCaptureSession:&error];
_frameCount = 0;
_captureTimer = [NSTimer timerWithTimeInterval:1.0/_captureFPS target:self selector:@selector(newFrame) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:_captureTimer forMode:NSRunLoopCommonModes];
if (!success)
{
NSLog(@"Failed start capture");
[NSApp presentError:error];
[sender setNextState];
return;
}
success = [_audio_capture_session startCaptureSession:&error];
_frameCount = 0;
if (!success)
{
NSLog(@"Failed start capture");
[NSApp presentError:error];
[sender setNextState];
return;
}
} else {
[_asset_writer finishWriting];
if (_captureTimer)
{
[_captureTimer invalidate];
}
if (_compression_session)
{
VTCompressionSessionInvalidate(_compression_session);
CFRelease(_compression_session);
}
if (_video_capture_session)
{
[_video_capture_session stopCaptureSession];
}
if (_audio_capture_session)
{
[_audio_capture_session stopCaptureSession];
}
[_ffmpeg_objects makeObjectsPerformSelector:@selector(stopProcess)];
}
}
- (bool)setupCompression:(NSError **)error
{
OSStatus status;
NSDictionary *encoder_spec = @{@"EnableHardwareAcceleratedVideoEncoder": @1};
if (!_captureHeight || !_captureHeight)
{
*error = [NSError errorWithDomain:@"videoCapture" code:120 userInfo:@{NSLocalizedDescriptionKey : @"Width and Height must be non-zero"}];
return NO;
}
status = VTCompressionSessionCreate(NULL, _captureWidth, _captureHeight, 'avc1', (__bridge CFDictionaryRef)encoder_spec, NULL, NULL, VideoCompressorReceiveFrame, (__bridge void *)self, &_compression_session);
//If priority isn't set to -20 the framerate in the SPS/VUI section locks to 25. With -20 it takes on the value of
//whatever ExpectedFrameRate is. I have no idea what the fuck, but it works.
VTSessionSetProperty(_compression_session, (CFStringRef)@"Priority", (__bridge CFTypeRef)(@-20));
VTSessionSetProperty(_compression_session, kVTCompressionPropertyKey_AllowFrameReordering, kCFBooleanFalse);
//VTSessionSetProperty(_compression_session, kVTCompressionPropertyKey_MaxKeyFrameInterval, (__bridge CFTypeRef)(@30));
if (_captureVideoAverageBitrate > 0)
{
int real_bitrate = _captureVideoAverageBitrate*1024;
NSLog(@"Setting bitrate to %d", real_bitrate);
VTSessionSetProperty(_compression_session, kVTCompressionPropertyKey_AverageBitRate, CFNumberCreate(NULL, kCFNumberIntType, &real_bitrate));
}
if (_captureFPS && _captureFPS > 0)
{
VTSessionSetProperty(_compression_session, kVTCompressionPropertyKey_ExpectedFrameRate, CFNumberCreate(NULL, kCFNumberIntType, &_captureFPS));
}
return YES;
}
- (void)newFrame
{
[self captureOutputVideo:_video_capture_session didOutputSampleBuffer:nil didOutputImage:[_video_capture_session getCurrentFrame] frameTime:0 ];
}
- (void)captureOutputAudio:(id)fromDevice didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
{
CFAbsoluteTime currentTime = CFAbsoluteTimeGetCurrent();
CMTime pts = CMTimeMake(currentTime*1000, 1000);
CMSampleBufferSetOutputPresentationTimeStamp(sampleBuffer, pts);
for (id ffmpeg in _ffmpeg_objects)
{
[ffmpeg writeAudioSampleBuffer:sampleBuffer presentationTimeStamp:pts];
}
}
- (void)captureOutputVideo:(AbstractCaptureDevice *)fromDevice didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer didOutputImage:(CVImageBufferRef)imageBuffer frameTime:(uint64_t)frameTime
{
CMTime pts;
CMTime duration;
/*
if (sampleBuffer)
{
pts = CMSampleBufferGetPresentationTimeStamp(sampleBuffer);
duration = CMSampleBufferGetDuration(sampleBuffer);
} else {
*/
CFAbsoluteTime currentTime = CFAbsoluteTimeGetCurrent();
pts = CMTimeMake(currentTime*1000, 1000);
//CMTimeShow(pts);
duration = CMTimeMake(1, _captureFPS);
_frameCount++;
//}
if(!imageBuffer)
return;
VTCompressionSessionEncodeFrame(_compression_session, imageBuffer, pts, duration, NULL, imageBuffer, NULL);
CVPixelBufferRelease(imageBuffer); //VTCompression should retain it?
}
void VideoCompressorReceiveFrame(void *VTref, void *VTFrameRef, OSStatus status, VTEncodeInfoFlags infoFlags, CMSampleBufferRef sampleBuffer)
{
@autoreleasepool {
if(!sampleBuffer)
return;
CaptureController *selfobj = (__bridge CaptureController *)VTref;
CFRetain(sampleBuffer);
for (id ff in selfobj.ffmpeg_objects)
{
[ff writeVideoSampleBuffer:sampleBuffer];
}
CFRelease(sampleBuffer);
}
}
- (void) setNilValueForKey:(NSString *)key
{
NSUInteger key_idx = [@[@"captureWidth", @"captureHeight", @"captureFPS",
@"captureVideoAverageBitrate", @"audioBitrate", @"audioSamplerate"] indexOfObject:key];
if (key_idx != NSNotFound)
{
return [self setValue:[NSNumber numberWithInt:0] forKey:key];
}
[super setNilValueForKey:key];
}
- (IBAction)removeDestination:(id)sender
{
[self.selectedCaptureDestinations enumerateIndexesWithOptions:0 usingBlock:^(NSUInteger idx, BOOL *stop) {
[[self mutableArrayValueForKey:@"captureDestinations"] removeObjectAtIndex:idx];
}];
NSLog(@"OUTPUT DESTINATIONS %@", self.captureDestinations);
}
@end

View file

@ -0,0 +1,58 @@
//
// CaptureSessionProtocol.h
// H264Streamer
//
// Created by Zakk on 9/7/12.
// Copyright (c) 2012 Zakk. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "AbstractCaptureDevice.h"
#import <AVFoundation/AVFoundation.h>
@protocol CaptureSessionProtocol <NSObject>
@required
-(NSArray *) availableVideoDevices;
-(bool) stopCaptureSession;
-(bool) startCaptureSession:(NSError **)error;
-(bool) setActiveVideoDevice:(id)videoDevice;
-(bool) providesVideo;
-(bool) providesAudio;
-(void) setVideoDelegate:(id)delegate;
-(bool) setupCaptureSession:(NSError **)therror;
-(void) setVideoCaptureFPS:(int)fps;
-(void) setVideoDimensions:(int)width height:(int)height;
// For those capture schemes that can (attempt) to capture frames at a specific FPS, we should do so.
// The main capture controller will call out for a frame at the specified FPS rate.
// Implementations are free to define exactly what the 'current frame' is.
// This is done to decouple the output rate from weird/badly behaved capture schemes that can't reliably maintain
// the given rate. Basically we'll drop/dup frames if we have to to keep the output to ffmpeg at a more or less steady pace.
-(CVImageBufferRef) getCurrentFrame;
@optional
-(void) setAudioDelegate:(id)delegate;
-(bool) setActiveAudioDevice:(id)audioDevice;
-(NSArray *) availableAudioDevices;
@end
@protocol CaptureDataReceiverDelegateProtocol <NSObject>
@required
//if CMSampleBufferRef may or may not be nil? If it is nil the receiver must
//create PresentationTimeStamps if they are required...
-(void)captureOutputVideo:(id) fromDevice didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer didOutputImage:(CVImageBufferRef)imageBuffer frameTime:(uint64_t) frameTime;
-(void)captureOutputAudio:(id) fromDevice didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer;
@end

View file

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>zakk.lol.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2012 Zakk. All rights reserved.</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>

View file

@ -0,0 +1,7 @@
//
// Prefix header for all source files of the 'H264Streamer' target in the 'H264Streamer' project
//
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif

View file

@ -0,0 +1,42 @@
//
// DesktopCapture.h
// H264Streamer
//
// Created by Zakk on 9/24/12.
// Copyright (c) 2012 Zakk. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "CaptureSessionProtocol.h"
#import "CaptureController.h"
@interface DesktopCapture : NSObject <CaptureSessionProtocol>
{
int _width;
int _height;
dispatch_queue_t _capture_queue;
CGDisplayStreamRef _displayStreamRef;
IOSurfaceRef _currentFrame;
uint64_t _currentFrameTime;
CGDirectDisplayID _activeVideoDevice;
}
-(bool)providesAudio;
-(bool)providesVideo;
-(NSArray *)availableVideoDevices;
-(void) setVideoDimensions:(int)width height:(int)height;
@property (strong) id videoDelegate;
@property (assign) int videoCaptureFPS;
@end

196
CocoaSplit/DesktopCapture.m Normal file
View file

@ -0,0 +1,196 @@
//
// DesktopCapture.m
// H264Streamer
//
// Created by Zakk on 9/24/12.
// Copyright (c) 2012 Zakk. All rights reserved.
//
#import "DesktopCapture.h"
#import <IOKit/graphics/IOGraphicsLib.h>
#import <IOSurface/IOSurface.h>
@implementation DesktopCapture
-(bool) setActiveVideoDevice:(AbstractCaptureDevice *)newDev
{
_activeVideoDevice = [[newDev captureDevice] unsignedIntValue];
return YES;
}
-(void) setVideoDimensions:(int)width height:(int)height
{
_width = width;
_height = height;
}
-(bool)setupCaptureSession:(NSError *__autoreleasing *)therror
{
if (!_activeVideoDevice)
{
*therror = [NSError errorWithDomain:@"videoCapture" code:100 userInfo:@{NSLocalizedDescriptionKey : @"Must select video capture device first"}];
return NO;
}
if (!(_width > 0) || !(_height > 0))
{
*therror = [NSError errorWithDomain:@"videoCapture" code:150 userInfo:@{NSLocalizedDescriptionKey : @"Width and height must be set to greater than zero"}];
return NO;
}
_capture_queue = dispatch_queue_create("Desktop Capture Queue", DISPATCH_QUEUE_SERIAL);
if (!_capture_queue)
{
*therror = [NSError errorWithDomain:@"videoCapture" code:160 userInfo:@{NSLocalizedDescriptionKey : @"Could not create desktop capture dispatch queue"}];
return NO;
}
_currentFrameTime = 0;
NSNumber *minframetime = [NSNumber numberWithFloat:1/self.videoCaptureFPS];
_displayStreamRef = CGDisplayStreamCreateWithDispatchQueue(_activeVideoDevice, _width, _height, '420v', (__bridge CFDictionaryRef)(@{(NSString *)kCGDisplayStreamQueueDepth : @20, (NSString *)kCGDisplayStreamMinimumFrameTime : minframetime, (NSString *)kCGDisplayStreamPreserveAspectRatio: @NO}), _capture_queue, ^(CGDisplayStreamFrameStatus status, uint64_t displayTime, IOSurfaceRef frameSurface, CGDisplayStreamUpdateRef updateRef) {
if (frameSurface)
{
@synchronized(self) {
//NSLog(@"Got surface from CGDISplayStream");
if (_currentFrame)
{
IOSurfaceDecrementUseCount(_currentFrame);
CFRelease(_currentFrame);
}
_currentFrame = frameSurface;
_currentFrameTime = displayTime;
IOSurfaceIncrementUseCount(_currentFrame);
CFRetain(_currentFrame);
}
}
});
return YES;
}
-(bool)startCaptureSession:(NSError *__autoreleasing *)error
{
CGDisplayStreamStart(_displayStreamRef);
return YES;
}
-(bool)stopCaptureSession
{
CGDisplayStreamStop(_displayStreamRef);
_currentFrame = NULL;
_capture_queue = NULL;
return YES;
}
void DesktopPixelBufferRelease(void *releaseRefCon, const void *baseAddress)
{
if (baseAddress)
free((void *)baseAddress);
}
- (CVImageBufferRef) getCurrentFrame
{
CVImageBufferRef newbuf = NULL;
@synchronized(self)
{
if (_currentFrame)
{
//CFRetain(_currentFrame);
CVPixelBufferRef tmpbuf;
CVPixelBufferCreateWithIOSurface(NULL, _currentFrame, NULL, &tmpbuf);
//CFRelease(_currentFrame);
return tmpbuf;
}
}
return newbuf;
}
-(bool)providesAudio
{
return NO;
}
-(bool)providesVideo
{
return YES;
}
-(NSArray *) availableVideoDevices
{
CGDirectDisplayID display_ids[15];
uint32_t active_display_count;
CGGetActiveDisplayList(15, display_ids, &active_display_count);
NSMutableArray *retArray = [[NSMutableArray alloc] init];
for(int i = 0; i < active_display_count; i++)
{
CGDirectDisplayID disp_id = display_ids[i];
NSString *displayName;
NSDictionary *deviceInfo = (NSDictionary *)CFBridgingRelease(IODisplayCreateInfoDictionary(CGDisplayIOServicePort(disp_id), kIODisplayOnlyPreferredName));
NSDictionary *localizedNames = [deviceInfo objectForKey:[NSString stringWithUTF8String:kDisplayProductName]];
if ([localizedNames count] > 0)
{
displayName = [localizedNames objectForKey:[[localizedNames allKeys] objectAtIndex:0]];
} else {
displayName = @"????";
}
NSNumber *display_id_obj = [NSNumber numberWithLong:disp_id];
NSString *display_id_uniq = [NSString stringWithFormat:@"%ud", disp_id];
[retArray addObject:[[AbstractCaptureDevice alloc] initWithName:displayName device:display_id_obj uniqueID:display_id_uniq]];
}
return (NSArray *)retArray;
}
@end

50
CocoaSplit/FFMpegTask.h Normal file
View file

@ -0,0 +1,50 @@
//
// FFMpegTask.h
// H264Streamer
//
// Created by Zakk on 9/4/12.
// Copyright (c) 2012 Zakk. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreMedia/CoreMedia.h>
#import "libavformat/avformat.h"
#define AUDIO_BUFFER_SIZE 1000
@interface FFMpegTask : NSObject
{
dispatch_queue_t _stream_dispatch;
AVFormatContext *_av_fmt_ctx;
AVStream *_av_video_stream;
AVStream *_av_audio_stream;
char *_audio_extradata;
size_t _audio_extradata_size;
}
-(void) writeVideoSampleBuffer:(CMSampleBufferRef)theBuffer;
-(void) writeAudioSampleBuffer:(CMSampleBufferRef)theBuffer presentationTimeStamp:(CMTime)pts;
-(bool) stopProcess;
@property (assign) bool is_stopped;
@property (strong) NSString *stream_output;
@property (strong) NSString *stream_format;
@property (assign) int framerate;
@property (assign) int width;
@property (assign) int height;
@property (assign) int samplerate;
@end

362
CocoaSplit/FFMpegTask.m Normal file
View file

@ -0,0 +1,362 @@
//
// FFMpegTask.m
// H264Streamer
//
// Created by Zakk on 9/4/12.
// Copyright (c) 2012 Zakk. All rights reserved.
//
#import "FFMpegTask.h"
#import <sys/types.h>
#import <sys/stat.h>
#import <stdio.h>
@implementation FFMpegTask
#include "libavformat/avformat.h"
int readAudioTagLength(char **buffer)
{
int length = 0;
int cnt =4;
while(cnt--)
{
int c = *(*buffer)++;
length = (length << 7) | (c & 0x7f);
if (!(c & 0x80))
break;
}
return length;
}
int readAudioTag(char **buffer, int *tag)
{
*tag = *(*buffer)++;
return readAudioTagLength(buffer);
}
void getAudioExtradata(char *cookie, char **buffer, size_t *size)
{
char *esds = cookie;
int tag, length;
*size = 0;
readAudioTag(&esds, &tag);
esds += 2;
if (tag == 0x03)
esds++;
readAudioTag(&esds, &tag);
if (tag == 0x04) {
esds++;
esds++;
esds += 3;
esds += 4;
esds += 4;
length = readAudioTag(&esds, &tag);
if (tag == 0x05)
{
*buffer = calloc(1, length + 8);
if (*buffer)
{
memcpy(*buffer, esds, length);
*size = length;
}
}
}
}
-(void) writeAudioSampleBuffer:(CMSampleBufferRef)theBuffer presentationTimeStamp:(CMTime)pts;
{
CFRetain(theBuffer);
if (_av_audio_stream)
{
dispatch_async(_stream_dispatch, ^{
CMBlockBufferRef blockBufferRef = CMSampleBufferGetDataBuffer(theBuffer);
size_t buffer_length;
size_t offset_length;
char *sampledata;
AVPacket pkt;
av_init_packet(&pkt);
pkt.stream_index = _av_audio_stream->index;
CMBlockBufferGetDataPointer(blockBufferRef, 0, &offset_length, &buffer_length, &sampledata);
pkt.data = (uint8_t *)sampledata;
pkt.size = (int)buffer_length;
pkt.pts = CMTimeGetSeconds(pts)*1000;
av_interleaved_write_frame(_av_fmt_ctx, &pkt);
//CMSampleBufferInvalidate(theBuffer);
CFRelease(theBuffer);
});
} else if (!_audio_extradata) {
CMAudioFormatDescriptionRef audio_fmt;
audio_fmt = CMSampleBufferGetFormatDescription(theBuffer);
void *audio_tmp;
if (!audio_fmt)
return;
audio_tmp = (char *)CMAudioFormatDescriptionGetMagicCookie(audio_fmt, &_audio_extradata_size);
if (audio_tmp)
{
getAudioExtradata(audio_tmp, &_audio_extradata, &_audio_extradata_size);
}
}
}
-(bool) createAVFormatOut:(CMSampleBufferRef)theBuffer
{
NSLog(@"Creating output format %@ DESTINATION %@", _stream_format, _stream_output);
AVOutputFormat *av_out_fmt;
avformat_alloc_output_context2(&_av_fmt_ctx, NULL, [_stream_format UTF8String], [_stream_output UTF8String]);
if (!_av_fmt_ctx)
{
NSLog(@"No av_fmt_ctx");
return NO;
}
av_out_fmt = _av_fmt_ctx->oformat;
_av_video_stream = avformat_new_stream(_av_fmt_ctx, 0);
if (!_av_video_stream)
{
NSLog(@"No av_video_stream");
return NO;
}
AVCodecContext *c_ctx = _av_video_stream->codec;
c_ctx->codec_type = AVMEDIA_TYPE_VIDEO;
c_ctx->codec_id = AV_CODEC_ID_H264;
c_ctx->width = _width;
c_ctx->height = _height;
c_ctx->time_base.num = 1;
c_ctx->time_base.den = _framerate;
_av_audio_stream = avformat_new_stream(_av_fmt_ctx, 0);
if (!_av_audio_stream)
{
NSLog(@"No av_audio_stream");
return NO;
}
AVCodecContext *a_ctx = _av_audio_stream->codec;
a_ctx->codec_type = AVMEDIA_TYPE_AUDIO;
a_ctx->codec_id = AV_CODEC_ID_AAC;
a_ctx->time_base.num = 1;
a_ctx->time_base.den = _framerate;
a_ctx->sample_rate = _samplerate;
a_ctx->channels = 2;
a_ctx->extradata = (unsigned char *)_audio_extradata;
a_ctx->extradata_size = (int)_audio_extradata_size;
CMFormatDescriptionRef fmt;
CFDictionaryRef atoms;
CFStringRef avccKey;
CFDataRef avcc_data;
CFIndex avcc_size;
fmt = CMSampleBufferGetFormatDescription(theBuffer);
atoms = CMFormatDescriptionGetExtension(fmt, kCMFormatDescriptionExtension_SampleDescriptionExtensionAtoms);
avccKey = CFStringCreateWithCString(NULL, "avcC", kCFStringEncodingUTF8);
avcc_data = CFDictionaryGetValue(atoms, avccKey);
avcc_size = CFDataGetLength(avcc_data);
c_ctx->extradata = malloc(avcc_size);
CFDataGetBytes(avcc_data, CFRangeMake(0,avcc_size), c_ctx->extradata);
c_ctx->extradata_size = (int)avcc_size;
if (_av_fmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)
c_ctx->flags |= CODEC_FLAG_GLOBAL_HEADER;
if (_av_fmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)
a_ctx->flags |= CODEC_FLAG_GLOBAL_HEADER;
av_dump_format(_av_fmt_ctx, 0, [_stream_output UTF8String], 1);
if (!(av_out_fmt->flags & AVFMT_NOFILE))
{
NSLog(@"Doing AVIO_OPEN");
avio_open(&_av_fmt_ctx->pb, [_stream_output UTF8String], AVIO_FLAG_WRITE);
}
avformat_write_header(_av_fmt_ctx, NULL);
return YES;
}
-(void) writeVideoSampleBuffer:(CMSampleBufferRef)theBuffer
{
CFRetain(theBuffer);
dispatch_async(_stream_dispatch, ^{
if (!_av_video_stream)
{
if (_audio_extradata)
{
[self createAVFormatOut:theBuffer];
} else {
return;
}
}
CMBlockBufferRef my_buffer;
char *sampledata;
size_t offset_length;
size_t buffer_length;
my_buffer = CMSampleBufferGetDataBuffer(theBuffer);
AVPacket pkt;
av_init_packet(&pkt);
pkt.stream_index = _av_video_stream->index;
CMBlockBufferGetDataPointer(my_buffer, 0, &offset_length, &buffer_length, &sampledata);
pkt.data = (uint8_t *)sampledata;
pkt.size = (int)buffer_length;
pkt.pts = CMTimeGetSeconds(CMSampleBufferGetPresentationTimeStamp(theBuffer))*1000;
if ([self isBufferKeyframe:theBuffer])
{
pkt.flags |= AV_PKT_FLAG_KEY;
}
av_interleaved_write_frame(_av_fmt_ctx, &pkt);
//CMSampleBufferInvalidate(theBuffer);
CFRelease(theBuffer);
});
return;
}
-(BOOL) isBufferKeyframe:(CMSampleBufferRef)theBuffer
{
CFArrayRef sample_attachments;
BOOL result = NO;
sample_attachments = CMSampleBufferGetSampleAttachmentsArray(theBuffer, NO);
if (sample_attachments)
{
CFDictionaryRef attach;
CFBooleanRef depends_on_others;
attach = CFArrayGetValueAtIndex(sample_attachments, 0);
depends_on_others = CFDictionaryGetValue(attach, kCMSampleAttachmentKey_DependsOnOthers);
result = depends_on_others == kCFBooleanFalse;
}
return result;
}
-(id)init
{
self = [super init];
av_register_all();
avformat_network_init();
self.is_stopped = YES;
_stream_dispatch = dispatch_queue_create("FFMpeg Stream Dispatch", NULL);
return self;
}
-(bool)stopProcess
{
av_write_trailer(_av_fmt_ctx);
avio_close(_av_fmt_ctx->pb);
self.is_stopped = YES;
_stream_dispatch = nil;
if (_stream_dispatch)
{
NSLog(@"SUSPEND VIDEO DISPATCH");
dispatch_suspend(_stream_dispatch);
_stream_dispatch = nil;
}
return YES;
}
@end

645
CocoaSplit/FilePanel.xib Normal file
View file

@ -0,0 +1,645 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1080</int>
<string key="IBDocument.SystemVersion">12C54</string>
<string key="IBDocument.InterfaceBuilderVersion">2840</string>
<string key="IBDocument.AppKitVersion">1187.34</string>
<string key="IBDocument.HIToolboxVersion">625.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">2840</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBNSLayoutConstraint</string>
<string>NSButton</string>
<string>NSButtonCell</string>
<string>NSCustomObject</string>
<string>NSTextField</string>
<string>NSTextFieldCell</string>
<string>NSView</string>
<string>NSWindowTemplate</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</array>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<object class="NSCustomObject" id="1001">
<string key="NSClassName">CaptureController</string>
</object>
<object class="NSCustomObject" id="1003">
<string key="NSClassName">FirstResponder</string>
</object>
<object class="NSCustomObject" id="1004">
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSWindowTemplate" id="1005">
<int key="NSWindowStyleMask">15</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{196, 240}, {480, 270}}</string>
<int key="NSWTFlags">544735232</int>
<string key="NSWindowTitle">Window</string>
<string key="NSWindowClass">NSWindow</string>
<nil key="NSViewClass"/>
<nil key="NSUserInterfaceItemIdentifier"/>
<object class="NSView" key="NSWindowView" id="1006">
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSTextField" id="1068849641">
<reference key="NSNextResponder" ref="1006"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{17, 231}, {77, 17}}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="210639070"/>
<string key="NSReuseIdentifierKey">_NS:1535</string>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="166425012">
<int key="NSCellFlags">68157504</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents">Destination</string>
<object class="NSFont" key="NSSupport" id="681684912">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">13</double>
<int key="NSfFlags">1044</int>
</object>
<string key="NSCellIdentifier">_NS:1535</string>
<reference key="NSControlView" ref="1068849641"/>
<object class="NSColor" key="NSBackgroundColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
</object>
</object>
<object class="NSColor" key="NSTextColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlTextColor</string>
<object class="NSColor" key="NSColor" id="388656871">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
</object>
</object>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSTextField" id="210639070">
<reference key="NSNextResponder" ref="1006"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{99, 228}, {234, 22}}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="743799799"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="63012868">
<int key="NSCellFlags">-1804599231</int>
<int key="NSCellFlags2">272630784</int>
<string key="NSContents"/>
<reference key="NSSupport" ref="681684912"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="210639070"/>
<bool key="NSDrawsBackground">YES</bool>
<object class="NSColor" key="NSBackgroundColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">textBackgroundColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
</object>
<object class="NSColor" key="NSTextColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">textColor</string>
<reference key="NSColor" ref="388656871"/>
</object>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSButton" id="743799799">
<reference key="NSNextResponder" ref="1006"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{14, 13}, {66, 32}}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="769277665"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="631565598">
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Add</string>
<reference key="NSSupport" ref="681684912"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="743799799"/>
<int key="NSButtonFlags">-2038284288</int>
<int key="NSButtonFlags2">129</int>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSButton" id="769277665">
<reference key="NSNextResponder" ref="1006"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{80, 13}, {82, 32}}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="621576230">
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Cancel</string>
<reference key="NSSupport" ref="681684912"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="769277665"/>
<int key="NSButtonFlags">-2038284288</int>
<int key="NSButtonFlags2">129</int>
<string key="NSAlternateContents"/>
<string type="base64-UTF8" key="NSKeyEquivalent">Gw</string>
<int key="NSPeriodicDelay">200</int>
<int key="NSPeriodicInterval">25</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
</array>
<string key="NSFrameSize">{480, 270}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="1068849641"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
<string key="NSMaxSize">{10000000000000, 10000000000000}</string>
<bool key="NSWindowIsRestorable">YES</bool>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<array class="NSMutableArray" key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">addStreamingService:</string>
<reference key="source" ref="1001"/>
<reference key="destination" ref="743799799"/>
</object>
<int key="connectionID">25</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">closeCreateSheet:</string>
<reference key="source" ref="1001"/>
<reference key="destination" ref="769277665"/>
</object>
<int key="connectionID">26</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">createSheet</string>
<reference key="source" ref="1001"/>
<reference key="destination" ref="1005"/>
</object>
<int key="connectionID">30</int>
</object>
<object class="IBConnectionRecord">
<object class="IBBindingConnection" key="connection">
<string key="label">value: streamingDestination</string>
<reference key="source" ref="210639070"/>
<reference key="destination" ref="1001"/>
<object class="NSNibBindingConnector" key="connector">
<reference key="NSSource" ref="210639070"/>
<reference key="NSDestination" ref="1001"/>
<string key="NSLabel">value: streamingDestination</string>
<string key="NSBinding">value</string>
<string key="NSKeyPath">streamingDestination</string>
<object class="NSDictionary" key="NSOptions">
<string key="NS.key.0">NSContinuouslyUpdatesValue</string>
<boolean value="YES" key="NS.object.0"/>
</object>
<int key="NSNibBindingConnectorVersion">2</int>
</object>
</object>
<int key="connectionID">32</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
<object class="IBObjectRecord">
<int key="objectID">0</int>
<array key="object" id="0"/>
<reference key="children" ref="1000"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="1001"/>
<reference key="parent" ref="0"/>
<string key="objectName">File's Owner</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="1003"/>
<reference key="parent" ref="0"/>
<string key="objectName">First Responder</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">-3</int>
<reference key="object" ref="1004"/>
<reference key="parent" ref="0"/>
<string key="objectName">Application</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">1</int>
<reference key="object" ref="1005"/>
<array class="NSMutableArray" key="children">
<reference ref="1006"/>
</array>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">2</int>
<reference key="object" ref="1006"/>
<array class="NSMutableArray" key="children">
<object class="IBNSLayoutConstraint" id="316312857">
<reference key="firstItem" ref="769277665"/>
<int key="firstAttribute">5</int>
<int key="relation">0</int>
<reference key="secondItem" ref="743799799"/>
<int key="secondAttribute">6</int>
<float key="multiplier">1</float>
<object class="IBNSLayoutSymbolicConstant" key="constant">
<double key="value">12</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="1006"/>
<int key="scoringType">6</int>
<float key="scoringTypeFloat">24</float>
<int key="contentType">3</int>
</object>
<object class="IBNSLayoutConstraint" id="948434483">
<reference key="firstItem" ref="1006"/>
<int key="firstAttribute">4</int>
<int key="relation">0</int>
<reference key="secondItem" ref="769277665"/>
<int key="secondAttribute">4</int>
<float key="multiplier">1</float>
<object class="IBNSLayoutSymbolicConstant" key="constant">
<double key="value">20</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="1006"/>
<int key="scoringType">8</int>
<float key="scoringTypeFloat">29</float>
<int key="contentType">3</int>
</object>
<object class="IBNSLayoutConstraint" id="863223193">
<reference key="firstItem" ref="743799799"/>
<int key="firstAttribute">5</int>
<int key="relation">0</int>
<reference key="secondItem" ref="1006"/>
<int key="secondAttribute">5</int>
<float key="multiplier">1</float>
<object class="IBNSLayoutSymbolicConstant" key="constant">
<double key="value">20</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="1006"/>
<int key="scoringType">8</int>
<float key="scoringTypeFloat">29</float>
<int key="contentType">3</int>
</object>
<object class="IBNSLayoutConstraint" id="248946951">
<reference key="firstItem" ref="1006"/>
<int key="firstAttribute">4</int>
<int key="relation">0</int>
<reference key="secondItem" ref="743799799"/>
<int key="secondAttribute">4</int>
<float key="multiplier">1</float>
<object class="IBNSLayoutSymbolicConstant" key="constant">
<double key="value">20</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="1006"/>
<int key="scoringType">8</int>
<float key="scoringTypeFloat">29</float>
<int key="contentType">3</int>
</object>
<object class="IBNSLayoutConstraint" id="593627117">
<reference key="firstItem" ref="210639070"/>
<int key="firstAttribute">5</int>
<int key="relation">0</int>
<reference key="secondItem" ref="1068849641"/>
<int key="secondAttribute">6</int>
<float key="multiplier">1</float>
<object class="IBNSLayoutSymbolicConstant" key="constant">
<double key="value">8</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="1006"/>
<int key="scoringType">6</int>
<float key="scoringTypeFloat">24</float>
<int key="contentType">3</int>
</object>
<object class="IBNSLayoutConstraint" id="240405173">
<reference key="firstItem" ref="210639070"/>
<int key="firstAttribute">3</int>
<int key="relation">0</int>
<reference key="secondItem" ref="1006"/>
<int key="secondAttribute">3</int>
<float key="multiplier">1</float>
<object class="IBNSLayoutSymbolicConstant" key="constant">
<double key="value">20</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="1006"/>
<int key="scoringType">8</int>
<float key="scoringTypeFloat">29</float>
<int key="contentType">3</int>
</object>
<object class="IBNSLayoutConstraint" id="417585144">
<reference key="firstItem" ref="1068849641"/>
<int key="firstAttribute">10</int>
<int key="relation">0</int>
<reference key="secondItem" ref="210639070"/>
<int key="secondAttribute">10</int>
<float key="multiplier">1</float>
<object class="IBLayoutConstant" key="constant">
<double key="value">0.0</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="1006"/>
<int key="scoringType">6</int>
<float key="scoringTypeFloat">24</float>
<int key="contentType">2</int>
</object>
<object class="IBNSLayoutConstraint" id="84164022">
<reference key="firstItem" ref="1068849641"/>
<int key="firstAttribute">5</int>
<int key="relation">0</int>
<reference key="secondItem" ref="1006"/>
<int key="secondAttribute">5</int>
<float key="multiplier">1</float>
<object class="IBNSLayoutSymbolicConstant" key="constant">
<double key="value">20</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="1006"/>
<int key="scoringType">8</int>
<float key="scoringTypeFloat">29</float>
<int key="contentType">3</int>
</object>
<reference ref="210639070"/>
<reference ref="1068849641"/>
<reference ref="743799799"/>
<reference ref="769277665"/>
</array>
<reference key="parent" ref="1005"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">3</int>
<reference key="object" ref="1068849641"/>
<array class="NSMutableArray" key="children">
<reference ref="166425012"/>
</array>
<reference key="parent" ref="1006"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">4</int>
<reference key="object" ref="166425012"/>
<reference key="parent" ref="1068849641"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">6</int>
<reference key="object" ref="84164022"/>
<reference key="parent" ref="1006"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">7</int>
<reference key="object" ref="210639070"/>
<array class="NSMutableArray" key="children">
<reference ref="63012868"/>
<object class="IBNSLayoutConstraint" id="281020541">
<reference key="firstItem" ref="210639070"/>
<int key="firstAttribute">7</int>
<int key="relation">0</int>
<nil key="secondItem"/>
<int key="secondAttribute">0</int>
<float key="multiplier">1</float>
<object class="IBLayoutConstant" key="constant">
<double key="value">234</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="210639070"/>
<int key="scoringType">3</int>
<float key="scoringTypeFloat">9</float>
<int key="contentType">1</int>
</object>
</array>
<reference key="parent" ref="1006"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">8</int>
<reference key="object" ref="63012868"/>
<reference key="parent" ref="210639070"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">13</int>
<reference key="object" ref="240405173"/>
<reference key="parent" ref="1006"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">14</int>
<reference key="object" ref="593627117"/>
<reference key="parent" ref="1006"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">15</int>
<reference key="object" ref="417585144"/>
<reference key="parent" ref="1006"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">16</int>
<reference key="object" ref="281020541"/>
<reference key="parent" ref="210639070"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">17</int>
<reference key="object" ref="743799799"/>
<array class="NSMutableArray" key="children">
<reference ref="631565598"/>
</array>
<reference key="parent" ref="1006"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">18</int>
<reference key="object" ref="631565598"/>
<reference key="parent" ref="743799799"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">19</int>
<reference key="object" ref="248946951"/>
<reference key="parent" ref="1006"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">20</int>
<reference key="object" ref="863223193"/>
<reference key="parent" ref="1006"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">21</int>
<reference key="object" ref="769277665"/>
<array class="NSMutableArray" key="children">
<reference ref="621576230"/>
</array>
<reference key="parent" ref="1006"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">22</int>
<reference key="object" ref="621576230"/>
<reference key="parent" ref="769277665"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">23</int>
<reference key="object" ref="948434483"/>
<reference key="parent" ref="1006"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">24</int>
<reference key="object" ref="316312857"/>
<reference key="parent" ref="1006"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="-3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="1.IBWindowTemplateEditedContentRect">{{357, 418}, {480, 270}}</string>
<boolean value="NO" key="1.NSWindowTemplate.visibleAtLaunch"/>
<string key="13.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="14.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="15.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="16.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="17.IBNSViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
<string key="17.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="18.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="19.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<array key="2.IBNSViewMetadataConstraints">
<reference ref="84164022"/>
<reference ref="417585144"/>
<reference ref="240405173"/>
<reference ref="593627117"/>
<reference ref="248946951"/>
<reference ref="863223193"/>
<reference ref="948434483"/>
<reference ref="316312857"/>
</array>
<string key="2.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="20.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="21.IBNSViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
<string key="21.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="22.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="23.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="24.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="NO" key="3.IBNSViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
<string key="3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="4.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<array class="NSMutableArray" key="7.IBNSViewMetadataConstraints">
<reference ref="281020541"/>
</array>
<boolean value="NO" key="7.IBNSViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
<string key="7.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="8.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">32</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">CaptureController</string>
<string key="superclassName">NSObject</string>
<dictionary class="NSMutableDictionary" key="actions">
<string key="addStreamingService:">id</string>
<string key="closeCreateSheet:">id</string>
<string key="openCreateSheet:">id</string>
<string key="removeDestination:">id</string>
<string key="streamButtonPushed:">id</string>
<string key="videoRefresh:">id</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="actionInfosByName">
<object class="IBActionInfo" key="addStreamingService:">
<string key="name">addStreamingService:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="closeCreateSheet:">
<string key="name">closeCreateSheet:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="openCreateSheet:">
<string key="name">openCreateSheet:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="removeDestination:">
<string key="name">removeDestination:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="streamButtonPushed:">
<string key="name">streamButtonPushed:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="videoRefresh:">
<string key="name">videoRefresh:</string>
<string key="candidateClassName">id</string>
</object>
</dictionary>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">createSheet</string>
<string key="NS.object.0">NSWindow</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">createSheet</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">createSheet</string>
<string key="candidateClassName">NSWindow</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/CaptureController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSLayoutConstraint</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/NSLayoutConstraint.h</string>
</object>
</object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<bool key="IBDocument.UseAutolayout">YES</bool>
</data>
</archive>

View file

@ -0,0 +1,31 @@
//
// OutputDestination.h
// H264Streamer
//
// Created by Zakk on 9/16/12.
// Copyright (c) 2012 Zakk. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface OutputDestination : NSObject <NSCoding>
{
NSString *_destination;
}
@property (strong) NSString *server_name;
@property (strong) NSString *name;
@property (strong) NSString *type_name;
@property (strong) NSString *destination;
@property (strong) NSString *output_format;
@property (strong) NSString *stream_key;
-(id)initWithType:(NSString *)type;
@end

View file

@ -0,0 +1,100 @@
//
// OutputDestination.m
// H264Streamer
//
// Created by Zakk on 9/16/12.
// Copyright (c) 2012 Zakk. All rights reserved.
//
#import "OutputDestination.h"
@implementation OutputDestination
-(void) encodeWithCoder:(NSCoder *)aCoder
{
[aCoder encodeObject:self.destination forKey:@"destination"];
[aCoder encodeObject:self.name forKey:@"name"];
[aCoder encodeObject:self.type_name forKey:@"type_name"];
[aCoder encodeObject:self.output_format forKey:@"output_format"];
}
-(id) initWithCoder:(NSCoder *)aDecoder
{
if (self = [super init])
{
self.destination = [aDecoder decodeObjectForKey:@"destination"];
self.name = [aDecoder decodeObjectForKey:@"name"];
self.type_name = [aDecoder decodeObjectForKey:@"type_name"];
self.output_format = [aDecoder decodeObjectForKey:@"output_format"];
}
return self;
}
-(id)init
{
return [self initWithType:nil];
}
-(NSString *)destination
{
if (_destination)
return _destination;
if ([_type_name isEqualToString:@"rtmp"])
{
_destination = [NSString stringWithFormat:@"%@/%@", self.server_name, self.stream_key];
}
return _destination;
}
-(void)setDestination:(NSString *)destination
{
NSLog(@"Destination set to %@", destination);
_destination = destination;
}
-(id) initWithType:(NSString *)type
{
if (self = [super init])
{
self.output_format = @"FLV";
self.type_name = type;
if ([type isEqualToString:@"twitchtv"])
{
self.output_format = @"FLV";
self.name = @"Twitch.TV";
}
}
return self;
}
-(NSString *)description
{
return [NSString stringWithFormat:@"Name: %@ Type Name: %@ Destination %@ Key %@", self.name, self.type_name, self.destination, self.stream_key];
}
@end

View file

@ -0,0 +1,24 @@
//
// SyphonCapture.h
// H264Streamer
//
// Created by Zakk on 9/7/12.
// Copyright (c) 2012 Zakk. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <Syphon/Syphon.h>
#import "CaptureSessionProtocol.h"
@interface SyphonCapture : NSObject < CaptureSessionProtocol>
{
int _captureFPS;
NSDictionary *_syphonServer;
id _delegate;
SyphonClient *_syphon_client;
NSOpenGLContext *_cgl_ctx;
}
@end

111
CocoaSplit/SyphonCapture.m Normal file
View file

@ -0,0 +1,111 @@
//
// SyphonCapture.m
// H264Streamer
//
// Created by Zakk on 9/7/12.
// Copyright (c) 2012 Zakk. All rights reserved.
//
#import "SyphonCapture.h"
#import "AbstractCaptureDevice.h"
@implementation SyphonCapture
-(void) setVideoCaptureFPS:(int)fps
{
_captureFPS = fps;
}
-(void) setVideoDelegate:(id)delegate
{
_delegate = delegate;
}
-(bool) setActiveVideoDevice:(id)videoDevice
{
_syphonServer = [videoDevice captureDevice];
return YES;
}
-(bool) setupCaptureSession:(NSError *__autoreleasing *)therror
{
const NSOpenGLPixelFormatAttribute attr[] = {NSOpenGLPFANoRecovery, NSOpenGLPFAAccelerated, NSOpenGLPFADoubleBuffer, 0};
NSOpenGLPixelFormat* fmt = [[NSOpenGLPixelFormat alloc] initWithAttributes:attr];
_cgl_ctx = [[NSOpenGLContext alloc] initWithFormat:fmt shareContext:nil];
return YES;
}
-(bool) startCaptureSession:(NSError *__autoreleasing *)error
{
NSLog(@"SERVER IS %@", _syphonServer);
_syphon_client = [[SyphonClient alloc] initWithServerDescription:_syphonServer options:nil newFrameHandler:^(SyphonClient *client) {
[_cgl_ctx makeCurrentContext];
CGLContextObj cgl_ctx = [_cgl_ctx CGLContextObj];
SyphonImage *myFrame = [client newFrameImageForContext:cgl_ctx];
CVPixelBufferRef pbuff;
int buf_size;
buf_size = myFrame.textureSize.height * myFrame.textureSize.width;
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, myFrame.textureName);
GLuint *buffer = malloc(buf_size*4);
glGetTexImage(GL_TEXTURE_RECTANGLE_ARB, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, buffer);
CVPixelBufferCreateWithBytes(NULL, myFrame.textureSize.width, myFrame.textureSize.height, kCVPixelFormatType_32BGRA, buffer, myFrame.textureSize.width*4, NULL, 0, NULL, &pbuff);
[_delegate captureOutputVideo:self didOutputSampleBuffer:nil didOutputImage:pbuff frameTime:0];
//CVPixelBufferRelease(pbuff);
} ];
return YES;
}
-(bool)providesAudio
{
return NO;
}
-(bool)providesVideo
{
return YES;
}
-(NSArray *)availableVideoDevices
{
NSArray *servers = [[SyphonServerDirectory sharedDirectory] servers];
NSMutableArray *retArr = [[NSMutableArray alloc] init];
id sserv;
NSLog(@"SERVERS %@", servers);
for(sserv in servers)
{
//[retArr addObject:[[AbstractCaptureDevice alloc] initWithName:[sserv objectForKey:SyphonServerDescriptionAppNameKey] device:sserv]];
}
return (NSArray *)retArr;
}
@end

View file

@ -0,0 +1,29 @@
{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;}
{\colortbl;\red255\green255\blue255;}
\paperw9840\paperh8400
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
\f0\b\fs24 \cf0 Engineering:
\b0 \
Some people\
\
\b Human Interface Design:
\b0 \
Some other people\
\
\b Testing:
\b0 \
Hopefully not nobody\
\
\b Documentation:
\b0 \
Whoever\
\
\b With special thanks to:
\b0 \
Mom\
}

View file

@ -0,0 +1,2 @@
/* Localized versions of Info.plist keys */

File diff suppressed because it is too large Load diff

15
CocoaSplit/main.m Normal file
View file

@ -0,0 +1,15 @@
//
// main.m
// H264Streamer
//
// Created by Zakk on 9/2/12.
// Copyright (c) 2012 Zakk. All rights reserved.
//
#import <Cocoa/Cocoa.h>
int main(int argc, char *argv[])
{
signal(SIGPIPE, SIG_IGN);
return NSApplicationMain(argc, (const char **)argv);
}

38
CocoaSplit/usr/bin/2to3 Executable file
View file

@ -0,0 +1,38 @@
#!/usr/bin/python
import sys, os
import glob, re
partA = """\
python version %d.%d.%d can't run %s. Try the alternative(s):
"""
partB = """
Run "man python" for more information about multiple version support in
Mac OS X.
"""
sys.stderr.write(partA % (sys.version_info[:3] + (sys.argv[0],)))
dir, base = os.path.split(sys.argv[0])
specialcase = (base == 'python-config')
if specialcase:
pat = "python*-config"
else:
pat = base + '*'
g = glob.glob(os.path.join(dir, pat))
# match a single digit, dot and possibly multiple digits, because we might
# have 2to32.6, where the program is 2to3 and the version is 2.6.
vpat = re.compile("\d\.\d+")
n = 0
for i in g:
vers = vpat.search(i)
if vers is None:
continue
sys.stderr.write("%s (uses python %s)\n" % (i, i[vers.start():vers.end()]))
n = 1
if n == 0:
sys.stderr.write("(Error: no alternatives found)\n")
sys.stderr.write(partB)
sys.exit(1)

38
CocoaSplit/usr/bin/2to3- Executable file
View file

@ -0,0 +1,38 @@
#!/usr/bin/python
import sys, os
import glob, re
partA = """\
python version %d.%d.%d can't run %s. Try the alternative(s):
"""
partB = """
Run "man python" for more information about multiple version support in
Mac OS X.
"""
sys.stderr.write(partA % (sys.version_info[:3] + (sys.argv[0],)))
dir, base = os.path.split(sys.argv[0])
specialcase = (base == 'python-config')
if specialcase:
pat = "python*-config"
else:
pat = base + '*'
g = glob.glob(os.path.join(dir, pat))
# match a single digit, dot and possibly multiple digits, because we might
# have 2to32.6, where the program is 2to3 and the version is 2.6.
vpat = re.compile("\d\.\d+")
n = 0
for i in g:
vers = vpat.search(i)
if vers is None:
continue
sys.stderr.write("%s (uses python %s)\n" % (i, i[vers.start():vers.end()]))
n = 1
if n == 0:
sys.stderr.write("(Error: no alternatives found)\n")
sys.stderr.write(partB)
sys.exit(1)

1
CocoaSplit/usr/bin/2to3-2.7 Symbolic link
View file

@ -0,0 +1 @@
../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/2to3-2.7

1
CocoaSplit/usr/bin/2to32.6 Symbolic link
View file

@ -0,0 +1 @@
../../System/Library/Frameworks/Python.framework/Versions/2.6/bin/2to32.6

BIN
CocoaSplit/usr/bin/BuildStrings Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/CpMac Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/DeRez Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/GetFileInfo Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/a2p Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/a2p5.10 Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/a2p5.12 Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/addftinfo Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/afclip Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/afconvert Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/afhash Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/afinfo Executable file

Binary file not shown.

6566
CocoaSplit/usr/bin/afmtodit Executable file

File diff suppressed because it is too large Load diff

BIN
CocoaSplit/usr/bin/afplay Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/agentxtrap Executable file

Binary file not shown.

1
CocoaSplit/usr/bin/agvtool Symbolic link
View file

@ -0,0 +1 @@
xcrun

4
CocoaSplit/usr/bin/alias Executable file
View file

@ -0,0 +1,4 @@
#!/bin/sh
# $FreeBSD: src/usr.bin/alias/generic.sh,v 1.2 2005/10/24 22:32:19 cperciva Exp $
# This file is in the public domain.
builtin `echo ${0##*/} | tr \[:upper:] \[:lower:]` ${1+"$@"}

BIN
CocoaSplit/usr/bin/allmemory Executable file

Binary file not shown.

1
CocoaSplit/usr/bin/ant Symbolic link
View file

@ -0,0 +1 @@
/usr/share/ant/bin/ant

BIN
CocoaSplit/usr/bin/applesingle Executable file

Binary file not shown.

View file

@ -0,0 +1 @@
/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/appletviewer

BIN
CocoaSplit/usr/bin/apply Executable file

Binary file not shown.

251
CocoaSplit/usr/bin/apr-1-config Executable file
View file

@ -0,0 +1,251 @@
#!/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# APR script designed to allow easy command line access to APR configuration
# parameters.
APR_MAJOR_VERSION="1"
APR_DOTTED_VERSION="1.4.5"
prefix="/usr"
exec_prefix="${prefix}"
bindir="${exec_prefix}/bin"
libdir="${exec_prefix}/lib"
datarootdir="${prefix}"
datadir="${prefix}"
installbuilddir="${prefix}/share/apr-1/build-1"
includedir="${prefix}/include/apr-${APR_MAJOR_VERSION}"
CC="/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/usr/bin/cc"
CPP="/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/usr/bin/cc -E"
SHELL="/bin/sh"
CPPFLAGS="-DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK"
CFLAGS=""
LDFLAGS=""
LIBS="-lpthread"
EXTRA_INCLUDES=""
SHLIBPATH_VAR="DYLD_LIBRARY_PATH"
APR_SOURCE_DIR="/SourceCache/apr/apr-29.1/apr/apr"
APR_BUILD_DIR="/private/var/tmp/apr/apr-29.1~101/apr"
APR_SO_EXT="lo"
APR_LIB_TARGET="-rpath \$(libdir) \$(OBJECTS)"
APR_LIBNAME="apr-${APR_MAJOR_VERSION}"
# NOTE: the following line is modified during 'make install': alter with care!
location=installed
show_usage()
{
cat << EOF
Usage: apr-$APR_MAJOR_VERSION-config [OPTION]
Known values for OPTION are:
--prefix[=DIR] change prefix to DIR
--bindir print location where binaries are installed
--includedir print location where headers are installed
--cc print C compiler name
--cpp print C preprocessor name and any required options
--cflags print C compiler flags
--cppflags print C preprocessor flags
--includes print include information
--ldflags print linker flags
--libs print additional libraries to link against
--srcdir print APR source directory
--installbuilddir print APR build helper directory
--link-ld print link switch(es) for linking to APR
--link-libtool print the libtool inputs for linking to APR
--shlib-path-var print the name of the shared library path env var
--apr-la-file print the path to the .la file, if available
--apr-so-ext print the extensions of shared objects on this platform
--apr-lib-target print the libtool target information
--apr-libtool print the path to APR's libtool
--version print the APR's version as a dotted triple
--help print this help
When linking with libtool, an application should do something like:
APR_LIBS="\`apr-$APR_MAJOR_VERSION-config --link-libtool --libs\`"
or when linking directly:
APR_LIBS="\`apr-$APR_MAJOR_VERSION-config --link-ld --libs\`"
An application should use the results of --cflags, --cppflags, --includes,
and --ldflags in their build process.
EOF
}
if test $# -eq 0; then
show_usage
exit 1
fi
if test "$location" = "installed"; then
LA_FILE="$libdir/lib${APR_LIBNAME}.la"
else
LA_FILE="$APR_BUILD_DIR/lib${APR_LIBNAME}.la"
fi
flags=""
while test $# -gt 0; do
# Normalize the prefix.
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case "$1" in
# It is possible for the user to override our prefix.
--prefix=*)
prefix=$optarg
;;
--prefix)
echo $prefix
exit 0
;;
--bindir)
echo $bindir
exit 0
;;
--includedir)
if test "$location" = "installed"; then
flags="$includedir"
elif test "$location" = "source"; then
flags="$APR_SOURCE_DIR/include"
else
# this is for VPATH builds
flags="$APR_BUILD_DIR/include $APR_SOURCE_DIR/include"
fi
echo $flags
exit 0
;;
--cc)
echo $CC
exit 0
;;
--cpp)
echo $CPP
exit 0
;;
--cflags)
flags="$flags $CFLAGS"
;;
--cppflags)
flags="$flags $CPPFLAGS"
;;
--libs)
flags="$flags $LIBS"
;;
--ldflags)
flags="$flags $LDFLAGS"
;;
--includes)
if test "$location" = "installed"; then
flags="$flags -I$includedir $EXTRA_INCLUDES"
elif test "$location" = "source"; then
flags="$flags -I$APR_SOURCE_DIR/include $EXTRA_INCLUDES"
else
# this is for VPATH builds
flags="$flags -I$APR_BUILD_DIR/include -I$APR_SOURCE_DIR/include $EXTRA_INCLUDES"
fi
;;
--srcdir)
echo $APR_SOURCE_DIR
exit 0
;;
--installbuilddir)
if test "$location" = "installed"; then
echo "${installbuilddir}"
elif test "$location" = "source"; then
echo "$APR_SOURCE_DIR/build"
else
# this is for VPATH builds
echo "$APR_BUILD_DIR/build"
fi
exit 0
;;
--version)
echo $APR_DOTTED_VERSION
exit 0
;;
--link-ld)
if test "$location" = "installed"; then
### avoid using -L if libdir is a "standard" location like /usr/lib
flags="$flags -L$libdir -l${APR_LIBNAME}"
else
### this surely can't work since the library is in .libs?
flags="$flags -L$APR_BUILD_DIR -l${APR_LIBNAME}"
fi
;;
--link-libtool)
# If the LA_FILE exists where we think it should be, use it. If we're
# installed and the LA_FILE does not exist, assume to use -L/-l
# (the LA_FILE may not have been installed). If we're building ourselves,
# we'll assume that at some point the .la file be created.
if test -f "$LA_FILE"; then
flags="$flags $LA_FILE"
elif test "$location" = "installed"; then
### avoid using -L if libdir is a "standard" location like /usr/lib
# Since the user is specifying they are linking with libtool, we
# *know* that -R will be recognized by libtool.
flags="$flags -L$libdir -R$libdir -l${APR_LIBNAME}"
else
flags="$flags $LA_FILE"
fi
;;
--shlib-path-var)
echo "$SHLIBPATH_VAR"
exit 0
;;
--apr-la-file)
if test -f "$LA_FILE"; then
flags="$flags $LA_FILE"
fi
;;
--apr-so-ext)
echo "$APR_SO_EXT"
exit 0
;;
--apr-lib-target)
echo "$APR_LIB_TARGET"
exit 0
;;
--apr-libtool)
if test "$location" = "installed"; then
echo "${installbuilddir}/libtool"
else
echo "$APR_BUILD_DIR/libtool"
fi
exit 0
;;
--help)
show_usage
exit 0
;;
*)
show_usage
exit 1
;;
esac
# Next please.
shift
done
if test -n "$flags"; then
echo "$flags"
fi
exit 0

88
CocoaSplit/usr/bin/apropos Executable file
View file

@ -0,0 +1,88 @@
#!/bin/sh
#
# apropos -- search the whatis database for keywords.
# whatis -- idem, but match only commands (as whole words).
#
# Copyright (c) 1990, 1991, John W. Eaton.
# Copyright (c) 1994-1999, Andries E. Brouwer.
#
# You may distribute under the terms of the GNU General Public
# License as specified in the README file that comes with the man
# distribution.
#
# apropos/whatis-1.5m aeb 2003-08-01 (from man-1.6c)
#
# keep old PATH - 000323 - Bryan Henderson
# also look in /var/cache/man - 030801 - aeb
program=`basename $0`
# When man pages in your favorite locale look to grep like binary files
# (and you use GNU grep) you may want to add the 'a' option to *grepopt1.
aproposgrepopt1='i'
aproposgrepopt2=''
whatisgrepopt1='iw'
whatisgrepopt2=''
grepopt1=$aproposgrepopt1
grepopt2=$aproposgrepopt2
if [ $# = 0 ]
then
echo "usage: $program keyword ..."
exit 1
fi
manpath=`man --path | tr : '\040'`
if [ "$manpath" = "" ]
then
echo "$program: manpath is null"
exit 1
fi
args=
for arg in $*; do
case $arg in
--version|-V|-v)
echo "$program from man-1.6c"
exit 0
;;
--help|-h)
echo "usage: $program keyword ..."
exit 0
;;
-*)
echo "$program: $arg: unknown option"
exit 1
;;
*)
args="$args $arg"
esac
done
while [ "$1" != "" ]
do
found=0
for d in /var/cache/man $manpath /usr/lib
do
if [ -f $d/whatis ]
then
if grep -"$grepopt1" "$grepopt2""$1" $d/whatis
then
found=1
# Some people are satisfied with a single occurrence
# But it is better to give all
# break
fi
fi
done
if [ $found = 0 ]
then
echo "$1: nothing appropriate"
fi
shift
done | eval ${PAGER:-more -E}
exit

1
CocoaSplit/usr/bin/apt Symbolic link
View file

@ -0,0 +1 @@
/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/apt

225
CocoaSplit/usr/bin/apu-1-config Executable file
View file

@ -0,0 +1,225 @@
#!/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# APR-util script designed to allow easy command line access to APR-util
# configuration parameters.
APRUTIL_MAJOR_VERSION="1"
APRUTIL_DOTTED_VERSION="1.3.12"
prefix="/usr"
exec_prefix="${prefix}"
bindir="${exec_prefix}/bin"
libdir="${exec_prefix}/lib"
includedir="${prefix}/include/apr-${APRUTIL_MAJOR_VERSION}"
LIBS="-lexpat -liconv -lsqlite3 -lldap -llber -llber"
INCLUDES=""
LDFLAGS=""
LDAP_LIBS="-lldap -llber -llber"
DBM_LIBS=" "
APRUTIL_LIBNAME="aprutil-${APRUTIL_MAJOR_VERSION}"
APU_SOURCE_DIR="/SourceCache/apr/apr-29.1/apr-util/apr-util"
APU_BUILD_DIR="/private/var/tmp/apr/apr-29.1~101/apr-util"
APR_XML_EXPAT_OLD="@APR_XML_EXPAT_OLD@"
APU_DB_VERSION="0"
# NOTE: the following line is modified during 'make install': alter with care!
location=installed
show_usage()
{
cat << EOF
Usage: apu-$APRUTIL_MAJOR_VERSION-config [OPTION]
Known values for OPTION are:
--prefix[=DIR] change prefix to DIR
--bindir print location where binaries are installed
--includes print include information
--includedir print location where headers are installed
--ldflags print linker flags
--libs print library information
--avoid-ldap do not include ldap library information with --libs
--ldap-libs print additional library information to link with ldap
--avoid-dbm do not include DBM library information with --libs
--dbm-libs print additional library information to link with DBM
--srcdir print APR-util source directory
--link-ld print link switch(es) for linking to APR-util
--link-libtool print the libtool inputs for linking to APR-util
--apu-la-file print the path to the .la file, if available
--old-expat indicate if APR-util was built against an old expat
--db-version print the DB version
--version print APR-util's version as a dotted triple
--help print this help
When linking with libtool, an application should do something like:
APU_LIBS="\`apu-$APRUTIL_MAJOR_VERSION-config --link-libtool --libs\`"
or when linking directly:
APU_LIBS="\`apu-$APRUTIL_MAJOR_VERSION-config --link-ld --libs\`"
An application should use the results of --includes, and --ldflags in
their build process.
EOF
}
if test $# -eq 0; then
show_usage
exit 1
fi
if test "$location" = "installed"; then
LA_FILE="$libdir/lib${APRUTIL_LIBNAME}.la"
LIBS=`echo "$LIBS" | sed -e "s $APU_BUILD_DIR/xml/expat $prefix g" -e "s $prefix/libexpat.la -lexpat g"`
LDFLAGS=`echo "$LDFLAGS" | sed -e "s $APU_BUILD_DIR/xml/expat $prefix g"`
INCLUDES=`echo "$INCLUDES" | sed -e "s $APU_BUILD_DIR/xml/expat $prefix g" -e "s -I$prefix/lib g"`
else
LA_FILE="$APU_BUILD_DIR/lib${APRUTIL_LIBNAME}.la"
fi
flags=""
while test $# -gt 0; do
# Normalize the prefix.
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case "$1" in
# It is possible for the user to override our prefix.
--prefix=*)
prefix=$optarg
;;
--prefix)
echo $prefix
exit 0
;;
--bindir)
echo $bindir
exit 0
;;
--avoid-ldap)
LDAP_LIBS=""
;;
--avoid-dbm)
DBM_LIBS=""
;;
--libs)
flags="$flags $LDAP_LIBS $DBM_LIBS $LIBS"
;;
--ldap-libs)
flags="$flags $LDAP_LIBS"
;;
--dbm-libs)
flags="$flags $DBM_LIBS"
;;
--includedir)
if test "$location" = "installed"; then
flags="$includedir"
elif test "$location" = "source"; then
flags="$APU_SOURCE_DIR/include"
else
# this is for VPATH builds
flags="$APU_BUILD_DIR/include $APU_SOURCE_DIR/include"
fi
echo $flags
exit 0
;;
--includes)
if test "$location" = "installed"; then
flags="$flags -I$includedir $INCLUDES"
elif test "$location" = "source"; then
flags="$flags -I$APU_SOURCE_DIR/include $INCLUDES"
else
# this is for VPATH builds
flags="$flags -I$APU_BUILD_DIR/include -I$APU_SOURCE_DIR/include $INCLUDES"
fi
;;
--ldflags)
flags="$flags $LDFLAGS"
;;
--srcdir)
echo $APU_SOURCE_DIR
exit 0
;;
--version)
echo $APRUTIL_DOTTED_VERSION
exit 0
;;
--link-ld)
if test "$location" = "installed"; then
### avoid using -L if libdir is a "standard" location like /usr/lib
flags="$flags -L$libdir -l$APRUTIL_LIBNAME"
else
flags="$flags -L$APU_BUILD_DIR -l$APRUTIL_LIBNAME"
fi
;;
--link-libtool)
# If the LA_FILE exists where we think it should be, use it. If we're
# installed and the LA_FILE does not exist, assume to use -L/-l
# (the LA_FILE may not have been installed). If we're building ourselves,
# we'll assume that at some point the .la file be created.
if test -f "$LA_FILE"; then
flags="$flags $LA_FILE"
elif test "$location" = "installed"; then
### avoid using -L if libdir is a "standard" location like /usr/lib
# Since the user is specifying they are linking with libtool, we
# *know* that -R will be recognized by libtool.
flags="$flags -L$libdir -R$libdir -l$APRUTIL_LIBNAME"
else
flags="$flags $LA_FILE"
fi
;;
--apu-la-file)
if test -f "$LA_FILE"; then
flags="$flags $LA_FILE"
fi
;;
--old-expat)
if test ! -n "$APR_XML_EXPAT_OLD"; then
echo "no"
else
echo "$APR_XML_EXPAT_OLD"
fi
exit 0
;;
--db-version)
echo $APU_DB_VERSION
exit 0
;;
--help)
show_usage
exit 0
;;
*)
show_usage
exit 1
;;
esac
# Next please.
shift
done
if test -n "$flags"; then
echo "$flags"
fi
exit 0

BIN
CocoaSplit/usr/bin/ar Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/arch Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/as Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/asa Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/asctl Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/at Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/atos Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/atq Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/atrm Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/atsutil Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/automator Executable file

Binary file not shown.

11
CocoaSplit/usr/bin/auval Executable file
View file

@ -0,0 +1,11 @@
#! /bin/sh
if [[ $1 = '-64' ]] ; then
shift
arch -x86_64 /usr/bin/auvaltool "$@"
elif [[ $1 = '-ppc' ]] ; then
shift
arch -ppc /usr/bin/auvaltool "$@"
else
arch -i386 /usr/bin/auvaltool "$@"
fi

BIN
CocoaSplit/usr/bin/auvaltool Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/avconvert Executable file

Binary file not shown.

Binary file not shown.

BIN
CocoaSplit/usr/bin/awk Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/banner Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/base64 Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/basename Executable file

Binary file not shown.

272
CocoaSplit/usr/bin/bashbug Executable file
View file

@ -0,0 +1,272 @@
#!/bin/sh -
#
# bashbug - create a bug report and mail it to the bug address
#
# The bug address depends on the release status of the shell. Versions
# with status `devel', `alpha', `beta', or `rc' mail bug reports to
# chet@cwru.edu and, optionally, to bash-testers@cwru.edu.
# Other versions send mail to bug-bash@gnu.org.
#
# Copyright (C) 1996-2004 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
#
# configuration section:
# these variables are filled in by the make target in Makefile
#
MACHINE="Mac"
OS="Darwin"
CC="gcc"
CFLAGS="Xcode"
RELEASE="3.2"
PATCHLEVEL="48"
RELSTATUS="relase"
MACHTYPE="x86_64-Apple-Darwin"
PATH=/bin:/usr/bin:/usr/local/bin:$PATH
export PATH
# Check if TMPDIR is set, default to /tmp
: ${TMPDIR:=/tmp}
#Securely create a temporary directory for the temporary files
TEMPDIR=$TMPDIR/bbug.$$
(umask 077 && mkdir $TEMPDIR) || {
echo "$0: could not create temporary directory" >&2
exit 1
}
TEMPFILE1=$TEMPDIR/bbug1
TEMPFILE2=$TEMPDIR/bbug2
USAGE="Usage: $0 [--help] [--version] [bug-report-email-address]"
VERSTR="GNU bashbug, version ${RELEASE}.${PATCHLEVEL}-${RELSTATUS}"
do_help= do_version=
while [ $# -gt 0 ]; do
case "$1" in
--help) shift ; do_help=y ;;
--version) shift ; do_version=y ;;
--) shift ; break ;;
-*) echo "bashbug: ${1}: invalid option" >&2
echo "$USAGE" >& 2
exit 2 ;;
*) break ;;
esac
done
if [ -n "$do_version" ]; then
echo "${VERSTR}"
exit 0
fi
if [ -n "$do_help" ]; then
echo "${VERSTR}"
echo "${USAGE}"
echo
cat << HERE_EOF
Bashbug is used to send mail to the Bash maintainers
for when Bash doesn't behave like you'd like, or expect.
Bashbug will start up your editor (as defined by the shell's
EDITOR environment variable) with a preformatted bug report
template for you to fill in. The report will be mailed to the
bash maintainers by default. See the manual for details.
If you invoke bashbug by accident, just quit your editor without
saving any changes to the template, and no bug report will be sent.
HERE_EOF
exit 0
fi
# Figure out how to echo a string without a trailing newline
N=`echo 'hi there\c'`
case "$N" in
*c) n=-n c= ;;
*) n= c='\c' ;;
esac
BASHTESTERS="bash-testers@cwru.edu"
case "$RELSTATUS" in
alpha*|beta*|devel*|rc*) BUGBASH=chet@cwru.edu ;;
*) BUGBASH=bug-bash@gnu.org ;;
esac
case "$RELSTATUS" in
alpha*|beta*|devel*|rc*)
echo "$0: This is a testing release. Would you like your bug report"
echo "$0: to be sent to the bash-testers mailing list?"
echo $n "$0: Send to bash-testers? $c"
read ans
case "$ans" in
y*|Y*) BUGBASH="${BUGBASH},${BASHTESTERS}" ;;
esac ;;
esac
BUGADDR="${1-$BUGBASH}"
if [ -z "$DEFEDITOR" ] && [ -z "$EDITOR" ]; then
if [ -x /usr/bin/editor ]; then
DEFEDITOR=editor
elif [ -x /usr/local/bin/ce ]; then
DEFEDITOR=ce
elif [ -x /usr/local/bin/emacs ]; then
DEFEDITOR=emacs
elif [ -x /usr/contrib/bin/emacs ]; then
DEFEDITOR=emacs
elif [ -x /usr/bin/emacs ]; then
DEFEDITOR=emacs
elif [ -x /usr/bin/xemacs ]; then
DEFEDITOR=xemacs
elif [ -x /usr/contrib/bin/jove ]; then
DEFEDITOR=jove
elif [ -x /usr/local/bin/jove ]; then
DEFEDITOR=jove
elif [ -x /usr/bin/vi ]; then
DEFEDITOR=vi
else
echo "$0: No default editor found: attempting to use vi" >&2
DEFEDITOR=vi
fi
fi
: ${EDITOR=$DEFEDITOR}
: ${USER=${LOGNAME-`whoami`}}
trap 'rm -rf "$TEMPDIR"; exit 1' 1 2 3 13 15
trap 'rm -rf "$TEMPDIR"' 0
UN=
if (uname) >/dev/null 2>&1; then
UN=`uname -a`
fi
if [ -f /usr/lib/sendmail ] ; then
RMAIL="/usr/lib/sendmail"
SMARGS="-i -t"
elif [ -f /usr/sbin/sendmail ] ; then
RMAIL="/usr/sbin/sendmail"
SMARGS="-i -t"
else
RMAIL=rmail
SMARGS="$BUGADDR"
fi
INITIAL_SUBJECT='[50 character or so descriptive subject here (for reference)]'
cat > "$TEMPFILE1" <<EOF
From: ${USER}
To: ${BUGADDR}
Subject: ${INITIAL_SUBJECT}
Configuration Information [Automatically generated, do not change]:
Machine: $MACHINE
OS: $OS
Compiler: $CC
Compilation CFLAGS: $CFLAGS
uname output: $UN
Machine Type: $MACHTYPE
Bash Version: $RELEASE
Patch Level: $PATCHLEVEL
Release Status: $RELSTATUS
Description:
[Detailed description of the problem, suggestion, or complaint.]
Repeat-By:
[Describe the sequence of events that causes the problem
to occur.]
Fix:
[Description of how to fix the problem. If you don't know a
fix for the problem, don't include this section.]
EOF
cp "$TEMPFILE1" "$TEMPFILE2"
chmod u+w "$TEMPFILE1"
trap '' 2 # ignore interrupts while in editor
edstat=1
while [ $edstat -ne 0 ]; do
$EDITOR "$TEMPFILE1"
edstat=$?
if [ $edstat -ne 0 ]; then
echo "$0: editor \`$EDITOR' exited with nonzero status."
echo "$0: Perhaps it was interrupted."
echo "$0: Type \`y' to give up, and lose your bug report;"
echo "$0: type \`n' to re-enter the editor."
echo $n "$0: Do you want to give up? $c"
read ans
case "$ans" in
[Yy]*) exit 1 ;;
esac
continue
fi
# find the subject from the temp file and see if it's been changed
CURR_SUB=`grep '^Subject: ' "$TEMPFILE1" | sed 's|^Subject:[ ]*||' | sed 1q`
case "$CURR_SUB" in
"${INITIAL_SUBJECT}")
echo
echo "$0: You have not changed the subject from the default."
echo "$0: Please use a more descriptive subject header."
echo "$0: Type \`y' to give up, and lose your bug report;"
echo "$0: type \`n' to re-enter the editor."
echo $n "$0: Do you want to give up? $c"
read ans
case "$ans" in
[Yy]*) exit 1 ;;
esac
echo "$0: The editor will be restarted in five seconds."
sleep 5
edstat=1
;;
esac
done
trap 'rm -rf "$TEMPDIR"; exit 1' 2 # restore trap on SIGINT
if cmp -s "$TEMPFILE1" "$TEMPFILE2"
then
echo "File not changed, no bug report submitted."
exit
fi
echo $n "Send bug report? [y/n] $c"
read ans
case "$ans" in
[Nn]*) exit 0 ;;
esac
${RMAIL} $SMARGS < "$TEMPFILE1" || {
cat "$TEMPFILE1" >> $HOME/dead.bashbug
echo "$0: mail failed: report saved in $HOME/dead.bashbug" >&2
}
exit 0

BIN
CocoaSplit/usr/bin/batch Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/bc Executable file

Binary file not shown.

4
CocoaSplit/usr/bin/bg Executable file
View file

@ -0,0 +1,4 @@
#!/bin/sh
# $FreeBSD: src/usr.bin/alias/generic.sh,v 1.2 2005/10/24 22:32:19 cperciva Exp $
# This file is in the public domain.
builtin `echo ${0##*/} | tr \[:upper:] \[:lower:]` ${1+"$@"}

BIN
CocoaSplit/usr/bin/biff Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/binhex Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/bison Executable file

Binary file not shown.

81
CocoaSplit/usr/bin/bitesize.d Executable file
View file

@ -0,0 +1,81 @@
#!/usr/sbin/dtrace -s
/*
* bitesize.d - analyse disk I/O size by process.
* Written using DTrace (Solaris 10 3/05).
*
* This produces a report for the size of disk events caused by
* processes. These are the disk events sent by the block I/O driver.
*
* If applications must use the disks, we generally prefer they do so
* with large I/O sizes.
*
* 18-Feb-2006, ver 1.11
*
* USAGE: bitesize.d # wait several seconds, then hit Ctrl-C
*
* FIELDS:
* PID process ID
* CMD command and argument list
* value size in bytes
* count number of I/O operations
*
* NOTES:
*
* The application may be requesting smaller sized operations, which
* are being rounded up to the nearest sector size or UFS block size.
* To analyse what the application is requesting, DTraceToolkit programs
* such as Proc/fddist may help.
*
* SEE ALSO: seeksize.d, iosnoop
*
* COPYRIGHT: Copyright (c) 2006 Brendan Gregg.
*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at Docs/cddl1.txt
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* CDDL HEADER END
*
* 31-Mar-2004 Brendan Gregg Created this, build 51.
* 10-Oct-2004 " " Rewrote to use the io provider, build 63.
*/
#pragma D option quiet
/*
* Print header
*/
dtrace:::BEGIN
{
printf("Tracing... Hit Ctrl-C to end.\n");
}
/*
* Process io start
*/
io:::start
{
/* fetch details */
this->size = args[0]->b_bcount;
/* store details */
@Size[pid, curpsinfo->pr_psargs] = quantize(this->size);
}
/*
* Print final report
*/
dtrace:::END
{
printf("\n%8s %s\n", "PID", "CMD");
printa("%8d %S\n%@d\n", @Size);
}

BIN
CocoaSplit/usr/bin/bsdtar Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/bspatch Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/bunzip2 Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/bzcat Executable file

Binary file not shown.

1
CocoaSplit/usr/bin/bzcmp Symbolic link
View file

@ -0,0 +1 @@
bzdiff

74
CocoaSplit/usr/bin/bzdiff Executable file
View file

@ -0,0 +1,74 @@
#!/bin/sh
# sh is buggy on RS/6000 AIX 3.2. Replace above line with #!/bin/ksh
# Bzcmp/diff wrapped for bzip2,
# adapted from zdiff by Philippe Troin <phil@fifi.org> for Debian GNU/Linux.
# Bzcmp and bzdiff are used to invoke the cmp or the diff pro-
# gram on compressed files. All options specified are passed
# directly to cmp or diff. If only 1 file is specified, then
# the files compared are file1 and an uncompressed file1.gz.
# If two files are specified, then they are uncompressed (if
# necessary) and fed to cmp or diff. The exit status from cmp
# or diff is preserved.
PATH="/usr/bin:/bin:$PATH"; export PATH
prog=`echo $0 | sed 's|.*/||'`
case "$prog" in
*cmp) comp=${CMP-cmp} ;;
*) comp=${DIFF-diff} ;;
esac
OPTIONS=
for ARG
do
case "$ARG" in
-*) OPTIONS="$OPTIONS $ARG"; shift;;
*) break;;
esac
done
if [ $# -eq 0 ] || [ $# -gt 2 ]; then
echo "Usage: $prog [${comp}_options] file [file]"
exit 1
fi
if [ ! -f "$1" ]; then
echo "${prog}: $1 not found or not a regular file"
exit 1
fi
if [ $# -eq 2 ] && [ ! -f "$2" ]; then
echo "${prog}: $2 not found or not a regular file"
exit 1
fi
tmp=`mktemp ${TMPDIR:-/tmp}/bzdiff.XXXXXXXXXX` || {
echo 'cannot create a temporary file' >&2
exit 1
}
if test $# -eq 1; then
FILE=`echo "$1" | sed 's/.bz2$//'`
bzip2 -cd "$FILE.bz2" | $comp $OPTIONS - "$FILE"
STAT="$?"
elif test $# -eq 2; then
case "$1" in
*.bz2)
case "$2" in
*.bz2)
F=`echo "$2" | sed 's|.*/||;s|.bz2$||'`
bzip2 -cdfq "$2" > $tmp
bzip2 -cdfq "$1" | $comp $OPTIONS - $tmp
STAT="$?"
/bin/rm -f $tmp;;
*) bzip2 -cdfq "$1" | $comp $OPTIONS - "$2"
STAT="$?";;
esac;;
*) case "$2" in
*.bz2)
bzip2 -cdfq "$2" | $comp $OPTIONS "$1" -
STAT="$?";;
*) $comp $OPTIONS "$1" "$2"
STAT="$?";;
esac;;
esac
exit "$STAT"
fi

BIN
CocoaSplit/usr/bin/bzegrep Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/bzfgrep Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/bzgrep Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/bzip2 Executable file

Binary file not shown.

BIN
CocoaSplit/usr/bin/bzip2recover Executable file

Binary file not shown.

1
CocoaSplit/usr/bin/bzless Symbolic link
View file

@ -0,0 +1 @@
bzmore

61
CocoaSplit/usr/bin/bzmore Executable file
View file

@ -0,0 +1,61 @@
#!/bin/sh
# Bzmore wrapped for bzip2,
# adapted from zmore by Philippe Troin <phil@fifi.org> for Debian GNU/Linux.
PATH="/usr/bin:$PATH"; export PATH
prog=`echo $0 | sed 's|.*/||'`
case "$prog" in
*less) more=less ;;
*) more=more ;;
esac
if test "`echo -n a`" = "-n a"; then
# looks like a SysV system:
n1=''; n2='\c'
else
n1='-n'; n2=''
fi
oldtty=`stty -g 2>/dev/null`
if stty -cbreak 2>/dev/null; then
cb='cbreak'; ncb='-cbreak'
else
# 'stty min 1' resets eof to ^a on both SunOS and SysV!
cb='min 1 -icanon'; ncb='icanon eof ^d'
fi
if test $? -eq 0 -a -n "$oldtty"; then
trap 'stty $oldtty 2>/dev/null; exit' 0 2 3 5 10 13 15
else
trap 'stty $ncb echo 2>/dev/null; exit' 0 2 3 5 10 13 15
fi
if test $# = 0; then
if test -t 0; then
echo usage: $prog files...
else
bzip2 -cdfq | eval $more
fi
else
FIRST=1
for FILE
do
if test $FIRST -eq 0; then
echo $n1 "--More--(Next file: $FILE)$n2"
stty $cb -echo 2>/dev/null
ANS=`dd bs=1 count=1 2>/dev/null`
stty $ncb echo 2>/dev/null
echo " "
if test "$ANS" = 'e' -o "$ANS" = 'q'; then
exit
fi
fi
if test "$ANS" != 's'; then
echo "------> $FILE <------"
bzip2 -cdfq "$FILE" | eval $more
fi
if test -t; then
FIRST=0
fi
done
fi

1
CocoaSplit/usr/bin/c++ Symbolic link
View file

@ -0,0 +1 @@
clang++

BIN
CocoaSplit/usr/bin/c++filt Executable file

Binary file not shown.

32
CocoaSplit/usr/bin/c2ph Executable file
View file

@ -0,0 +1,32 @@
#!/usr/bin/perl
=for comment
The contents of this script should normally never run! The perl wrapper
should pick the correct script in /usr/bin by appending the appropriate version.
You can try appending the appropriate perl version number. See perlmacosx.pod
for more information about multiple version support in Mac OS X.
=cut
use strict;
use Config ();
my @alt = grep {m,^$0\d+\.\d+(?:\.\d+)?$,} glob("$0*");
print STDERR <<"EOF-A";
perl version $Config::Config{version} can't run $0. Try the alternative(s):
EOF-A
if(scalar(@alt) > 0) {
for(@alt) {
my($ver) = /(\d+\.\d+(?:\.\d+)?)/;
print STDERR "$_ (uses perl $ver)\n";
}
} else {
print STDERR "(Error: no alternatives found)\n";
}
die <<'EOF-B';
Run "man perl" for more information about multiple version support in
Mac OS X.
EOF-B

1368
CocoaSplit/usr/bin/c2ph5.10 Executable file

File diff suppressed because it is too large Load diff

1368
CocoaSplit/usr/bin/c2ph5.12 Executable file

File diff suppressed because it is too large Load diff

BIN
CocoaSplit/usr/bin/c89 Executable file

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show more