diff --git a/CSNDICapturePlugin/CSNDICapturePlugin/CSNDICapture.h b/CSNDICapturePlugin/CSNDICapturePlugin/CSNDICapture.h index 89a314f6..dee630d0 100644 --- a/CSNDICapturePlugin/CSNDICapturePlugin/CSNDICapture.h +++ b/CSNDICapturePlugin/CSNDICapturePlugin/CSNDICapture.h @@ -12,6 +12,7 @@ #import "NDIAudioOutputDelegateProtocol.h" + @interface CSNDICapture : CSCaptureBase { NDIlib_v3 *_ndi_dispatch; diff --git a/CSNDICapturePlugin/CSNDICapturePlugin/CSNDICapture.m b/CSNDICapturePlugin/CSNDICapturePlugin/CSNDICapture.m index 93df643c..95113cc5 100644 --- a/CSNDICapturePlugin/CSNDICapturePlugin/CSNDICapture.m +++ b/CSNDICapturePlugin/CSNDICapturePlugin/CSNDICapture.m @@ -103,7 +103,7 @@ return @"NewTek NDI"; } --(NDIlib_source_t *)current_ndi_sources:(uint32_t *)out_count +-(NDIlib_source_t *)current_ndi_sources:(uint32_t *)out_count asyncBloc:(void (^)(NDIlib_source_t *sources, uint32_t srcCount))asyncBlock { NDIlib_find_instance_t finder = NULL; if (!_ndi_dispatch) @@ -118,6 +118,29 @@ } uint32_t source_count = 0; const NDIlib_source_t *sources = _ndi_dispatch->NDIlib_find_get_current_sources(finder, &source_count); + if (!source_count && asyncBlock) + { + NDIlib_v3 *dispatcher = _ndi_dispatch; + + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + //This is probably a bad idea... + int tryCnt = 0; + while(tryCnt < 10 && dispatcher) + { + uint32_t retry_src_cnt = 0; + dispatcher->NDIlib_find_wait_for_sources(finder, 100); + const NDIlib_source_t *retrySrcs = dispatcher->NDIlib_find_get_current_sources(finder, &retry_src_cnt); + if (retry_src_cnt > 0) + { + asyncBlock(retrySrcs, retry_src_cnt); + break; + } + tryCnt++; + } + }); + sources = _ndi_dispatch->NDIlib_find_get_current_sources(finder, &source_count); + + } *out_count = source_count; return sources; } @@ -128,16 +151,8 @@ uint32_t source_count = 0; - const NDIlib_source_t *sources = [self current_ndi_sources:&source_count]; - - - if (!_ndi_dispatch) - { - return nil; - } - + const NDIlib_source_t *sources = [self current_ndi_sources:&source_count asyncBloc:nil]; NSMutableArray *ret = [NSMutableArray array]; - for (int i=0; i < source_count; i++) { NDIlib_source_t ndi_src = sources[i]; @@ -236,57 +251,82 @@ -(NDIlib_source_t)find_ndi_source:(NSString *)forName { - uint32_t source_count = 0; - const NDIlib_source_t *sources = [self current_ndi_sources:&source_count]; - - for (int i = 0; i < source_count; i++) + if (forName) { - NDIlib_source_t ndi_src = sources[i]; - if (!strncmp(ndi_src.p_ndi_name, forName.UTF8String, strlen(ndi_src.p_ndi_name))) + uint32_t source_count = 0; + const NDIlib_source_t *sources = [self current_ndi_sources:&source_count asyncBloc:nil]; + + for (int i = 0; i < source_count; i++) { - return ndi_src; + NDIlib_source_t ndi_src = sources[i]; + if (!strncmp(ndi_src.p_ndi_name, forName.UTF8String, strlen(ndi_src.p_ndi_name))) + { + return ndi_src; + } } } - return (NDIlib_source_t){0}; } +-(void)setupNdiSource:(CSNDISource *)ndiSource +{ + self.captureName = ndiSource.name; + CSNDIReceiver *newRecv = [[CSNDIReceiver alloc] initWithSource:ndiSource]; + @synchronized(self) + { + if (!_video_thread) + { + _video_thread = dispatch_queue_create("NDI Video Capture Delegate", DISPATCH_QUEUE_SERIAL); + } + + if (!_audio_thread) + { + _audio_thread = dispatch_queue_create("NDI Audio Capture Delegate", DISPATCH_QUEUE_SERIAL); + } + + if (_current_receiver) + { + [_current_receiver stopCapture]; + } + + _current_receiver = newRecv; + [_current_receiver registerVideoDelegate:self withQueue:_video_thread]; + [_current_receiver registerAudioDelegate:self withQueue:_audio_thread]; + [_current_receiver startCapture]; + } + +} + -(void)setActiveVideoDevice:(CSAbstractCaptureDevice *)activeVideoDevice { [super setActiveVideoDevice:activeVideoDevice]; - - CSNDISource *ndiSource = activeVideoDevice.captureDevice; - - if (ndiSource) + if (activeVideoDevice) { - self.captureName = ndiSource.name; + CSNDISource *ndiSource = activeVideoDevice.captureDevice; - CSNDIReceiver *newRecv = [[CSNDIReceiver alloc] initWithSource:ndiSource]; - @synchronized(self) + + if (ndiSource) { - if (!_video_thread) - { - _video_thread = dispatch_queue_create("NDI Video Capture Delegate", DISPATCH_QUEUE_SERIAL); - } - - if (!_audio_thread) - { - _audio_thread = dispatch_queue_create("NDI Audio Capture Delegate", DISPATCH_QUEUE_SERIAL); - } - - if (_current_receiver) - { - [_current_receiver stopCapture]; - } - - _current_receiver = newRecv; - [_current_receiver registerVideoDelegate:self withQueue:_video_thread]; - [_current_receiver registerAudioDelegate:self withQueue:_audio_thread]; - [_current_receiver startCapture]; - + dispatch_async(dispatch_get_main_queue(), ^{ + [self setupNdiSource:ndiSource]; + }); + return; } + } else if (self.savedUniqueID) { + uint32_t srcCnt = 0; + NDIlib_source_t *srcs = [self current_ndi_sources:&srcCnt asyncBloc:^(NDIlib_source_t *sources, uint32_t srcCount) { + NDIlib_source_t ndiSrc = [self find_ndi_source:self.savedUniqueID]; + if (ndiSrc.p_ndi_name) + { + CSNDISource *ndiSource = [[CSNDISource alloc] initWithSource:ndiSrc]; + dispatch_async(dispatch_get_main_queue(), ^{ + [self setDeviceForUniqueID:self.savedUniqueID]; + }); + } + + }]; } } @@ -319,4 +359,5 @@ } + @end diff --git a/CapturePlugins/CSAVFCapturePlugin/CSAVFCapturePlugin/AVFCapture.m b/CapturePlugins/CSAVFCapturePlugin/CSAVFCapturePlugin/AVFCapture.m index b8281896..653ff600 100644 --- a/CapturePlugins/CSAVFCapturePlugin/CSAVFCapturePlugin/AVFCapture.m +++ b/CapturePlugins/CSAVFCapturePlugin/CSAVFCapturePlugin/AVFCapture.m @@ -125,7 +125,6 @@ -(void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; if (_capture_session) { @@ -353,21 +352,6 @@ } --(void)frameTick -{ - - if (self.renderType == kCSRenderOnFrameTick) - { - - [self updateLayersWithBlock:^(CALayer *layer) { - [layer setNeedsDisplay]; - }]; - } - - - -} - -(NSSize)captureSize { diff --git a/CapturePlugins/CSDesktopCapturePlugin/CSDesktopCapturePlugin/DesktopCapture.m b/CapturePlugins/CSDesktopCapturePlugin/CSDesktopCapturePlugin/DesktopCapture.m index 428f01ed..06796ec3 100644 --- a/CapturePlugins/CSDesktopCapturePlugin/CSDesktopCapturePlugin/DesktopCapture.m +++ b/CapturePlugins/CSDesktopCapturePlugin/CSDesktopCapturePlugin/DesktopCapture.m @@ -91,21 +91,6 @@ } --(void)frameTick -{ - - if (self.renderType == kCSRenderOnFrameTick) - { - - /* - [self updateLayersWithBlock:^(CALayer *layer) { - [((CSIOSurfaceLayer *)layer) setNeedsDisplay]; - }];*/ - } - -} - - -(CALayer *)createNewLayer { diff --git a/CocoaSplit/CAMultiAudio/CAMultiAudioPCMPlayer.m b/CocoaSplit/CAMultiAudio/CAMultiAudioPCMPlayer.m index b47c01d8..5e3b24e5 100644 --- a/CocoaSplit/CAMultiAudio/CAMultiAudioPCMPlayer.m +++ b/CocoaSplit/CAMultiAudio/CAMultiAudioPCMPlayer.m @@ -226,7 +226,7 @@ -(void)dealloc { - [self flush]; + //[self flush]; if (_pendingTimer) { dispatch_source_cancel(_pendingTimer); diff --git a/CocoaSplit/CSLayoutRecorder.m b/CocoaSplit/CSLayoutRecorder.m index f37282c7..c89505b4 100644 --- a/CocoaSplit/CSLayoutRecorder.m +++ b/CocoaSplit/CSLayoutRecorder.m @@ -536,7 +536,6 @@ } */ - start_t = [CaptureController.sharedCaptureController mach_time_seconds]; if (newFrame && self.compressors && self.compressors.count > 0) { @@ -565,6 +564,8 @@ newData.videoFrame = newFrame; int used_compressor_count = 0; + start_t = [CaptureController.sharedCaptureController mach_time_seconds]; + NSMutableDictionary *useCompressors = self.compressors.copy; for(id cKey in useCompressors) @@ -573,8 +574,16 @@ id compressor; compressor = useCompressors[cKey]; CapturedFrameData *newFrameData = newData.copy; + double c_start = [CaptureController.sharedCaptureController mach_time_seconds]; [compressor compressFrame:newFrameData]; - + double c_end = [CaptureController.sharedCaptureController mach_time_seconds]; + double c_elapsed = c_end - c_start; + + if (c_elapsed > 1.0f/60.0f) + { + NSLog(@"COMPRESSOR %@ TOOK %f %@", compressor, c_elapsed, self.layout.name); + } + if ([compressor hasOutputs]) { used_compressor_count++; @@ -582,9 +591,9 @@ } end_t = [CaptureController.sharedCaptureController mach_time_seconds]; elapsed_t = end_t - start_t; - //if (elapsed_t > 1.0f/60.0f) + if (elapsed_t > 1.0f/60.0f) { - //NSLog(@"COMPRESSOR STUFF TOOK %f %@", elapsed_t, self.layout.name); + NSLog(@"COMPRESSOR STUFF TOOK %f %@", elapsed_t, self.layout.name); } CVPixelBufferRelease(newFrame); diff --git a/CocoaSplit/CaptureController.m b/CocoaSplit/CaptureController.m index 7da2160f..c4ce10a5 100644 --- a/CocoaSplit/CaptureController.m +++ b/CocoaSplit/CaptureController.m @@ -2622,7 +2622,7 @@ NSString *const CSAppearanceSystem = @"CSAppearanceSystem"; } self.liveLayout.name = @"Live Layout"; self.stagingLayout.name = @"Staging Layout"; - [self.liveLayout restoreSourceList:nil]; + //[self.liveLayout restoreSourceList:nil]; [self setupMainRecorder]; } diff --git a/CocoaSplit/Compressor/AppleVTCompressor.m b/CocoaSplit/Compressor/AppleVTCompressor.m index a6aa25ab..f870c966 100644 --- a/CocoaSplit/Compressor/AppleVTCompressor.m +++ b/CocoaSplit/Compressor/AppleVTCompressor.m @@ -125,7 +125,7 @@ OSStatus VTCompressionSessionCopySupportedPropertyDictionary(VTCompressionSessio { VTSessionSetProperty(session, kVTCompressionPropertyKey_AllowFrameReordering, kCFBooleanFalse); - VTSessionSetProperty(session, (__bridge CFStringRef)@"RealTime", kCFBooleanTrue); + VTSessionSetProperty(session, kVTCompressionPropertyKey_RealTime, kCFBooleanTrue); int real_keyframe_interval = 2; if (self.keyframe_interval && self.keyframe_interval > 0) diff --git a/CocoaSplit/Compressor/AppleVTCompressorBase.m b/CocoaSplit/Compressor/AppleVTCompressorBase.m index 0d3c04ec..d4214681 100644 --- a/CocoaSplit/Compressor/AppleVTCompressorBase.m +++ b/CocoaSplit/Compressor/AppleVTCompressorBase.m @@ -88,7 +88,10 @@ OSStatus VTCompressionSessionCopySupportedPropertyDictionary(VTCompressionSessio } --(void) reset + + + +-(void) internal_reset { _resetPending = YES; @@ -126,7 +129,7 @@ void PixelBufferRelease( void *releaseRefCon, const void *baseAddress ) } --(bool)compressFrame:(CapturedFrameData *)frameData +-(bool)real_compressFrame:(CapturedFrameData *)frameData { if (_resetPending) @@ -193,9 +196,8 @@ void PixelBufferRelease( void *releaseRefCon, const void *baseAddress ) //CVPixelBufferRelease(imageBuffer); - - VTCompressionSessionEncodeFrame(_compression_session, frameData.videoFrame, frameData.videoPTS, frameData.videoDuration, frameProperties, (__bridge_retained void *)(frameData), NULL); + VTCompressionSessionEncodeFrame(_compression_session, frameData.videoFrame, frameData.videoPTS, frameData.videoDuration, frameProperties, (__bridge_retained void *)(frameData), NULL); if (frameProperties) { CFRelease(frameProperties); @@ -207,6 +209,11 @@ void PixelBufferRelease( void *releaseRefCon, const void *baseAddress ) +-(bool)needsSetup +{ + return !_compression_session; +} + - (bool)setupCompressor:(CapturedFrameData *)videoFrame { @@ -286,7 +293,6 @@ void VideoCompressorReceiveFrame(void *VTref, void *VTFrameRef, OSStatus status, //@autoreleasepool { - if(!sampleBuffer) return; diff --git a/CocoaSplit/Compressor/CSPassthroughCompressor.m b/CocoaSplit/Compressor/CSPassthroughCompressor.m index 90bc1a7b..f0e761bc 100644 --- a/CocoaSplit/Compressor/CSPassthroughCompressor.m +++ b/CocoaSplit/Compressor/CSPassthroughCompressor.m @@ -73,7 +73,7 @@ } --(bool)compressFrame:(CapturedFrameData *)imageBuffer +-(bool)real_compressFrame:(CapturedFrameData *)imageBuffer { if (![self hasOutputs]) diff --git a/CocoaSplit/Compressor/CompressorBase.h b/CocoaSplit/Compressor/CompressorBase.h index 20fd15e6..33e3b7c2 100644 --- a/CocoaSplit/Compressor/CompressorBase.h +++ b/CocoaSplit/Compressor/CompressorBase.h @@ -16,6 +16,10 @@ @interface CompressorBase : NSObject { NSMutableArray *_audioBuffer; + bool _reset_flag; + dispatch_queue_t _consumerThread; + NSMutableArray *_compressQueue; + dispatch_semaphore_t _queueSemaphore; } @@ -45,6 +49,8 @@ -(int) drainOutputBufferFrame; -(void) reset; +-(void)reconfigureCompressor; +-(bool)needsSetup; -(BOOL) setupResolution:(CVImageBufferRef)withFrame; -(id )getConfigurationView; diff --git a/CocoaSplit/Compressor/CompressorBase.m b/CocoaSplit/Compressor/CompressorBase.m index 39c94003..95e37407 100644 --- a/CocoaSplit/Compressor/CompressorBase.m +++ b/CocoaSplit/Compressor/CompressorBase.m @@ -16,7 +16,9 @@ { if (self = [super init]) { - + _queueSemaphore = dispatch_semaphore_create(0); + _compressQueue = [NSMutableArray array]; + _reset_flag = NO; self.errored = NO; self.name = [@"" mutableCopy]; @@ -78,6 +80,10 @@ +-(void)internal_reset +{ + [self reset]; +} -(void) reset { @@ -111,10 +117,123 @@ return self; } +-(bool)queueFramedata:(CapturedFrameData *)frameData +{ + if (!_consumerThread) + { + [self startConsumerThread]; + } + + @synchronized (self) { + [_compressQueue addObject:frameData]; + dispatch_semaphore_signal(_queueSemaphore); + } + + return YES; +} + + +-(void)clearFrameQueue +{ + @synchronized (self) { + [_compressQueue removeAllObjects]; + } +} + + +-(CapturedFrameData *)consumeframeData +{ + CapturedFrameData *retData = nil; + @synchronized (self) { + + + if (_compressQueue.count > 0) + { + retData = [_compressQueue objectAtIndex:0]; + [_compressQueue removeObjectAtIndex:0]; + } + } + return retData; +} + + +-(void)startConsumerThread +{ + if (!_consumerThread) + { + _consumerThread = dispatch_queue_create("Compressor consumer", DISPATCH_QUEUE_SERIAL); + dispatch_async(_consumerThread, ^{ + + while (1) + { + @autoreleasepool { + @synchronized (self) { + + if (self->_reset_flag) + { + [self clearFrameQueue]; + [self internal_reset]; + } + } + CapturedFrameData *useData = [self consumeframeData]; + if (!useData) + { + dispatch_semaphore_wait(self->_queueSemaphore, DISPATCH_TIME_FOREVER); + } else { + [self real_compressFrame:useData]; + + } + } + } + }); + } +} --(bool) compressFrame:(CapturedFrameData *)imageBuffer +-(bool)compressFrame:(CapturedFrameData *)frameData +{ + if (![self hasOutputs]) + { + return NO; + } + + + if ([self needsSetup] && !self.errored) + { + BOOL setupOK; + + setupOK = [self setupCompressor:frameData]; + + if (!setupOK) + { + self.errored = YES; + return NO; + } + } + + + + [self reconfigureCompressor]; + + /* + if (frameData.videoFrame) + { + CVPixelBufferRetain(frameData.videoFrame); + }*/ + + [self queueFramedata:frameData]; + return YES; +} + + + +-(void)reconfigureCompressor +{ + return; +} + +-(bool) real_compressFrame:(CapturedFrameData *)imageBuffer { return YES; } diff --git a/CocoaSplit/Compressor/x264Compressor.h b/CocoaSplit/Compressor/x264Compressor.h index b7bee5c8..a729b2b4 100644 --- a/CocoaSplit/Compressor/x264Compressor.h +++ b/CocoaSplit/Compressor/x264Compressor.h @@ -34,10 +34,6 @@ VTPixelTransferSessionRef _vtpt_ref; double _next_keyframe_time; int64_t _last_pts; - bool _reset_flag; - dispatch_queue_t _consumerThread; - NSMutableArray *_compressQueue; - dispatch_semaphore_t _queueSemaphore; CFMutableDictionaryRef _formatExtensions; diff --git a/CocoaSplit/Compressor/x264Compressor.m b/CocoaSplit/Compressor/x264Compressor.m index 9599092f..b07c7db8 100644 --- a/CocoaSplit/Compressor/x264Compressor.m +++ b/CocoaSplit/Compressor/x264Compressor.m @@ -159,15 +159,14 @@ --(void) reset +-(bool)needsSetup { - @synchronized (self) { - _reset_flag = YES; - dispatch_semaphore_signal(_queueSemaphore); - } + return !_av_codec; } + + -(void) internal_reset { //_compressor_queue = nil; @@ -176,7 +175,6 @@ _last_pts = 0; - [self clearFrameQueue]; if (_av_codec_ctx) { @@ -208,113 +206,12 @@ } --(bool)queueFramedata:(CapturedFrameData *)frameData -{ - if (!_consumerThread) - { - [self startConsumerThread]; - } - - @synchronized (self) { - [_compressQueue addObject:frameData]; - dispatch_semaphore_signal(_queueSemaphore); - } - - return YES; -} - - --(void)clearFrameQueue -{ - @synchronized (self) { - [_compressQueue removeAllObjects]; - } -} - - --(CapturedFrameData *)consumeframeData -{ - CapturedFrameData *retData = nil; - @synchronized (self) { - - - if (_compressQueue.count > 0) - { - retData = [_compressQueue objectAtIndex:0]; - [_compressQueue removeObjectAtIndex:0]; - } - } - return retData; -} - - --(void)startConsumerThread -{ - if (!_consumerThread) - { - _consumerThread = dispatch_queue_create("x264 consumer", DISPATCH_QUEUE_SERIAL); - dispatch_async(_consumerThread, ^{ - - while (1) - { - @autoreleasepool { - @synchronized (self) { - - if (self->_reset_flag) - { - [self internal_reset]; - } - } - CapturedFrameData *useData = [self consumeframeData]; - if (!useData) - { - dispatch_semaphore_wait(self->_queueSemaphore, DISPATCH_TIME_FOREVER); - } else { - [self real_compressFrame:useData]; - } - } - } - }); - } -} --(bool)compressFrame:(CapturedFrameData *)frameData -{ - if (![self hasOutputs]) - { - return NO; - } - - - if (!_av_codec && !self.errored) - { - BOOL setupOK; - - setupOK = [self setupCompressor:frameData]; - - if (!setupOK) - { - self.errored = YES; - return NO; - } - } else if (!_av_codec) { - return NO; - } - - - - [self reconfigureCompressor]; - - if (frameData.videoFrame) - { - CVPixelBufferRetain(frameData.videoFrame); - } - [self queueFramedata:frameData]; - return YES; -} + + - (bool)real_compressFrame:(CapturedFrameData *)frameData @@ -394,7 +291,7 @@ VTPixelTransferSessionTransferImage(self->_vtpt_ref, imageBuffer, converted_frame); - CVPixelBufferRelease(imageBuffer); + //CVPixelBufferRelease(imageBuffer); imageBuffer = nil; //poke the frameData so it releases the video buffer diff --git a/CocoaSplit/InputSource.m b/CocoaSplit/InputSource.m index 3b9b5edb..12e5076a 100644 --- a/CocoaSplit/InputSource.m +++ b/CocoaSplit/InputSource.m @@ -1566,7 +1566,6 @@ static NSArray *_sourceTypes = nil; [self deregisterVideoInput:vInput]; } - self.layer = nil; } diff --git a/CocoaSplit/InputSourceViews/InputPopupControllerViewController.xib b/CocoaSplit/InputSourceViews/InputPopupControllerViewController.xib index 52d750b2..aba15475 100644 --- a/CocoaSplit/InputSourceViews/InputPopupControllerViewController.xib +++ b/CocoaSplit/InputSourceViews/InputPopupControllerViewController.xib @@ -1,8 +1,8 @@ - + - + @@ -33,7 +33,7 @@ - + @@ -50,7 +50,7 @@ - + @@ -67,16 +67,16 @@ - + - + - + @@ -100,7 +100,7 @@ - + @@ -122,7 +122,7 @@ - + @@ -139,7 +139,7 @@ - + @@ -164,9 +164,9 @@ - + - + @@ -177,7 +177,7 @@ - + @@ -192,7 +192,7 @@ - + @@ -202,7 +202,7 @@ - + @@ -268,9 +268,9 @@ - + - + @@ -278,7 +278,7 @@ - + @@ -287,7 +287,7 @@ - + @@ -298,7 +298,7 @@ - + @@ -307,7 +307,7 @@ - + @@ -333,7 +333,7 @@ - + @@ -345,7 +345,7 @@ - + @@ -363,7 +363,7 @@ - + @@ -372,7 +372,7 @@ - + @@ -390,7 +390,7 @@ - + @@ -399,7 +399,7 @@ - + @@ -417,7 +417,7 @@ - + @@ -426,7 +426,7 @@ - + @@ -442,9 +442,9 @@ - + - + @@ -452,7 +452,7 @@ - + @@ -463,7 +463,7 @@ - + @@ -474,7 +474,7 @@ - + @@ -516,7 +516,7 @@ - + @@ -524,7 +524,7 @@ - + @@ -532,7 +532,7 @@ - + @@ -540,7 +540,7 @@ - + @@ -548,7 +548,7 @@ - + @@ -559,7 +559,7 @@ - + @@ -570,7 +570,7 @@ - + @@ -581,7 +581,7 @@ - + @@ -592,7 +592,7 @@ - + @@ -603,7 +603,7 @@ - + @@ -614,7 +614,7 @@ - + @@ -625,7 +625,7 @@ - + @@ -640,9 +640,9 @@ - + - + @@ -650,7 +650,7 @@ - + @@ -659,7 +659,7 @@ - + @@ -683,7 +683,7 @@ - + @@ -691,7 +691,7 @@ - + @@ -699,7 +699,7 @@ - + @@ -854,7 +854,7 @@ - + @@ -862,7 +862,7 @@ - + @@ -870,7 +870,7 @@ - + @@ -881,15 +881,15 @@ - + - + - + @@ -900,7 +900,7 @@ - + @@ -919,7 +919,7 @@ - + @@ -937,7 +937,7 @@ - + @@ -946,7 +946,7 @@ - + @@ -954,7 +954,7 @@ - + @@ -962,7 +962,7 @@ - + @@ -998,7 +998,7 @@ - + @@ -1009,7 +1009,7 @@ - + @@ -1034,7 +1034,7 @@ - + @@ -1042,7 +1042,7 @@ - + @@ -1050,7 +1050,7 @@ - + @@ -1058,7 +1058,7 @@ - + @@ -1066,7 +1066,7 @@ - + @@ -1080,7 +1080,7 @@ - + @@ -1094,7 +1094,7 @@ - + @@ -1109,7 +1109,7 @@ - + @@ -1118,7 +1118,7 @@ - + @@ -1135,7 +1135,7 @@ - + @@ -1147,7 +1147,7 @@ - + @@ -1326,7 +1326,7 @@ - + @@ -1334,7 +1334,7 @@ - + @@ -1342,7 +1342,7 @@ - + @@ -1350,7 +1350,7 @@ - + @@ -1361,7 +1361,7 @@ - + @@ -1369,7 +1369,7 @@ - + @@ -1377,7 +1377,7 @@ - + @@ -1389,7 +1389,7 @@ - + @@ -1420,7 +1420,7 @@ - + @@ -1429,7 +1429,7 @@ - + @@ -1461,7 +1461,7 @@ - + @@ -1493,7 +1493,7 @@ - + @@ -1525,7 +1525,7 @@ - + @@ -1557,7 +1557,7 @@ - + @@ -1589,7 +1589,7 @@ - + @@ -1621,7 +1621,7 @@ - + @@ -1655,7 +1655,7 @@ - + @@ -1666,7 +1666,7 @@ - + @@ -1684,7 +1684,7 @@ - + @@ -1692,7 +1692,7 @@ - + @@ -1710,7 +1710,7 @@ - + @@ -1718,7 +1718,7 @@ - + @@ -1736,7 +1736,7 @@ - + @@ -1744,7 +1744,7 @@ - + @@ -1762,7 +1762,7 @@ - + @@ -1770,7 +1770,7 @@ - + @@ -1788,7 +1788,7 @@ - + @@ -1796,7 +1796,7 @@ - + @@ -1814,7 +1814,7 @@ - + @@ -1822,7 +1822,7 @@ - + @@ -1840,7 +1840,7 @@ - + @@ -1848,7 +1848,7 @@ - + @@ -1867,7 +1867,7 @@ - + @@ -1992,7 +1992,7 @@ - + @@ -2003,7 +2003,7 @@ - + @@ -2017,7 +2017,7 @@ - + @@ -2029,7 +2029,7 @@ - + @@ -2048,7 +2048,7 @@ - + @@ -2056,7 +2056,7 @@ - + @@ -2075,7 +2075,7 @@ - + @@ -2095,9 +2095,9 @@ - + - + @@ -2106,13 +2106,13 @@ - + @@ -2620,7 +2620,7 @@ - + diff --git a/CocoaSplit/PluginBaseClasses/CSCaptureBase.m b/CocoaSplit/PluginBaseClasses/CSCaptureBase.m index 8430209e..c6c95198 100644 --- a/CocoaSplit/PluginBaseClasses/CSCaptureBase.m +++ b/CocoaSplit/PluginBaseClasses/CSCaptureBase.m @@ -116,6 +116,7 @@ -(void)encodeWithCoder:(NSCoder *)aCoder { [aCoder encodeObject:self.activeVideoDevice.uniqueID forKey:@"active_uniqueID"]; + [aCoder encodeBool:self.allowDedup forKey:@"allowDedup"]; [aCoder encodeBool:self.cachePersistent forKey:@"cachePersistent"]; @@ -244,10 +245,7 @@ self.activeVideoDevice = nil; } else { self.activeVideoDevice = [currentAvailableDevices objectAtIndex:sidx]; - if (self.allowDedup) - { - [[SourceCache sharedCache] cacheSourcePersistent:self]; - } + } }