Add Start/Stop recording scripting event.

Don't call queue err_send function in ffmpeg  closeMedia, let the consumer loop do that
This commit is contained in:
Zakk 2020-04-12 15:33:41 -04:00
parent ae02cd7d16
commit 01479aca32
5 changed files with 11 additions and 4 deletions

View file

@ -708,8 +708,8 @@
_is_ready = NO; _is_ready = NO;
dispatch_semaphore_signal(_read_loop_semaphore); dispatch_semaphore_signal(_read_loop_semaphore);
av_thread_message_queue_set_err_send(_video_message_queue, AVERROR_EOF); //av_thread_message_queue_set_err_send(_video_message_queue, AVERROR_EOF);
av_thread_message_queue_set_err_send(_audio_message_queue, AVERROR_EOF); //mkav_thread_message_queue_set_err_send(_audio_message_queue, AVERROR_EOF);
} }
} }

View file

@ -21,7 +21,8 @@ NSString *const CSNotificationLayoutInStagingChanged = @"CSNotificationLayoutInS
NSString *const CSNotificationStreamStarted = @"CSNotificationStreamStarted"; NSString *const CSNotificationStreamStarted = @"CSNotificationStreamStarted";
NSString *const CSNotificationStreamStopped = @"CSNotificationStreamStopped"; NSString *const CSNotificationStreamStopped = @"CSNotificationStreamStopped";
NSString *const CSNotificationMainRecordingStarted = @"CSNotificationMainRecordingStarted";
NSString *const CSNotificationMainRecordingStopped = @"CSNotificationMainRecordingStopped";
NSString *const CSNotificationOutputAdded = @"CSNotificationOutputAdded"; NSString *const CSNotificationOutputAdded = @"CSNotificationOutputAdded";
NSString *const CSNotificationOutputDeleted = @"CSNotificationOutputDeleted"; NSString *const CSNotificationOutputDeleted = @"CSNotificationOutputDeleted";

View file

@ -3497,8 +3497,12 @@ NSString *const CSAppearanceSystem = @"CSAppearanceSystem";
if (mainRecordingActive) if (mainRecordingActive)
{ {
tmpColor = CGColorCreateGenericRGB(1, 0, 0, 1); tmpColor = CGColorCreateGenericRGB(1, 0, 0, 1);
[self postNotification:CSNotificationMainRecordingStarted forObject:self];
} else { } else {
tmpColor = CGColorCreateGenericRGB(1, 0, 0, 0.5); tmpColor = CGColorCreateGenericRGB(1, 0, 0, 0.5);
[self postNotification:CSNotificationMainRecordingStopped forObject:self];
} }
self.recordButton.layer.backgroundColor = tmpColor; self.recordButton.layer.backgroundColor = tmpColor;

View file

@ -21,6 +21,8 @@ extern NSString *const CSNotificationLayoutInStagingChanged;
extern NSString *const CSNotificationStreamStarted; extern NSString *const CSNotificationStreamStarted;
extern NSString *const CSNotificationStreamStopped; extern NSString *const CSNotificationStreamStopped;
extern NSString *const CSNotificationMainRecordingStarted;
extern NSString *const CSNotificationMainRecordingStopped;
extern NSString *const CSNotificationOutputAdded; extern NSString *const CSNotificationOutputAdded;
extern NSString *const CSNotificationOutputDeleted; extern NSString *const CSNotificationOutputDeleted;

View file

@ -200,7 +200,7 @@
{ {
NSArray *keys = @[@"layouts", @"width", @"height", @"fps", @"activelayout", @"layoutscripts", @"audioInputs", @"captureDestinations", @"staginglayout", @"livelayout", @"useTransitions", @"previewAudio", @"streamAudio", @"transitions", @"streamRunning", @"stagingEnabled", @"audioTracks"]; NSArray *keys = @[@"layouts", @"width", @"height", @"fps", @"activelayout", @"layoutscripts", @"audioInputs", @"captureDestinations", @"staginglayout", @"livelayout", @"useTransitions", @"previewAudio", @"streamAudio", @"transitions", @"streamRunning", @"stagingEnabled", @"audioTracks", @"recordingActive"];
return [keys containsObject:key]; return [keys containsObject:key];
} }