mirror of
https://github.com/zakk4223/CocoaSplit.git
synced 2026-05-15 14:15:50 -06:00
Drop frames if the compressor queue gets too deep (hardcoded to 10 frames, may make it dynamic later?)
Re-enable proper restoration of audio input source settings (oops) Clear layout source list if a layout recording is stopped and there is no longer a recorder attached to the layout Fix OAuth request percent encoding for auth codes Don't change ffmpeg input source size on input file swap Uninit audio unit with setting input stream format Start of virtual camera plugin (soooooon). Disabled for now Update Youtube output plugin
This commit is contained in:
parent
e97f224814
commit
970bea7db2
18 changed files with 769 additions and 7 deletions
|
|
@ -425,8 +425,10 @@
|
||||||
|
|
||||||
if (use_buf)
|
if (use_buf)
|
||||||
{
|
{
|
||||||
|
if (NSEqualSizes(_lastSize, NSZeroSize))
|
||||||
_lastSize = NSMakeSize(CVPixelBufferGetWidth(use_buf), CVPixelBufferGetHeight(use_buf));
|
{
|
||||||
|
_lastSize = NSMakeSize(CVPixelBufferGetWidth(use_buf), CVPixelBufferGetHeight(use_buf));
|
||||||
|
}
|
||||||
|
|
||||||
if ((cTime - _lastTimeUpdate > 0.5) && self.updateMovieTime)
|
if ((cTime - _lastTimeUpdate > 0.5) && self.updateMovieTime)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -408,6 +408,13 @@
|
||||||
remoteGlobalIDString = 34799CE2243F0F1300B432BB;
|
remoteGlobalIDString = 34799CE2243F0F1300B432BB;
|
||||||
remoteInfo = CSLUTFilter;
|
remoteInfo = CSLUTFilter;
|
||||||
};
|
};
|
||||||
|
34A40731246320D200BD32BB /* PBXContainerItemProxy */ = {
|
||||||
|
isa = PBXContainerItemProxy;
|
||||||
|
containerPortal = 34A40714246320D100BD32BB /* CSVirtualCameraOutput.xcodeproj */;
|
||||||
|
proxyType = 2;
|
||||||
|
remoteGlobalIDString = 34A4070B246320D100BD32BB;
|
||||||
|
remoteInfo = CSVirtualCameraOutput;
|
||||||
|
};
|
||||||
34A7C1A019B9A41A00BC6882 /* PBXContainerItemProxy */ = {
|
34A7C1A019B9A41A00BC6882 /* PBXContainerItemProxy */ = {
|
||||||
isa = PBXContainerItemProxy;
|
isa = PBXContainerItemProxy;
|
||||||
containerPortal = 34A7C19C19B9A41900BC6882 /* CSLayoutSwitcherExtraPlugin.xcodeproj */;
|
containerPortal = 34A7C19C19B9A41900BC6882 /* CSLayoutSwitcherExtraPlugin.xcodeproj */;
|
||||||
|
|
@ -995,6 +1002,7 @@
|
||||||
34A27229205D99D000135A5D /* CSTransitionCollectionItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CSTransitionCollectionItem.h; sourceTree = "<group>"; };
|
34A27229205D99D000135A5D /* CSTransitionCollectionItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CSTransitionCollectionItem.h; sourceTree = "<group>"; };
|
||||||
34A2722A205D99D000135A5D /* CSTransitionCollectionItem.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CSTransitionCollectionItem.m; sourceTree = "<group>"; };
|
34A2722A205D99D000135A5D /* CSTransitionCollectionItem.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CSTransitionCollectionItem.m; sourceTree = "<group>"; };
|
||||||
34A2722B205D99D000135A5D /* CSTransitionCollectionItem.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CSTransitionCollectionItem.xib; sourceTree = "<group>"; };
|
34A2722B205D99D000135A5D /* CSTransitionCollectionItem.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CSTransitionCollectionItem.xib; sourceTree = "<group>"; };
|
||||||
|
34A40714246320D100BD32BB /* CSVirtualCameraOutput.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CSVirtualCameraOutput.xcodeproj; path = StreamServicePlugins/CSVirtualCameraOutput/CSVirtualCameraOutput.xcodeproj; sourceTree = "<group>"; };
|
||||||
34A629431FBB6DC500B4E16A /* CSJSAnimationDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CSJSAnimationDelegate.h; sourceTree = "<group>"; };
|
34A629431FBB6DC500B4E16A /* CSJSAnimationDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CSJSAnimationDelegate.h; sourceTree = "<group>"; };
|
||||||
34A629441FBB6DC500B4E16A /* CSJSAnimationDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CSJSAnimationDelegate.m; sourceTree = "<group>"; };
|
34A629441FBB6DC500B4E16A /* CSJSAnimationDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CSJSAnimationDelegate.m; sourceTree = "<group>"; };
|
||||||
34A6295D1FBB6F0D00B4E16A /* CSJSAnimationDelegateJSExport.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CSJSAnimationDelegateJSExport.h; sourceTree = "<group>"; };
|
34A6295D1FBB6F0D00B4E16A /* CSJSAnimationDelegateJSExport.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CSJSAnimationDelegateJSExport.h; sourceTree = "<group>"; };
|
||||||
|
|
@ -2085,6 +2093,14 @@
|
||||||
path = Interface/TransitionSwitcherView;
|
path = Interface/TransitionSwitcherView;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
|
34A40715246320D100BD32BB /* Products */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
34A40732246320D200BD32BB /* CSVirtualCameraOutput.bundle */,
|
||||||
|
);
|
||||||
|
name = Products;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
34A7C19D19B9A41900BC6882 /* Products */ = {
|
34A7C19D19B9A41900BC6882 /* Products */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
|
@ -2248,6 +2264,7 @@
|
||||||
34AFC2E619B08C1E0007C07B /* StreamServicePlugins */ = {
|
34AFC2E619B08C1E0007C07B /* StreamServicePlugins */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
34A40714246320D100BD32BB /* CSVirtualCameraOutput.xcodeproj */,
|
||||||
344036782080AF71004BC514 /* CSMixerStreamServicePlugin.xcodeproj */,
|
344036782080AF71004BC514 /* CSMixerStreamServicePlugin.xcodeproj */,
|
||||||
34BE2B442014F41300E37382 /* CSNewTekNDIStreamServicePlugin.xcodeproj */,
|
34BE2B442014F41300E37382 /* CSNewTekNDIStreamServicePlugin.xcodeproj */,
|
||||||
3473D2791D4C349700842EEE /* CSVaughnliveStreamServicePlugin.xcodeproj */,
|
3473D2791D4C349700842EEE /* CSVaughnliveStreamServicePlugin.xcodeproj */,
|
||||||
|
|
@ -2652,6 +2669,10 @@
|
||||||
ProductGroup = 3473D27A1D4C349700842EEE /* Products */;
|
ProductGroup = 3473D27A1D4C349700842EEE /* Products */;
|
||||||
ProjectRef = 3473D2791D4C349700842EEE /* CSVaughnliveStreamServicePlugin.xcodeproj */;
|
ProjectRef = 3473D2791D4C349700842EEE /* CSVaughnliveStreamServicePlugin.xcodeproj */;
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
ProductGroup = 34A40715246320D100BD32BB /* Products */;
|
||||||
|
ProjectRef = 34A40714246320D100BD32BB /* CSVirtualCameraOutput.xcodeproj */;
|
||||||
|
},
|
||||||
{
|
{
|
||||||
ProductGroup = 34AFC25519B05B470007C07B /* Products */;
|
ProductGroup = 34AFC25519B05B470007C07B /* Products */;
|
||||||
ProjectRef = 34576C9819AFE6F7007BAD90 /* CSWindowCapturePlugin.xcodeproj */;
|
ProjectRef = 34576C9819AFE6F7007BAD90 /* CSWindowCapturePlugin.xcodeproj */;
|
||||||
|
|
@ -2729,6 +2750,13 @@
|
||||||
remoteRef = 34799CFA243F0F1400B432BB /* PBXContainerItemProxy */;
|
remoteRef = 34799CFA243F0F1400B432BB /* PBXContainerItemProxy */;
|
||||||
sourceTree = BUILT_PRODUCTS_DIR;
|
sourceTree = BUILT_PRODUCTS_DIR;
|
||||||
};
|
};
|
||||||
|
34A40732246320D200BD32BB /* CSVirtualCameraOutput.bundle */ = {
|
||||||
|
isa = PBXReferenceProxy;
|
||||||
|
fileType = wrapper.cfbundle;
|
||||||
|
path = CSVirtualCameraOutput.bundle;
|
||||||
|
remoteRef = 34A40731246320D200BD32BB /* PBXContainerItemProxy */;
|
||||||
|
sourceTree = BUILT_PRODUCTS_DIR;
|
||||||
|
};
|
||||||
34A7C1A119B9A41A00BC6882 /* CSLayoutSwitcherExtraPlugin.bundle */ = {
|
34A7C1A119B9A41A00BC6882 /* CSLayoutSwitcherExtraPlugin.bundle */ = {
|
||||||
isa = PBXReferenceProxy;
|
isa = PBXReferenceProxy;
|
||||||
fileType = wrapper.cfbundle;
|
fileType = wrapper.cfbundle;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,95 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Scheme
|
||||||
|
LastUpgradeVersion = "1120"
|
||||||
|
version = "1.3">
|
||||||
|
<BuildAction
|
||||||
|
parallelizeBuildables = "YES"
|
||||||
|
buildImplicitDependencies = "YES">
|
||||||
|
<BuildActionEntries>
|
||||||
|
<BuildActionEntry
|
||||||
|
buildForTesting = "YES"
|
||||||
|
buildForRunning = "YES"
|
||||||
|
buildForProfiling = "YES"
|
||||||
|
buildForArchiving = "YES"
|
||||||
|
buildForAnalyzing = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "340FE49C15F3417E00E4CE4E"
|
||||||
|
BuildableName = "CocoaSplit.app"
|
||||||
|
BlueprintName = "CocoaSplit"
|
||||||
|
ReferencedContainer = "container:CocoaSplit.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildActionEntry>
|
||||||
|
</BuildActionEntries>
|
||||||
|
</BuildAction>
|
||||||
|
<TestAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||||
|
<MacroExpansion>
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "340FE49C15F3417E00E4CE4E"
|
||||||
|
BuildableName = "CocoaSplit.app"
|
||||||
|
BlueprintName = "CocoaSplit"
|
||||||
|
ReferencedContainer = "container:CocoaSplit.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</MacroExpansion>
|
||||||
|
<Testables>
|
||||||
|
</Testables>
|
||||||
|
</TestAction>
|
||||||
|
<LaunchAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
launchStyle = "0"
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
|
debugDocumentVersioning = "YES"
|
||||||
|
debugServiceExtension = "internal"
|
||||||
|
enableGPUValidationMode = "1"
|
||||||
|
allowLocationSimulation = "YES">
|
||||||
|
<BuildableProductRunnable
|
||||||
|
runnableDebuggingMode = "0">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "340FE49C15F3417E00E4CE4E"
|
||||||
|
BuildableName = "CocoaSplit.app"
|
||||||
|
BlueprintName = "CocoaSplit"
|
||||||
|
ReferencedContainer = "container:CocoaSplit.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
<EnvironmentVariables>
|
||||||
|
<EnvironmentVariable
|
||||||
|
key = "CGBITMAP_CONTEXT_LOG_ERRORS"
|
||||||
|
value = "1"
|
||||||
|
isEnabled = "YES">
|
||||||
|
</EnvironmentVariable>
|
||||||
|
</EnvironmentVariables>
|
||||||
|
</LaunchAction>
|
||||||
|
<ProfileAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||||
|
savedToolIdentifier = ""
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
debugDocumentVersioning = "YES">
|
||||||
|
<BuildableProductRunnable
|
||||||
|
runnableDebuggingMode = "0">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "340FE49C15F3417E00E4CE4E"
|
||||||
|
BuildableName = "CocoaSplit.app"
|
||||||
|
BlueprintName = "CocoaSplit"
|
||||||
|
ReferencedContainer = "container:CocoaSplit.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
</ProfileAction>
|
||||||
|
<AnalyzeAction
|
||||||
|
buildConfiguration = "Debug">
|
||||||
|
</AnalyzeAction>
|
||||||
|
<ArchiveAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
revealArchiveInOrganizer = "YES">
|
||||||
|
</ArchiveAction>
|
||||||
|
</Scheme>
|
||||||
|
|
@ -304,7 +304,7 @@ UInt32 inNumberFrames,
|
||||||
-(bool)setInputStreamFormat:(AVAudioFormat *)format bus:(UInt32)bus
|
-(bool)setInputStreamFormat:(AVAudioFormat *)format bus:(UInt32)bus
|
||||||
{
|
{
|
||||||
|
|
||||||
//AudioUnitUninitialize(self.audioUnit);
|
AudioUnitUninitialize(self.audioUnit);
|
||||||
|
|
||||||
OSStatus err = AudioUnitSetProperty(self.audioUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, bus, format.streamDescription, sizeof(AudioStreamBasicDescription));
|
OSStatus err = AudioUnitSetProperty(self.audioUnit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, bus, format.streamDescription, sizeof(AudioStreamBasicDescription));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -390,7 +390,7 @@
|
||||||
//self.audioVolume = self.audioVolume;
|
//self.audioVolume = self.audioVolume;
|
||||||
if (_savedAudioSettings)
|
if (_savedAudioSettings)
|
||||||
{
|
{
|
||||||
//[self.audioNode restoreDataFromDict:_savedAudioSettings];
|
[self.audioNode restoreDataFromDict:_savedAudioSettings];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -413,7 +413,7 @@ NSString *const kCSOauth2ClientSecret = @"CSOauth2ClientSecret";
|
||||||
request.HTTPMethod = @"POST";
|
request.HTTPMethod = @"POST";
|
||||||
|
|
||||||
NSDictionary *queryDict = @{@"grant_type": @"authorization_code",
|
NSDictionary *queryDict = @{@"grant_type": @"authorization_code",
|
||||||
@"code": forCode,
|
@"code": [forCode stringByRemovingPercentEncoding],
|
||||||
@"redirect_uri": redirectURL,
|
@"redirect_uri": redirectURL,
|
||||||
@"client_id": self.clientID,
|
@"client_id": self.clientID,
|
||||||
@"client_secret": clientSecret };
|
@"client_secret": clientSecret };
|
||||||
|
|
|
||||||
|
|
@ -1376,6 +1376,10 @@ NSString *const CSAppearanceSystem = @"CSAppearanceSystem";
|
||||||
if (useRecorder)
|
if (useRecorder)
|
||||||
{
|
{
|
||||||
[useRecorder stopRecordingForOutput:output];
|
[useRecorder stopRecordingForOutput:output];
|
||||||
|
if (!layout.recorder)
|
||||||
|
{
|
||||||
|
[layout clearSourceList];
|
||||||
|
}
|
||||||
//output.active = NO;
|
//output.active = NO;
|
||||||
if (self.mainLayoutRecorder)
|
if (self.mainLayoutRecorder)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@synchronized (self) {
|
@synchronized (self) {
|
||||||
|
//If the queue is too deep, start dropping old frames
|
||||||
|
if (_compressQueue.count > 10)
|
||||||
|
{
|
||||||
|
CapturedFrameData *dontCare = [self consumeframeData];
|
||||||
|
}
|
||||||
[_compressQueue addObject:frameData];
|
[_compressQueue addObject:frameData];
|
||||||
|
|
||||||
dispatch_semaphore_signal(_queueSemaphore);
|
dispatch_semaphore_signal(_queueSemaphore);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,318 @@
|
||||||
|
// !$*UTF8*$!
|
||||||
|
{
|
||||||
|
archiveVersion = 1;
|
||||||
|
classes = {
|
||||||
|
};
|
||||||
|
objectVersion = 50;
|
||||||
|
objects = {
|
||||||
|
|
||||||
|
/* Begin PBXBuildFile section */
|
||||||
|
34A407382463263F00BD32BB /* CSVirtualCameraDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 34A407372463263F00BD32BB /* CSVirtualCameraDevice.m */; };
|
||||||
|
34A4073B2463274D00BD32BB /* CSVirtualCameraOutput.m in Sources */ = {isa = PBXBuildFile; fileRef = 34A4073A2463274D00BD32BB /* CSVirtualCameraOutput.m */; };
|
||||||
|
34A4073E246327DF00BD32BB /* CSVirtualCameraOutputService.m in Sources */ = {isa = PBXBuildFile; fileRef = 34A4073D246327DF00BD32BB /* CSVirtualCameraOutputService.m */; };
|
||||||
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
|
/* Begin PBXFileReference section */
|
||||||
|
34A4070B246320D100BD32BB /* CSVirtualCameraOutput.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CSVirtualCameraOutput.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
34A4070E246320D100BD32BB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||||
|
34A407362463263F00BD32BB /* CSVirtualCameraDevice.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CSVirtualCameraDevice.h; sourceTree = "<group>"; };
|
||||||
|
34A407372463263F00BD32BB /* CSVirtualCameraDevice.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CSVirtualCameraDevice.m; sourceTree = "<group>"; };
|
||||||
|
34A407392463274D00BD32BB /* CSVirtualCameraOutput.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CSVirtualCameraOutput.h; sourceTree = "<group>"; };
|
||||||
|
34A4073A2463274D00BD32BB /* CSVirtualCameraOutput.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CSVirtualCameraOutput.m; sourceTree = "<group>"; };
|
||||||
|
34A4073C246327DF00BD32BB /* CSVirtualCameraOutputService.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CSVirtualCameraOutputService.h; sourceTree = "<group>"; };
|
||||||
|
34A4073D246327DF00BD32BB /* CSVirtualCameraOutputService.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CSVirtualCameraOutputService.m; sourceTree = "<group>"; };
|
||||||
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
|
34A40708246320D100BD32BB /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXFrameworksBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXGroup section */
|
||||||
|
34A40702246320D100BD32BB = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
34A4070D246320D100BD32BB /* CSVirtualCameraOutput */,
|
||||||
|
34A4070C246320D100BD32BB /* Products */,
|
||||||
|
);
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
34A4070C246320D100BD32BB /* Products */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
34A4070B246320D100BD32BB /* CSVirtualCameraOutput.bundle */,
|
||||||
|
);
|
||||||
|
name = Products;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
34A4070D246320D100BD32BB /* CSVirtualCameraOutput */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
34A4070E246320D100BD32BB /* Info.plist */,
|
||||||
|
34A407362463263F00BD32BB /* CSVirtualCameraDevice.h */,
|
||||||
|
34A407372463263F00BD32BB /* CSVirtualCameraDevice.m */,
|
||||||
|
34A407392463274D00BD32BB /* CSVirtualCameraOutput.h */,
|
||||||
|
34A4073A2463274D00BD32BB /* CSVirtualCameraOutput.m */,
|
||||||
|
34A4073C246327DF00BD32BB /* CSVirtualCameraOutputService.h */,
|
||||||
|
34A4073D246327DF00BD32BB /* CSVirtualCameraOutputService.m */,
|
||||||
|
);
|
||||||
|
path = CSVirtualCameraOutput;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXGroup section */
|
||||||
|
|
||||||
|
/* Begin PBXNativeTarget section */
|
||||||
|
34A4070A246320D100BD32BB /* CSVirtualCameraOutput */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = 34A40711246320D100BD32BB /* Build configuration list for PBXNativeTarget "CSVirtualCameraOutput" */;
|
||||||
|
buildPhases = (
|
||||||
|
34A40707246320D100BD32BB /* Sources */,
|
||||||
|
34A40708246320D100BD32BB /* Frameworks */,
|
||||||
|
34A40709246320D100BD32BB /* Resources */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
);
|
||||||
|
name = CSVirtualCameraOutput;
|
||||||
|
productName = CSVirtualCameraOutput;
|
||||||
|
productReference = 34A4070B246320D100BD32BB /* CSVirtualCameraOutput.bundle */;
|
||||||
|
productType = "com.apple.product-type.bundle";
|
||||||
|
};
|
||||||
|
/* End PBXNativeTarget section */
|
||||||
|
|
||||||
|
/* Begin PBXProject section */
|
||||||
|
34A40703246320D100BD32BB /* Project object */ = {
|
||||||
|
isa = PBXProject;
|
||||||
|
attributes = {
|
||||||
|
LastUpgradeCheck = 1120;
|
||||||
|
ORGANIZATIONNAME = Zakk;
|
||||||
|
TargetAttributes = {
|
||||||
|
34A4070A246320D100BD32BB = {
|
||||||
|
CreatedOnToolsVersion = 11.2.1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
buildConfigurationList = 34A40706246320D100BD32BB /* Build configuration list for PBXProject "CSVirtualCameraOutput" */;
|
||||||
|
compatibilityVersion = "Xcode 9.3";
|
||||||
|
developmentRegion = en;
|
||||||
|
hasScannedForEncodings = 0;
|
||||||
|
knownRegions = (
|
||||||
|
en,
|
||||||
|
Base,
|
||||||
|
);
|
||||||
|
mainGroup = 34A40702246320D100BD32BB;
|
||||||
|
productRefGroup = 34A4070C246320D100BD32BB /* Products */;
|
||||||
|
projectDirPath = "";
|
||||||
|
projectRoot = "";
|
||||||
|
targets = (
|
||||||
|
34A4070A246320D100BD32BB /* CSVirtualCameraOutput */,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
/* End PBXProject section */
|
||||||
|
|
||||||
|
/* Begin PBXResourcesBuildPhase section */
|
||||||
|
34A40709246320D100BD32BB /* Resources */ = {
|
||||||
|
isa = PBXResourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXResourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
|
34A40707246320D100BD32BB /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
34A4073E246327DF00BD32BB /* CSVirtualCameraOutputService.m in Sources */,
|
||||||
|
34A407382463263F00BD32BB /* CSVirtualCameraDevice.m in Sources */,
|
||||||
|
34A4073B2463274D00BD32BB /* CSVirtualCameraOutput.m in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXSourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin XCBuildConfiguration section */
|
||||||
|
34A4070F246320D100BD32BB /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
ENABLE_TESTABILITY = YES;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
|
GCC_DYNAMIC_NO_PIC = NO;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
|
"DEBUG=1",
|
||||||
|
"$(inherited)",
|
||||||
|
);
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 10.15;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||||
|
MTL_FAST_MATH = YES;
|
||||||
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
|
SDKROOT = macosx;
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
34A40710246320D100BD32BB /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 10.15;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
|
MTL_FAST_MATH = YES;
|
||||||
|
SDKROOT = macosx;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
34A40712246320D100BD32BB /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
|
DEVELOPMENT_TEAM = L3JLUY4S5E;
|
||||||
|
HEADER_SEARCH_PATHS = "$(SRCROOT)/../../CocoaSplit/PluginHeaders";
|
||||||
|
INFOPLIST_FILE = CSVirtualCameraOutput/Info.plist;
|
||||||
|
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
|
||||||
|
OTHER_LDFLAGS = (
|
||||||
|
"-undefined",
|
||||||
|
suppress,
|
||||||
|
"-flat_namespace",
|
||||||
|
);
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = zakk.lol.CSVirtualCameraOutput;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SKIP_INSTALL = YES;
|
||||||
|
WRAPPER_EXTENSION = bundle;
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
34A40713246320D100BD32BB /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
COMBINE_HIDPI_IMAGES = YES;
|
||||||
|
DEVELOPMENT_TEAM = L3JLUY4S5E;
|
||||||
|
HEADER_SEARCH_PATHS = "$(SRCROOT)/../../CocoaSplit/PluginHeaders";
|
||||||
|
INFOPLIST_FILE = CSVirtualCameraOutput/Info.plist;
|
||||||
|
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
|
||||||
|
OTHER_LDFLAGS = (
|
||||||
|
"-undefined",
|
||||||
|
suppress,
|
||||||
|
"-flat_namespace",
|
||||||
|
);
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = zakk.lol.CSVirtualCameraOutput;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SKIP_INSTALL = YES;
|
||||||
|
WRAPPER_EXTENSION = bundle;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
/* End XCBuildConfiguration section */
|
||||||
|
|
||||||
|
/* Begin XCConfigurationList section */
|
||||||
|
34A40706246320D100BD32BB /* Build configuration list for PBXProject "CSVirtualCameraOutput" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
34A4070F246320D100BD32BB /* Debug */,
|
||||||
|
34A40710246320D100BD32BB /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
34A40711246320D100BD32BB /* Build configuration list for PBXNativeTarget "CSVirtualCameraOutput" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
34A40712246320D100BD32BB /* Debug */,
|
||||||
|
34A40713246320D100BD32BB /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
/* End XCConfigurationList section */
|
||||||
|
};
|
||||||
|
rootObject = 34A40703246320D100BD32BB /* Project object */;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
//
|
||||||
|
// CSVirtualCameraDevice.h
|
||||||
|
// CSVirtualCamera
|
||||||
|
//
|
||||||
|
// Created by Zakk on 5/6/20.
|
||||||
|
// Copyright © 2020 Zakk. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import <CoreVideo/CoreVideo.h>
|
||||||
|
#import <IOSurface/IOSurfaceObjC.h>
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
|
||||||
|
@protocol CSVirtualCameraProtocol
|
||||||
|
-(void)publishNewFrame:(NSString *)deviceUUID withIOSurface:(IOSurface *)ioSurface;
|
||||||
|
-(void)createDevice:(NSString *)name withUID:(NSString *)uid withModel:(NSString *)modelName withManufacturer:(NSString *)manufacturer width:(NSUInteger)width height:(NSUInteger)height pixelFormat:(OSType)pixelFormat frameRate:(float) frameRate withReply:(void (^)(NSString *))reply;
|
||||||
|
-(void)destroyDevice:(NSString *)uuid;
|
||||||
|
-(void)setInternalClock:(bool)useClock forDevice:(NSString *)deviceUUID;
|
||||||
|
-(void)setPersistOnDisconnect:(bool)persist forDevice:(NSString *)deviceUUID;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
@interface CSVirtualCameraDevice : NSObject
|
||||||
|
{
|
||||||
|
NSXPCConnection *_XPCconnection;
|
||||||
|
id<CSVirtualCameraProtocol> _assistant;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@property (strong) NSString *name;
|
||||||
|
@property (strong) NSString *deviceUID;
|
||||||
|
@property (strong) NSString *modelName;
|
||||||
|
@property (strong) NSString *manufacturer;
|
||||||
|
@property (assign) float frameRate;
|
||||||
|
@property (assign) UInt32 width;
|
||||||
|
@property (assign) UInt32 height;
|
||||||
|
@property (assign) OSType pixelFormat;
|
||||||
|
@property (assign) bool isReady;
|
||||||
|
@property (assign) bool useInternalClock;
|
||||||
|
@property (assign) bool persistOnDisconnect;
|
||||||
|
|
||||||
|
-(void)createDeviceWithCompletionBlock:(void (^)(void))completionBlock;
|
||||||
|
-(void)destroyDevice;
|
||||||
|
-(void)publishCVPixelBufferFrame:(CVPixelBufferRef)videoFrame;
|
||||||
|
-(void)publishIOSurfaceFrame:(IOSurface *)videoFrame;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|
@ -0,0 +1,118 @@
|
||||||
|
//
|
||||||
|
// CSVirtualCameraDevice.m
|
||||||
|
// CSVirtualCamera
|
||||||
|
//
|
||||||
|
// Created by Zakk on 5/6/20.
|
||||||
|
// Copyright © 2020 Zakk. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "CSVirtualCameraDevice.h"
|
||||||
|
|
||||||
|
@implementation CSVirtualCameraDevice
|
||||||
|
|
||||||
|
@synthesize useInternalClock = _useInternalClock;
|
||||||
|
@synthesize persistOnDisconnect = _persistOnDisconnect;
|
||||||
|
|
||||||
|
|
||||||
|
-(void)connectToAssistant
|
||||||
|
{
|
||||||
|
NSXPCInterface *assistantInterface = [NSXPCInterface interfaceWithProtocol:@protocol(CSVirtualCameraProtocol)];
|
||||||
|
NSXPCConnection *connection = [[NSXPCConnection alloc] initWithMachServiceName:@"com.cocoasplit.vcam.assistant" options:0];
|
||||||
|
[connection setRemoteObjectInterface:assistantInterface];
|
||||||
|
[connection resume];
|
||||||
|
_assistant = [connection remoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) {
|
||||||
|
NSLog(@"Could not connect to remote Assistant");
|
||||||
|
}];
|
||||||
|
_XPCconnection = connection;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
-(void)setPersistOnDisconnect:(bool)persist
|
||||||
|
{
|
||||||
|
_persistOnDisconnect = persist;
|
||||||
|
if (_assistant)
|
||||||
|
{
|
||||||
|
[_assistant setPersistOnDisconnect:persist forDevice:self.deviceUID];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
-(bool)persistOnDisconnect
|
||||||
|
{
|
||||||
|
return _persistOnDisconnect;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-(void)setUseInternalClock:(bool)useClock
|
||||||
|
{
|
||||||
|
_useInternalClock = useClock;
|
||||||
|
if (_assistant)
|
||||||
|
{
|
||||||
|
[_assistant setInternalClock:useClock forDevice:self.deviceUID];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
-(bool)useInternalClock
|
||||||
|
{
|
||||||
|
return _useInternalClock;
|
||||||
|
}
|
||||||
|
|
||||||
|
-(void)createDeviceWithCompletionBlock:(void (^)(void))completionBlock
|
||||||
|
{
|
||||||
|
if (!_assistant)
|
||||||
|
{
|
||||||
|
[self connectToAssistant];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[_assistant createDevice:self.name withUID:self.deviceUID withModel:self.modelName withManufacturer:self.manufacturer width:self.width height:self.height pixelFormat:self.pixelFormat frameRate:self.frameRate withReply:^(NSString * _Nonnull uid) {
|
||||||
|
self.isReady = YES;
|
||||||
|
if (completionBlock)
|
||||||
|
{
|
||||||
|
completionBlock();
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
-(void)destroyDevice
|
||||||
|
{
|
||||||
|
[_assistant destroyDevice:self.deviceUID];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
-(void)publishCVPixelBufferFrame:(CVPixelBufferRef)videoFrame
|
||||||
|
{
|
||||||
|
if (!_assistant)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
IOSurface *bufferSurface = (__bridge IOSurface *)(CVPixelBufferGetIOSurface(videoFrame));
|
||||||
|
|
||||||
|
if (bufferSurface)
|
||||||
|
{
|
||||||
|
[self publishIOSurfaceFrame:bufferSurface];
|
||||||
|
} else {
|
||||||
|
//Supported later
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
-(void)publishIOSurfaceFrame:(IOSurface *)videoFrame
|
||||||
|
{
|
||||||
|
if (!_assistant)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
[_assistant publishNewFrame:self.deviceUID withIOSurface:videoFrame];
|
||||||
|
}
|
||||||
|
|
||||||
|
-(void)dealloc
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
//
|
||||||
|
// CSVirtualCameraOutput.h
|
||||||
|
// CSVirtualCameraOutput
|
||||||
|
//
|
||||||
|
// Created by Zakk on 5/6/20.
|
||||||
|
// Copyright © 2020 Zakk. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import "CSOutputBase.h"
|
||||||
|
#import "CSVirtualCameraDevice.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface CSVirtualCameraOutput : CSOutputBase
|
||||||
|
{
|
||||||
|
CSVirtualCameraDevice *_cameraDevice;
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
//
|
||||||
|
// CSVirtualCameraOutput.m
|
||||||
|
// CSVirtualCameraOutput
|
||||||
|
//
|
||||||
|
// Created by Zakk on 5/6/20.
|
||||||
|
// Copyright © 2020 Zakk. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "CSVirtualCameraOutput.h"
|
||||||
|
|
||||||
|
@implementation CSVirtualCameraOutput
|
||||||
|
|
||||||
|
|
||||||
|
-(bool)queueFramedata:(CapturedFrameData *)frameData
|
||||||
|
{
|
||||||
|
|
||||||
|
CVPixelBufferRef useImage = CMSampleBufferGetImageBuffer(frameData.encodedSampleBuffer);
|
||||||
|
if (!useImage)
|
||||||
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
if (!_cameraDevice)
|
||||||
|
{
|
||||||
|
_cameraDevice = [[CSVirtualCameraDevice alloc] init];
|
||||||
|
_cameraDevice.deviceUID = @"CocoaSplit Test Output";
|
||||||
|
_cameraDevice.frameRate = 60.0f;
|
||||||
|
_cameraDevice.width = CVPixelBufferGetWidth(useImage);
|
||||||
|
_cameraDevice.height = CVPixelBufferGetHeight(useImage);
|
||||||
|
_cameraDevice.name = @"CocoaSplit Test Output";
|
||||||
|
_cameraDevice.pixelFormat = CVPixelBufferGetPixelFormatType(useImage);
|
||||||
|
[_cameraDevice createDeviceWithCompletionBlock:^{
|
||||||
|
_cameraDevice.persistOnDisconnect = NO;
|
||||||
|
}];
|
||||||
|
return NO; //We'll start next frame or so
|
||||||
|
} else if (_cameraDevice.isReady) {
|
||||||
|
[_cameraDevice publishCVPixelBufferFrame:useImage];
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
@end
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
//
|
||||||
|
// CSVirtualCameraOutputService.h
|
||||||
|
// CSVirtualCameraOutput
|
||||||
|
//
|
||||||
|
// Created by Zakk on 5/6/20.
|
||||||
|
// Copyright © 2020 Zakk. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import "CSStreamServiceBase.h"
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
|
@interface CSVirtualCameraOutputService : CSStreamServiceBase
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
NS_ASSUME_NONNULL_END
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
//
|
||||||
|
// CSVirtualCameraOutputService.m
|
||||||
|
// CSVirtualCameraOutput
|
||||||
|
//
|
||||||
|
// Created by Zakk on 5/6/20.
|
||||||
|
// Copyright © 2020 Zakk. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "CSVirtualCameraOutputService.h"
|
||||||
|
#import "CSVirtualCameraOutput.h"
|
||||||
|
|
||||||
|
@implementation CSVirtualCameraOutputService
|
||||||
|
|
||||||
|
+(NSString *)label
|
||||||
|
{
|
||||||
|
return @"Virtual Camera";
|
||||||
|
}
|
||||||
|
|
||||||
|
-(NSObject <CSOutputWriterProtocol> *)createOutput
|
||||||
|
{
|
||||||
|
return [[CSVirtualCameraOutput alloc] init];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
-(NSString *)getServiceDestination
|
||||||
|
{
|
||||||
|
return @"COCOASPLIT";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
<?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>$(DEVELOPMENT_LANGUAGE)</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>$(EXECUTABLE_NAME)</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>$(PRODUCT_NAME)</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>1</string>
|
||||||
|
<key>NSHumanReadableCopyright</key>
|
||||||
|
<string>Copyright © 2020 Zakk. All rights reserved.</string>
|
||||||
|
<key>NSPrincipalClass</key>
|
||||||
|
<string>CSVirtualCameraOutputService</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
|
@ -272,6 +272,7 @@
|
||||||
[self.oauthObject jsonRequest:apiRequest completionHandler:^(id decodedData) {
|
[self.oauthObject jsonRequest:apiRequest completionHandler:^(id decodedData) {
|
||||||
|
|
||||||
NSDictionary *user_response = (NSDictionary *)decodedData;
|
NSDictionary *user_response = (NSDictionary *)decodedData;
|
||||||
|
|
||||||
NSString *account_name = [user_response objectForKey:@"email"];
|
NSString *account_name = [user_response objectForKey:@"email"];
|
||||||
[authenticator saveToKeychain:account_name];
|
[authenticator saveToKeychain:account_name];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,8 @@
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string>CSYoutubeStreamService</string>
|
<string>CSYoutubeStreamService</string>
|
||||||
<key>YoutubeClientID</key>
|
<key>YoutubeClientID</key>
|
||||||
<string>997237227687-ubgm910gsivg6g0v00qgm0sgngq1o0oe.apps.googleusercontent.com</string>
|
<string>963493379025-dhonfmg481m0quul8dbdepfc4954h3lj.apps.googleusercontent.com</string>
|
||||||
<key>YoutubeClientSecret</key>
|
<key>YoutubeClientSecret</key>
|
||||||
<string>xvgH6PQpQkVDCfxNGHvkJiim</string>
|
<string>EUj7vTJl3c7HqWzplbiq9ItB</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue