Skip to content

Commit ac5b4f3

Browse files
committed
Add 'decklink' channel
1 parent b170142 commit ac5b4f3

5 files changed

+20
-0
lines changed

Daemons/vmpserverd/profiles/com.hugomelder.software.plist

+2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@
6565
<dict>
6666
<key>v4l2</key>
6767
<string>v4l2src device={V4L2DEV} ! videoconvertscale add-borders=1 ! video/x-raw, width=1920, height=1080 ! queue ! intervideosink channel={VIDEOCHANNEL.0}</string>
68+
<key>decklink</key>
69+
<string>decklinksrc device-number={DEV} ! videoconvert ! videoscale ! videorate ! video/x-raw, width=1920, height=1080 ! intervideosink channel={VIDEOCHANNEL.0}</string>
6870
<key>videoTest</key>
6971
<string>videotestsrc is-live=1 ! video/x-raw,width={WIDTH},height={HEIGHT},format=NV12 !
7072
intervideosink channel={VIDEOCHANNEL.0}</string>

Daemons/vmpserverd/profiles/com.hugomelder.vaapi.plist

+2
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@
9797
communication in the same process.
9898
-->
9999
<string>v4l2src device={V4L2DEV} ! videoconvertscale add-borders=1 ! video/x-raw, width=1920, height=1080 ! intervideosink channel={VIDEOCHANNEL.0}</string>
100+
<key>decklink</key>
101+
<string>decklinksrc device-number={DEV} ! videoconvert ! videoscale ! videorate ! video/x-raw, width=1920, height=1080 ! intervideosink channel={VIDEOCHANNEL.0}</string>
100102
<key>videoTest</key>
101103
<string>videotestsrc is-live=1 ! video/x-raw,width={WIDTH},height={HEIGHT},format=NV12 ! intervideosink channel={VIDEOCHANNEL.0}</string>
102104
</dict>

Daemons/vmpserverd/src/VMPRTSPServer.m

+13
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,19 @@ - (BOOL)_startChannelPipelinesWithError:(NSError **)error {
360360
@"WIDTH" : [width stringValue],
361361
@"HEIGHT" : [height stringValue]
362362
};
363+
} else if ([type isEqualToString:VMPConfigChannelTypeDecklink]) {
364+
VMPInfo(@"Starting channel %@ of type %@", name, type);
365+
NSNumber *device = properties[@"deviceNumber"];
366+
if (!device) {
367+
CONFIG_ERROR(error, @"decklink channel is missing 'deviceNumber' property")
368+
return NO;
369+
}
370+
371+
// Substitution dictionary for pipeline template
372+
vars = @{
373+
@"VIDEOCHANNEL.0" : name,
374+
@"DEV" : [device stringValue],
375+
};
363376
}
364377

365378
// Skip pipeline creation if type is unknown

Daemons/vmpserverd/src/models/VMPConfigChannelModel.h

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
/// Channel for capturing V4L2 devices
1212
extern NSString *const VMPConfigChannelTypeV4L2;
13+
/// Channel for capturing from Decklinks
14+
extern NSString *const VMPConfigChannelTypeDecklink;
1315
/// Channel for creating a reproducible video test pattern
1416
extern NSString *const VMPConfigChannelTypeVideoTest;
1517
/// Channel for creating a reproducible audio test tone

Daemons/vmpserverd/src/models/VMPConfigChannelModel.m

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#import "VMPModelCommon.h"
1111

1212
NSString *const VMPConfigChannelTypeV4L2 = @"v4l2";
13+
NSString *const VMPConfigChannelTypeDecklink = @"decklink";
1314
NSString *const VMPConfigChannelTypeVideoTest = @"videoTest";
1415
NSString *const VMPConfigChannelTypeAudioTest = @"audioTest";
1516
NSString *const VMPConfigChannelTypePulseAudio = @"pulse";

0 commit comments

Comments
 (0)