| 1 | |
|---|
| 2 | #import <Cocoa/Cocoa.h> |
|---|
| 3 | |
|---|
| 4 | #import "FrameReader.h" |
|---|
| 5 | #import "Queue.h" |
|---|
| 6 | #import "QueueController.h" |
|---|
| 7 | #import "SampleCIView.h" |
|---|
| 8 | #import "TargetTransparentWindow.h" |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | @class SampleCIView; |
|---|
| 12 | @class TargetTransparentWindow ; |
|---|
| 13 | @class InOutController ; |
|---|
| 14 | |
|---|
| 15 | @interface MyController : NSObject |
|---|
| 16 | { |
|---|
| 17 | IBOutlet NSTextView *logTextView; |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | IBOutlet id mCaptureTarget; |
|---|
| 21 | IBOutlet id mMovieCaptureWindow; |
|---|
| 22 | IBOutlet id showZoneButton; |
|---|
| 23 | |
|---|
| 24 | IBOutlet id setSizeChoicesBox; |
|---|
| 25 | |
|---|
| 26 | |
|---|
| 27 | NSTimeInterval mStartTime; |
|---|
| 28 | |
|---|
| 29 | NSOpenGLContext* mGLContext; |
|---|
| 30 | NSOpenGLPixelFormat* mGLPixelFormat; |
|---|
| 31 | |
|---|
| 32 | CGRect mDisplayRect; |
|---|
| 33 | CVDisplayLinkRef mDisplayLink; |
|---|
| 34 | |
|---|
| 35 | QueueController * mFrameQueueController; |
|---|
| 36 | FrameReader* mReader; |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | NSPopUpButton *inDataPopB, *inAudioPopB, *inVideoPopB ; |
|---|
| 40 | NSPopUpButton *outDataPopB, *outAudioPopB, *outVideoPopB ; |
|---|
| 41 | |
|---|
| 42 | NSBox *myProjectFieldsBox ; |
|---|
| 43 | NSBox *inVB, *inAB, *inDB, *outVB, *outAB, *outDB ; |
|---|
| 44 | |
|---|
| 45 | IBOutlet NSTextField *serverTF,*loginTF,*passTF; |
|---|
| 46 | IBOutlet NSTextField *projectName,*projectDescr,*projectLocation,*projectAuthor; |
|---|
| 47 | IBOutlet NSTextField *videoinTF,*videooutTF,*audioinTF,*audiooutTF,*datainTF,*dataoutTF; |
|---|
| 48 | |
|---|
| 49 | |
|---|
| 50 | bool showInPreview ; |
|---|
| 51 | IBOutlet SampleCIView* inPreviewView ; |
|---|
| 52 | IBOutlet id startInButton; |
|---|
| 53 | IBOutlet id stopInButton; |
|---|
| 54 | NSTimer *inPreviewTimer; |
|---|
| 55 | |
|---|
| 56 | NSTextField *inIcecastIPTF ; |
|---|
| 57 | bool inListening ; |
|---|
| 58 | int inFramerate ; |
|---|
| 59 | |
|---|
| 60 | IBOutlet id inVideoSettingsButton; |
|---|
| 61 | |
|---|
| 62 | bool videOpened ; |
|---|
| 63 | |
|---|
| 64 | IBOutlet NSTextField *inFramerateDisplayed; |
|---|
| 65 | |
|---|
| 66 | FILE *inoutExchangeFile; |
|---|
| 67 | |
|---|
| 68 | bool showOutPreview ; |
|---|
| 69 | IBOutlet SampleCIView* outPreviewView ; |
|---|
| 70 | IBOutlet id resizeRadio; |
|---|
| 71 | IBOutlet id startOutButton; |
|---|
| 72 | IBOutlet id stopOutButton; |
|---|
| 73 | NSTimer *outPreviewTimer; |
|---|
| 74 | |
|---|
| 75 | IBOutlet NSTextField *outIcecastIPTF, *outIcecastPortTF; |
|---|
| 76 | IBOutlet NSTextField *outIcecastPassword; |
|---|
| 77 | IBOutlet NSTextField *outIcecastUsername; |
|---|
| 78 | |
|---|
| 79 | IBOutlet NSTextField *outBitrateTF, *outQualityTF ; |
|---|
| 80 | |
|---|
| 81 | bool capturing ; |
|---|
| 82 | int totalFrames ; |
|---|
| 83 | |
|---|
| 84 | int outFramerate ; |
|---|
| 85 | int outBitrate ; |
|---|
| 86 | int outQuality ; |
|---|
| 87 | |
|---|
| 88 | NSRect captureRect ; |
|---|
| 89 | bool captureRectChanged ; |
|---|
| 90 | |
|---|
| 91 | int captureRectChangedCompt ; |
|---|
| 92 | |
|---|
| 93 | CVPixelBufferRef localBuff ; |
|---|
| 94 | NSRecursiveLock *lockF ; |
|---|
| 95 | |
|---|
| 96 | IBOutlet NSTextField *outFramerateDisplayed; |
|---|
| 97 | |
|---|
| 98 | |
|---|
| 99 | InOutController *myController ; |
|---|
| 100 | } |
|---|
| 101 | |
|---|
| 102 | - (void)initINOUT ; |
|---|
| 103 | - (void)pLog:(NSString*)inLog ; |
|---|
| 104 | - (IBAction)clearLog:(id)sender; |
|---|
| 105 | |
|---|
| 106 | |
|---|
| 107 | - (IBAction)showInOutWindow:(id)sender; |
|---|
| 108 | - (IBAction)closeInOutWindow:(id)sender; |
|---|
| 109 | |
|---|
| 110 | - (IBAction)showInOutCaptureTarget:(id)sender; |
|---|
| 111 | - (void)setCaptureWindowMode:(BOOL)mode ; |
|---|
| 112 | |
|---|
| 113 | - (CVReturn)displayLinkCallback:(const CVTimeStamp*)timeStamp flagsOut:(CVOptionFlags*)flagsOut; |
|---|
| 114 | |
|---|
| 115 | - (void)updateServerIP:(NSString*)inStr ; |
|---|
| 116 | |
|---|
| 117 | |
|---|
| 118 | - (void)toggleOutPreview:(id)sender; |
|---|
| 119 | - (IBAction)startOutAction:(id)sender; |
|---|
| 120 | - (IBAction)stopOutAction:(id)sender; |
|---|
| 121 | - (IBAction)outFramerateStepper:(id)sender; |
|---|
| 122 | - (IBAction)setSizeAndPosition:(id)sender ; |
|---|
| 123 | |
|---|
| 124 | |
|---|
| 125 | |
|---|
| 126 | |
|---|
| 127 | |
|---|
| 128 | - (void)clearOutDisplay ; |
|---|
| 129 | - (void)startOut ; |
|---|
| 130 | - (void)stopOut ; |
|---|
| 131 | |
|---|
| 132 | - (void)encodeFrame:(CVPixelBufferRef)myBuff ; |
|---|
| 133 | - (void)processImage:(CVPixelBufferRef)imageBuffer ; |
|---|
| 134 | |
|---|
| 135 | |
|---|
| 136 | - (void)startOutTimer:(int)inFramerate ; |
|---|
| 137 | - (void)nextOut:(NSTimer *)timer ; |
|---|
| 138 | - (void)stopOutTimer ; |
|---|
| 139 | |
|---|
| 140 | - (void)newOutFrameProcess ; |
|---|
| 141 | |
|---|
| 142 | |
|---|
| 143 | @end |
|---|
| 144 | |
|---|