Skip to content

Commit 92331ad

Browse files
committed
Default webcam mode is null.
1 parent 2d2ec3c commit 92331ad

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

pack/lite/src/main/java/com/thefirstlineofcode/granite/pack/lite/Main.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.util.Arrays;
44

5+
import com.thefirstlineofcode.granite.pack.lite.Options.Protocol;
56
import com.thefirstlineofcode.granite.pack.lite.Options.WebcamMode;
67

78
public class Main {
@@ -155,6 +156,14 @@ private Options parseOptions(String[] args) {
155156
options.setVersion(DEFAULT_VERSION);
156157
}
157158

159+
if (options.getWebcamMode() == null) {
160+
if (options.getProtocol() == Protocol.IOT) {
161+
options.setWebcamMode(WebcamMode.P2P);
162+
} else {
163+
options.setWebcamMode(WebcamMode.NONE);
164+
}
165+
}
166+
158167
options.setAppName(String.format("%s-%s-%s", NAME_PREFIX_APP, options.getProtocol().toString().toLowerCase(), options.getVersion()));
159168

160169
if (!options.isUpdate() && !options.isCleanUpdate() && options.getProtocol() == null) {
@@ -181,7 +190,7 @@ private void printUsage() {
181190
System.out.println("-cleanUpdate Clean and update specified modules.");
182191
System.out.println("-cleanCache Clean the packing cache.");
183192
System.out.println("-offline Run in offline mode.");
184-
// System.out.println("-version <VERSION> Specify the version. Default is 1.0.2-RELEASE.");
193+
// System.out.println("-version <VERSION> Specify the version. Default is 1.0.4-RELEASE.");
185194
System.out.println("-protocol <PROTOCOL> Specify the protocol. Optional protocols are 'mini', 'standard' or 'iot'. Default is 'standard'.");
186195
System.out.println("-webcamMode <WEBCAM-MODE> Specify that which webcam plugin needs to be deployed. Optional plugins are 'none', 'p2p', 'kurento'. Default is 'none'.");
187196
System.out.println("-sandProjectName <SAND-PROJECT-NAME> Specify the sand project name. Default is 'com.thefirstlineofcode.sand'.");

pack/lite/src/main/java/com/thefirstlineofcode/granite/pack/lite/Options.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public Options() {
3838
protocol = Protocol.STANDARD;
3939
commerical = false;
4040
offline = false;
41-
webcamMode = WebcamMode.NONE;
41+
webcamMode = null;
4242
}
4343

4444
public boolean isHelp() {

0 commit comments

Comments
 (0)