mmsplayer v2 java 之(mmsPlayer 播放类)

package com.weiny.mms;

public class mmsPlayer {
	private static mmsTrack mms=null;
	
	public native int openmms(String szUrl);
	public native int closemms();
/*
 * JNI INTERFACE
 */
	public static int open(int frequency, int channel, int bit)
	{
		if(mms!=null) close();
		mms=new mmsTrack(frequency,channel,bit);
		mms.init();
		return 0;
	}
	public static int write(byte []data, int offset, int length)
	{
		if(mms==null) return 1;
		return mms.playAudioTrack(data, offset, length);
	}
	public static int close()
	{
		if(mms==null) return 0;
		mms.release();
		mms=null;
		return 0;
	}
	static { 
	    	try
	    	{
	    		System.loadLibrary("mmsplayerV2");
	    	}
	    	catch(UnsatisfiedLinkError ex)
	    	{
	    		ex.printStackTrace();
	    	}
	}
}

版权所有,禁止转载

发布:http://blog.csdn.net/weinyzhou/article/details/7632736

posted @ 2012-06-05 00:18  weinyzhou  阅读(141)  评论(0编辑  收藏  举报