public static void setupJMF ( ) { // .jmf is the place where we store the jmf.properties file used // by JMF. if the directory does not exist or it does not contain // a jmf.properties file. or if the jmf.properties file has 0 length // then this is the first time we're running and should continue to // with JMFInit String homeDir = System . getProperty ( "user.home" ) ; File jmfDir = new File ( homeDir , ".jmf" ) ; String classpath = System . getProperty ( "java.class.path" ) ; classpath += System . getProperty ( "path.separator" ) + jmfDir . getAbsolutePath ( ) ; System . setProperty ( "java.class.path" , classpath ) ; if ( ! jmfDir . exists ( ) ) jmfDir . mkdir ( ) ; File jmfProperties = new File ( jmfDir , "jmf.properties" ) ; if ( ! jmfProperties . exists ( ) ) { try { jmfProperties . createNewFile ( ) ; } catch ( IOException ex ) { LOGGER . log ( Level . FINE , "Failed to create jmf.properties" , ex ) ; } } // if we're running on linux checkout that libjmutil.so is where it // should be and put it there. runLinuxPreInstall ( ) ; // if (jmfProperties.length() == 0) { new JMFInit ( null , false ) ; // } }
Runs JMFInit the first time the application is started so that capture devices are properly detected and initialized by JMF .