From 91588990efbc9df49e79696c63efb8c0af8d7104 Mon Sep 17 00:00:00 2001 From: hmelder Date: Sun, 10 Mar 2024 17:29:30 +0100 Subject: [PATCH] vmpserverd: Add RecordingManager stubs --- Daemons/vmpserverd/meson.build | 1 + Daemons/vmpserverd/src/VMPRecordingManager.h | 48 ++++++++++++++++++++ Daemons/vmpserverd/src/VMPRecordingManager.m | 42 +++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 Daemons/vmpserverd/src/VMPRecordingManager.h create mode 100644 Daemons/vmpserverd/src/VMPRecordingManager.m diff --git a/Daemons/vmpserverd/meson.build b/Daemons/vmpserverd/meson.build index bc7de0b..1bf9c9b 100644 --- a/Daemons/vmpserverd/meson.build +++ b/Daemons/vmpserverd/meson.build @@ -60,6 +60,7 @@ source = [ 'src/VMPProfileManager.m', 'src/VMPUdevClient.m', 'src/VMPPipelineManager.m', + 'src/VMPRecordingManager.m', 'src/VMPErrors.m', 'src/VMPJournal.m', 'src/NSString+substituteVariables.m', diff --git a/Daemons/vmpserverd/src/VMPRecordingManager.h b/Daemons/vmpserverd/src/VMPRecordingManager.h new file mode 100644 index 0000000..b5f342e --- /dev/null +++ b/Daemons/vmpserverd/src/VMPRecordingManager.h @@ -0,0 +1,48 @@ +/* vmpserverd - A virtual multimedia processor + * Copyright (C) 2024 Hugo Melder + * + * SPDX-License-Identifier: MIT + */ + +#import "VMPPipelineManager.h" + +/// The encoding bitrate +extern NSString *const kVMPRecordingBitrate; + +/** + * @brief Recording Manager + * + * A subclass of th pipeline manager that + * has extensions for recording to a + * file. + */ +@interface VMPRecordingManager : VMPPipelineManager + + +/** + * Absolute destination path of recording. + */ +@property (nonatomic, readonly) NSURL *path; + +/** + * Additional recording and encoding options. + */ +@property (nonatomic, readonly) NSDictionary *options; + ++ (instancetype)recorderWithChannel: (NSString *)channel + path: (NSURL *)path + recordUntil: (NSDate *) date + options: (NSDictionary *)options + delegate: (id)delegate; + +- (instancetype)initWithChannel: (NSString *)channel + path: (NSURL *)path + recordUntil: (NSDate *) date + options: (NSDictionary *)options + delegate: (id)delegate NS_DESIGNATED_INITIALIZER; + +- (BOOL) changeDeadline: (NSDate *)date; + +- (NSDate *) deadline; + +@end diff --git a/Daemons/vmpserverd/src/VMPRecordingManager.m b/Daemons/vmpserverd/src/VMPRecordingManager.m new file mode 100644 index 0000000..052ccfb --- /dev/null +++ b/Daemons/vmpserverd/src/VMPRecordingManager.m @@ -0,0 +1,42 @@ +/* vmpserverd - A virtual multimedia processor + * Copyright (C) 2024 Hugo Melder + * + * SPDX-License-Identifier: MIT + */ + + #import "VMPRecordingManager.h" + + NSString *const kVMPRecordingBitrate = @"recordingBitrate"; + +@implementation VMPRecordingManager +{ + NSDate *_deadline; +} + ++ (instancetype)recorderWithChannel: (NSString *)channel + path: (NSURL *)path + recordUntil: (NSDate *) date + options: (NSDictionary *)options + delegate: (id)delegate { + return nil; +} + +- (instancetype)initWithChannel: (NSString *)channel + path: (NSURL *)path + recordUntil: (NSDate *) date + options: (NSDictionary *)options + delegate: (id)delegate { + self = [super initWithLaunchArgs: @"" channel: channel delegate: delegate]; + return self; + +} + +- (BOOL) changeDeadline: (NSDate *)date { + return NO; +} + +- (NSDate *) deadline { + return nil; +} + +@end