Added frame rendering/arrival options to DesktopCapture

This commit is contained in:
Zakk 2015-03-13 19:29:59 -04:00
parent c3a9a55d8c
commit 6bd53f426e
5 changed files with 47 additions and 3 deletions

View file

@ -35,7 +35,7 @@
[aCoder encodeDouble:self.videoCaptureFPS forKey:@"videoCaptureFPS"];
[aCoder encodeBool:self.showCursor forKey:@"showCursor"];
[aCoder encodeBool:self.showClicks forKey:@"showClicks"];
[aCoder encodeInt:self.renderType forKey:@"renderType"];
}
@ -51,6 +51,8 @@
_region_height = [aDecoder decodeIntForKey:@"region_height"];
_x_origin = [aDecoder decodeIntForKey:@"x_origin"];
_y_origin = [aDecoder decodeIntForKey:@"y_origin"];
self.renderType = [aDecoder decodeIntForKey:@"renderType"];
}

View file

@ -12,5 +12,7 @@
@interface DesktopCaptureViewController : NSViewController
@property (weak) DesktopCapture *captureObj;
@property (weak) IBOutlet NSWindow *cropSelectionWindow;
@property (strong) NSDictionary *renderStyleMap;
@property (strong) NSArray *styleSortDescriptors;
@end

View file

@ -21,7 +21,14 @@
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Initialization code here.
self.renderStyleMap = @{@"On Frame Arrival": @(kCSRenderFrameArrived),
@"On Internal Frame Tick": @(kCSRenderOnFrameTick),
@"Asynchronous": @(kCSRenderAsync)
};
self.styleSortDescriptors = @[[[NSSortDescriptor alloc] initWithKey:@"value" ascending:YES]];
}
return self;
}

View file

@ -170,6 +170,34 @@
<binding destination="YxM-Vh-gvX" name="value" keyPath="selection.showClicks" id="pa6-us-tSn"/>
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="gNk-Kw-Fkm">
<rect key="frame" x="18" y="98" width="124" height="14"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Frame Update Method" id="wyI-fm-YYL">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<popUpButton verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="tKi-UE-dlW">
<rect key="frame" x="148" y="93" width="112" height="22"/>
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" controlSize="small" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="1Zz-3P-JWb" id="Hy0-rL-26W">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="smallSystem"/>
<menu key="menu" id="3rW-YA-nQ8">
<items>
<menuItem title="Item 1" state="on" id="1Zz-3P-JWb"/>
<menuItem title="Item 2" id="war-E5-FsC"/>
<menuItem title="Item 3" id="vaO-xA-5Re"/>
</items>
</menu>
</popUpButtonCell>
<connections>
<binding destination="VXd-sk-YZN" name="content" keyPath="arrangedObjects" id="K26-Et-4bz"/>
<binding destination="VXd-sk-YZN" name="contentObjects" keyPath="arrangedObjects.value" previousBinding="K26-Et-4bz" id="5ck-7X-s3E"/>
<binding destination="VXd-sk-YZN" name="contentValues" keyPath="arrangedObjects.key" previousBinding="5ck-7X-s3E" id="H05-IL-2Rq"/>
<binding destination="YxM-Vh-gvX" name="selectedObject" keyPath="selection.self.renderType" previousBinding="H05-IL-2Rq" id="0s9-gw-Vmu"/>
</connections>
</popUpButton>
</subviews>
</customView>
<objectController id="YxM-Vh-gvX" userLabel="DesktopCaptureController">
@ -206,5 +234,11 @@
</constraints>
</view>
</window>
<dictionaryController objectClassName="_NSControllerKeyValuePair" id="VXd-sk-YZN">
<connections>
<binding destination="-2" name="contentDictionary" keyPath="self.renderStyleMap" id="rEF-NI-Jju"/>
<binding destination="-2" name="sortDescriptors" keyPath="self.styleSortDescriptors" id="x7S-Nk-OdT"/>
</connections>
</dictionaryController>
</objects>
</document>

View file

@ -59,7 +59,6 @@
-(void)setActiveVideoDevice:(CSAbstractCaptureDevice *)activeVideoDevice
{
NSLog(@"ACTIVE VIDEO DEVICE SET %@", activeVideoDevice);
_activeVideoDevice = activeVideoDevice;
if (_activeVideoDevice)