Skip to content

Commit

Permalink
Add Start/Stop recording scripting event.
Browse files Browse the repository at this point in the history
Don't call queue err_send function in ffmpeg  closeMedia, let the consumer loop do that
  • Loading branch information
zakk4223 committed Apr 12, 2020
1 parent ae02cd7 commit 01479ac
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CSFFMpegCapturePlugin/CSFFMpegCapturePlugin/CSFFMpegInput.m
Original file line number Diff line number Diff line change
Expand Up @@ -708,8 +708,8 @@ -(void)closeMedia
_is_ready = NO;
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(_audio_message_queue, AVERROR_EOF);
//av_thread_message_queue_set_err_send(_video_message_queue, AVERROR_EOF);
//mkav_thread_message_queue_set_err_send(_audio_message_queue, AVERROR_EOF);
}
}

Expand Down
3 changes: 2 additions & 1 deletion CSNotifications.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

NSString *const CSNotificationStreamStarted = @"CSNotificationStreamStarted";
NSString *const CSNotificationStreamStopped = @"CSNotificationStreamStopped";

NSString *const CSNotificationMainRecordingStarted = @"CSNotificationMainRecordingStarted";
NSString *const CSNotificationMainRecordingStopped = @"CSNotificationMainRecordingStopped";

NSString *const CSNotificationOutputAdded = @"CSNotificationOutputAdded";
NSString *const CSNotificationOutputDeleted = @"CSNotificationOutputDeleted";
Expand Down
4 changes: 4 additions & 0 deletions CocoaSplit/CaptureController.m
Original file line number Diff line number Diff line change
Expand Up @@ -3497,8 +3497,12 @@ -(void)setMainRecordingActive:(bool)mainRecordingActive
if (mainRecordingActive)
{
tmpColor = CGColorCreateGenericRGB(1, 0, 0, 1);
[self postNotification:CSNotificationMainRecordingStarted forObject:self];

} else {
tmpColor = CGColorCreateGenericRGB(1, 0, 0, 0.5);
[self postNotification:CSNotificationMainRecordingStopped forObject:self];

}

self.recordButton.layer.backgroundColor = tmpColor;
Expand Down
2 changes: 2 additions & 0 deletions CocoaSplit/PluginHeaders/CSNotifications.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ extern NSString *const CSNotificationLayoutInStagingChanged;
extern NSString *const CSNotificationStreamStarted;
extern NSString *const CSNotificationStreamStopped;

extern NSString *const CSNotificationMainRecordingStarted;
extern NSString *const CSNotificationMainRecordingStopped;

extern NSString *const CSNotificationOutputAdded;
extern NSString *const CSNotificationOutputDeleted;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ -(BOOL)application:(NSApplication *)sender delegateHandlesKey:(NSString *)key
{


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];
}
Expand Down

0 comments on commit 01479ac

Please sign in to comment.