检查JMF的版本
/**
* Query for the particular version of JMF.
*/
public interface QueryJMF
{
public static final String NATIVE = "Native Libraries Found\n";
public static final String NONATIVE = "Native Libraries Not Found\n";
public abstract String getVersion();
public abstract String getDetails();
}
/**
* Check for version JMF 1.0.
*/
public class QueryJMF10 implements QueryJMF
{
public String getVersion()
{
return "1.0.2";
}
public String getDetails()
{
String string = "";
try
{
Class.forName("com.sun.media.blitter.xlib.Blitter");
string = new StringBuffer(String.valueOf(string)).append("Solaris Build\n").toString();
}
catch (Throwable throwable1)
{
}
try
{
Class.forName("com.sun.media.blitter.directx.Blitter");
string = new StringBuffer(String.valueOf(string)).append("Win32 Build\n").toString();
}
catch (Throwable throwable2)
{
}
try
{
//JMFSecurity.loadLibrary("jmindeo");
string = new StringBuffer(String.valueOf(string)).append("Native Libraries Found\n").toString();
}
catch (UnsatisfiedLinkError e)
{
string = new StringBuffer(String.valueOf(string)).append("Native Libraries Not Found\n").toString();
}
return string;
}
public QueryJMF10()
{
}
static
{
try
{
Class.forName("com.sun.media.renderer.video.VideoRenderer$CC");
}
catch (Throwable throwable)
{
throw new RuntimeException("Not JMF 1.0.2");
}
}
}
/**
* Check for version JMF 1.1.
*/
public class QueryJMF11 implements QueryJMF
{
public String getVersion()
{
return "1.1";
}
public String getDetails()
{
String string = "";
try
{
Class.forName("com.sun.media.blitter.xlib.Blitter");
string = new StringBuffer(String.valueOf(string)).append("Solaris Build\n").toString();
}
catch (Throwable throwable1)
{
}
try
{
Class.forName("com.sun.media.blitter.directx.Blitter");
string = new StringBuffer(String.valueOf(string)).append("Win32 Build\n").toString();
}
catch (Throwable throwable2)
{
}
try
{
//JMFSecurity.loadLibrary("jmindeo");
string = new StringBuffer(String.valueOf(string)).append("Native Libraries Found\n").toString();
}
catch (UnsatisfiedLinkError e)
{
string = new StringBuffer(String.valueOf(string)).append("Native Libraries Not Found\n").toString();
}
return string;
}
public QueryJMF11()
{
}
static
{
try
{
Class.forName("com.sun.media.codec.video.h263.H263Decoder");
}
catch (Throwable throwable)
{
throw new RuntimeException("Not JMF 1.1");
}
}
}
import com.sun.media.JMFSecurityManager;
import javax.media.Manager;
/**
* Check for version JMF 2.0.
*/
public class QueryJMF20 implements QueryJMF
{
public String getVersion()
{
return Manager.getVersion();
}
public String getDetails()
{
String string = "";
try
{
Class.forName("com.sun.media.renderer.video.XILRenderer");
string = new StringBuffer(String.valueOf(string)).append("Solaris Build\n").toString();
}
catch (Throwable throwable2)
{
try
{
Class.forName("com.sun.media.protocol.vfw.DataSource");
string = new StringBuffer(String.valueOf(string)).append("Win32 Build\n").toString();
}
catch (Throwable throwable1)
{
string = new StringBuffer(String.valueOf(string)).append("All Java Build\n").toString();
}
}
try
{
JMFSecurityManager.loadLibrary("jmutil");
string = new StringBuffer(String.valueOf(string)).append("Native Libraries Found\n").toString();
}
catch (UnsatisfiedLinkError e)
{
string = new StringBuffer(String.valueOf(string)).append("Native Libraries Not Found\n").toString();
}
return string;
}
public QueryJMF20()
{
}
static
{
try
{
Class.forName("javax.media.Codec");
}
catch (Throwable throwable)
{
throw new RuntimeException("Not JMF 2.0");
}
}
}
* Query for the particular version of JMF.
*/
public interface QueryJMF
{
public static final String NATIVE = "Native Libraries Found\n";
public static final String NONATIVE = "Native Libraries Not Found\n";
public abstract String getVersion();
public abstract String getDetails();
}
/**
* Check for version JMF 1.0.
*/
public class QueryJMF10 implements QueryJMF
{
public String getVersion()
{
return "1.0.2";
}
public String getDetails()
{
String string = "";
try
{
Class.forName("com.sun.media.blitter.xlib.Blitter");
string = new StringBuffer(String.valueOf(string)).append("Solaris Build\n").toString();
}
catch (Throwable throwable1)
{
}
try
{
Class.forName("com.sun.media.blitter.directx.Blitter");
string = new StringBuffer(String.valueOf(string)).append("Win32 Build\n").toString();
}
catch (Throwable throwable2)
{
}
try
{
//JMFSecurity.loadLibrary("jmindeo");
string = new StringBuffer(String.valueOf(string)).append("Native Libraries Found\n").toString();
}
catch (UnsatisfiedLinkError e)
{
string = new StringBuffer(String.valueOf(string)).append("Native Libraries Not Found\n").toString();
}
return string;
}
public QueryJMF10()
{
}
static
{
try
{
Class.forName("com.sun.media.renderer.video.VideoRenderer$CC");
}
catch (Throwable throwable)
{
throw new RuntimeException("Not JMF 1.0.2");
}
}
}
/**
* Check for version JMF 1.1.
*/
public class QueryJMF11 implements QueryJMF
{
public String getVersion()
{
return "1.1";
}
public String getDetails()
{
String string = "";
try
{
Class.forName("com.sun.media.blitter.xlib.Blitter");
string = new StringBuffer(String.valueOf(string)).append("Solaris Build\n").toString();
}
catch (Throwable throwable1)
{
}
try
{
Class.forName("com.sun.media.blitter.directx.Blitter");
string = new StringBuffer(String.valueOf(string)).append("Win32 Build\n").toString();
}
catch (Throwable throwable2)
{
}
try
{
//JMFSecurity.loadLibrary("jmindeo");
string = new StringBuffer(String.valueOf(string)).append("Native Libraries Found\n").toString();
}
catch (UnsatisfiedLinkError e)
{
string = new StringBuffer(String.valueOf(string)).append("Native Libraries Not Found\n").toString();
}
return string;
}
public QueryJMF11()
{
}
static
{
try
{
Class.forName("com.sun.media.codec.video.h263.H263Decoder");
}
catch (Throwable throwable)
{
throw new RuntimeException("Not JMF 1.1");
}
}
}
import com.sun.media.JMFSecurityManager;
import javax.media.Manager;
/**
* Check for version JMF 2.0.
*/
public class QueryJMF20 implements QueryJMF
{
public String getVersion()
{
return Manager.getVersion();
}
public String getDetails()
{
String string = "";
try
{
Class.forName("com.sun.media.renderer.video.XILRenderer");
string = new StringBuffer(String.valueOf(string)).append("Solaris Build\n").toString();
}
catch (Throwable throwable2)
{
try
{
Class.forName("com.sun.media.protocol.vfw.DataSource");
string = new StringBuffer(String.valueOf(string)).append("Win32 Build\n").toString();
}
catch (Throwable throwable1)
{
string = new StringBuffer(String.valueOf(string)).append("All Java Build\n").toString();
}
}
try
{
JMFSecurityManager.loadLibrary("jmutil");
string = new StringBuffer(String.valueOf(string)).append("Native Libraries Found\n").toString();
}
catch (UnsatisfiedLinkError e)
{
string = new StringBuffer(String.valueOf(string)).append("Native Libraries Not Found\n").toString();
}
return string;
}
public QueryJMF20()
{
}
static
{
try
{
Class.forName("javax.media.Codec");
}
catch (Throwable throwable)
{
throw new RuntimeException("Not JMF 2.0");
}
}
}
作者:洞庭散人
出处:http://phinecos.cnblogs.com/
本博客遵从Creative Commons Attribution 3.0 License,若用于非商业目的,您可以自由转载,但请保留原作者信息和文章链接URL。
posted on 2007-09-22 22:22 Phinecos(洞庭散人) 阅读(792) 评论(1) 编辑 收藏 举报