@@ -59,7 +59,7 @@ public class Video implements PConstants {
5959
6060 protected static boolean defaultGLibContext = false ;
6161
62- protected static boolean useGstreamerSystemInstall = false ;
62+ protected static boolean usingGStreamerSystemInstall = false ;
6363
6464 protected static long INSTANCES_COUNT = 0 ;
6565
@@ -147,49 +147,44 @@ static protected void initImpl() {
147147
148148 // instead of setting the plugin path via scanPath(), we could alternatively
149149 // also set the GST_PLUGIN_PATH_1_0 environment variable
150- addPlugins ();
151-
152-
153- // output GStreamer version, lib path, plugin path
154- // and whether a system install is being used
155- printGStreamerInfo ();
150+ addPlugins ();
151+
152+
153+ // output GStreamer version, lib path, plugin path
154+ // and whether a system install is being used
155+ printGStreamerInfo ();
156156 }
157157
158158 static protected void printGStreamerInfo () {
159-
160- String output = "" ;
161- System .out .println ("Gstreamer Version: " + Gst .getVersionString ());
162-
163- if (useGstreamerSystemInstall ) {
164- output = "Using System Install Gstreamer: " ;
165-
166- // get x64-bit root of GStreamer install
167- if (System .getenv ("GSTREAMER_1_0_ROOT_X86_64" ) != null && bitsJVM == 64 ) {
168- output += System .getenv ("GSTREAMER_1_0_ROOT_X86_64" );
169- }
170-
171- // get x32-bit root of GStreamer install
172- else if (System .getenv ("GSTREAMER_1_0_ROOT_X86" ) != null && bitsJVM == 32 ) {
173- output += System .getenv ("GSTREAMER_1_0_ROOT_X86" );
174- }
175-
176- else {
177- output += "Unknown location, please set GSTREAMER_1_0_ROOT_X86(_64) to where GStreamer is installed" ;
178- }
179-
180- System .out .println (output );
181- }
182-
183- // simply output gstreamerLibPath and gstreamerPluginPath when using bundled GStreamer
184- else {
185- System .out .println ("Gstreamer Library Path: " + gstreamerLibPath );
186- System .out .println ("Gstreamer Plugin Path: " + gstreamerPluginPath );
187- }
188-
189- }
190-
159+
160+ String output = "" ;
161+ System .out .println ("GStreamer version: " + Gst .getVersion ());
162+
163+ if (usingGStreamerSystemInstall ) {
164+ output = "Using system install GStreamer: " ;
165+
166+ if (System .getenv ("GSTREAMER_1_0_ROOT_X86_64" ) != null && bitsJVM == 64 ) {
167+ // get x64-bit root of GStreamer install
168+ output += System .getenv ("GSTREAMER_1_0_ROOT_X86_64" );
169+ } else if (System .getenv ("GSTREAMER_1_0_ROOT_X86" ) != null && bitsJVM == 32 ) {
170+ // get x32-bit root of GStreamer install
171+ output += System .getenv ("GSTREAMER_1_0_ROOT_X86" );
172+ } else {
173+ output += "Unknown location, please set GSTREAMER_1_0_ROOT_X86(_64) to where GStreamer is installed" ;
174+ }
175+
176+ System .out .println (output );
177+ }
178+
179+ // simply output gstreamerLibPath and gstreamerPluginPath when using bundled GStreamer
180+ else {
181+ System .out .println ("GStreamer library path: " + gstreamerLibPath );
182+ System .out .println ("GStreamer plugin path: " + gstreamerPluginPath );
183+ }
184+ }
185+
191186 static protected void addPlugins () {
192- if (!gstreamerPluginPath .equals ("" ) && !useGstreamerSystemInstall ) {
187+ if (!gstreamerPluginPath .equals ("" ) && !usingGStreamerSystemInstall ) {
193188 Registry reg = Registry .get ();
194189 boolean res ;
195190 res = reg .scanPath (gstreamerPluginPath );
@@ -239,16 +234,13 @@ static protected String buildGStreamerLibPath(String base, String os) {
239234 if (path .exists ()) {
240235 return base + os ;
241236 } else {
242- useGstreamerSystemInstall = true ;
237+ usingGStreamerSystemInstall = true ;
243238 return base ;
244239 }
245240 }
246241
247242
248243 static protected float nanoSecToSecFrac (long nanosec ) {
249- // for (int i = 0; i < 3; i++)
250- // nanosec /= 1E3;
251- // return nanosec;
252244 return (float )(nanosec / 1E9 );
253245 }
254246
0 commit comments