Skip to content

Commit

Permalink
Add 'decklink' channel
Browse files Browse the repository at this point in the history
  • Loading branch information
hmelder committed Oct 27, 2024
1 parent b170142 commit ac5b4f3
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Daemons/vmpserverd/profiles/com.hugomelder.software.plist
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
<dict>
<key>v4l2</key>
<string>v4l2src device={V4L2DEV} ! videoconvertscale add-borders=1 ! video/x-raw, width=1920, height=1080 ! queue ! intervideosink channel={VIDEOCHANNEL.0}</string>
<key>decklink</key>
<string>decklinksrc device-number={DEV} ! videoconvert ! videoscale ! videorate ! video/x-raw, width=1920, height=1080 ! intervideosink channel={VIDEOCHANNEL.0}</string>
<key>videoTest</key>
<string>videotestsrc is-live=1 ! video/x-raw,width={WIDTH},height={HEIGHT},format=NV12 !
intervideosink channel={VIDEOCHANNEL.0}</string>
Expand Down
2 changes: 2 additions & 0 deletions Daemons/vmpserverd/profiles/com.hugomelder.vaapi.plist
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@
communication in the same process.
-->
<string>v4l2src device={V4L2DEV} ! videoconvertscale add-borders=1 ! video/x-raw, width=1920, height=1080 ! intervideosink channel={VIDEOCHANNEL.0}</string>
<key>decklink</key>
<string>decklinksrc device-number={DEV} ! videoconvert ! videoscale ! videorate ! video/x-raw, width=1920, height=1080 ! intervideosink channel={VIDEOCHANNEL.0}</string>
<key>videoTest</key>
<string>videotestsrc is-live=1 ! video/x-raw,width={WIDTH},height={HEIGHT},format=NV12 ! intervideosink channel={VIDEOCHANNEL.0}</string>
</dict>
Expand Down
13 changes: 13 additions & 0 deletions Daemons/vmpserverd/src/VMPRTSPServer.m
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,19 @@ - (BOOL)_startChannelPipelinesWithError:(NSError **)error {
@"WIDTH" : [width stringValue],
@"HEIGHT" : [height stringValue]
};
} else if ([type isEqualToString:VMPConfigChannelTypeDecklink]) {
VMPInfo(@"Starting channel %@ of type %@", name, type);
NSNumber *device = properties[@"deviceNumber"];
if (!device) {
CONFIG_ERROR(error, @"decklink channel is missing 'deviceNumber' property")
return NO;
}

// Substitution dictionary for pipeline template
vars = @{
@"VIDEOCHANNEL.0" : name,
@"DEV" : [device stringValue],
};
}

// Skip pipeline creation if type is unknown
Expand Down
2 changes: 2 additions & 0 deletions Daemons/vmpserverd/src/models/VMPConfigChannelModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

/// Channel for capturing V4L2 devices
extern NSString *const VMPConfigChannelTypeV4L2;
/// Channel for capturing from Decklinks
extern NSString *const VMPConfigChannelTypeDecklink;
/// Channel for creating a reproducible video test pattern
extern NSString *const VMPConfigChannelTypeVideoTest;
/// Channel for creating a reproducible audio test tone
Expand Down
1 change: 1 addition & 0 deletions Daemons/vmpserverd/src/models/VMPConfigChannelModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#import "VMPModelCommon.h"

NSString *const VMPConfigChannelTypeV4L2 = @"v4l2";
NSString *const VMPConfigChannelTypeDecklink = @"decklink";
NSString *const VMPConfigChannelTypeVideoTest = @"videoTest";
NSString *const VMPConfigChannelTypeAudioTest = @"audioTest";
NSString *const VMPConfigChannelTypePulseAudio = @"pulse";
Expand Down

0 comments on commit ac5b4f3

Please sign in to comment.