⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 awtrenderertest.java

📁 FMJ(freedom media for java)是java视频开发的新选择
💻 JAVA
字号:
package net.sf.fmj.test.compat.sun;import javax.media.Format;import javax.media.format.RGBFormat;import javax.media.renderer.VideoRenderer;import net.sf.fmj.utility.ClasspathChecker;import net.sf.fmj.utility.OSUtils;import junit.framework.TestCase;import com.sun.media.renderer.video.AWTRenderer;/** *  * @author Ken Larson * */public class AWTRendererTest extends TestCase{		public void testAWTRenderer()	{		VideoRenderer r = new AWTRenderer();		//System.out.println(r.getName());		assertEquals(r.getName(), "AWT Renderer");		//System.out.println(r.getBounds());		assertTrue(r.getBounds() == null);		//System.out.println(r.getComponent());		assertTrue(r.getComponent() != null);				//System.out.println(r.getControls());		Object[] controls = r.getControls();		assertEquals(controls.length, 1);		assertEquals(controls[0], r);//		for (int i = 0; i < controls.length; ++i)//		{	Object control = controls[i];//			System.out.println("\t" + control.getClass());//			System.out.println("\t" + control);//			System.out.println("\t" + (control == r));//			//		}				final Format[] supportedInputFormats;						if (OSUtils.isMacOSX() && !ClasspathChecker.checkManagerImplementation()) // TODO: why do we get two of the same on the mac using JMF?		{			supportedInputFormats = new Format[] {					//RGB, 32-bit, Masks=16711680:65280:255, LineStride=-1, class [I					new RGBFormat(null, -1, Format.intArray, -1.0f, 32, 0xff0000, 0xff00, 0xff, 1, -1, 0, -1),										// TODO: why do we get two of the same on the mac using JMF?					new RGBFormat(null, -1, Format.intArray, -1.0f, 32, 0xff0000, 0xff00, 0xff, 1, -1, 0, -1),								};		}		else		{			supportedInputFormats = new Format[] {					//RGB, 32-bit, Masks=16711680:65280:255, LineStride=-1, class [I					new RGBFormat(null, -1, Format.intArray, -1.0f, 32, 0xff0000, 0xff00, 0xff, 1, -1, 0, -1),										//RGB, 32-bit, Masks=255:65280:16711680, LineStride=-1, class [I					new RGBFormat(null, -1, Format.intArray, -1.0f, 32, 0xff, 0xff00, 0xff0000, 1, -1, 0, -1)								};		}				final Format[] formats = r.getSupportedInputFormats();		assertEquals(formats.length, supportedInputFormats.length);						for (int i = 0; i < formats.length; ++i)		{	Format format = formats[i];//			System.out.println("\t" + format);//			if (!format.equals(supportedInputFormats[i]))//				System.err.println("Not equal: " + format + " " + supportedInputFormats[i]);			assertEquals(format, supportedInputFormats[i]);					}							}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -