Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MISB UAS driver: specify server connection as single String #48

Merged
merged 1 commit into from
Mar 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,16 @@ protected void doInit() throws SensorHubException {
this.executor = Executors.newSingleThreadExecutor();
boolean streamOpened = false;

// Get the stream processor
if ((null != config.connection.transportStreamPath) && (!config.connection.transportStreamPath.isEmpty())) {

// Initialize the MPEG transport stream processor from the source named in the configuration.
// If neither the file source nor a connection string is specified, throw an exception so the user knows that
// they have to provide at least one of them.
if ((null != config.connection.transportStreamPath) && (!config.connection.transportStreamPath.isBlank())) {
Asserts.checkArgument(config.connection.fps >= 0, "FPS must be >= 0");
mpegTsProcessor = new MpegTsProcessor(config.connection.transportStreamPath, config.connection.fps, config.connection.loop);

} else if ((null != config.connection.connectionString) && (!config.connection.connectionString.isBlank())) {
mpegTsProcessor = new MpegTsProcessor(config.connection.connectionString);
} else {

mpegTsProcessor = new MpegTsProcessor(config.connection.serverIpAddress + ":" + config.connection.serverIpPort);
throw new SensorHubException("Either the input file path or the connection string must be set");
}

// Attempt to open the stream
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ public class Connection {
@DisplayInfo(desc = "Continuously loop video playback (only available when reading from file).")
public boolean loop = false;

@DisplayInfo(label = "Server Ip", desc = "Server IP address of MISB STANAG 4609 MPEG-TS data to be streamed")
@DisplayInfo.FieldType(value = DisplayInfo.FieldType.Type.REMOTE_ADDRESS)
public String serverIpAddress;

@DisplayInfo(label = "Port", desc = "Server IP port of MISB STANAG 4609 MPEG-TS data to be streamed")
public int serverIpPort;
@DisplayInfo(label = "Connection String", desc = "Connection string that the driver will pass to ffmpeg to connect to the MISB STANAG 4609 MPEG-TS stream. This value is ignored if an input file path is also set in the configuration. See https://www.ffmpeg.org/ffmpeg-protocols.html#Protocols for details of allowed values.")
public String connectionString;
}