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

📄 formattest.java

📁 FMJ(freedom media for java)是java视频开发的新选择
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
																						};			for (int i = 0; i < f2s.length; ++i)			{				H261Format f2 = f2s[i];				//System.out.println(f2);				assertFalse(f1.equals(f2));				assertTrue(f1.matches(f2));				assertFalse(f2.equals(f1));				assertTrue(f2.matches(f1));			}		}	}	public void testEqualsMatches_H263Format()	{		final H263Format f1 = new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 3, 4, 5, 6);		// equal and match:		{			final H263Format[] f2s = new H263Format[]{					new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 3, 4, 5, 6),						(H263Format) f1.clone(),						(H263Format) f1.intersects(f1)			};			for (int i = 0; i < f2s.length; ++i)			{				H263Format f2 = f2s[i];				assertTrue(f1.equals(f2));				assertTrue(f1.matches(f2));				assertTrue(f2.equals(f1));				assertTrue(f2.matches(f1));			}		}				// not equal and not match:		{			final H263Format[] f2s = new H263Format[]{					new H263Format(new Dimension(1, 2), 2000, Format.shortArray, 2.f, 1, 2, 3, 4, 5, 6),					new H263Format(new Dimension(1, 1), 2000, Format.byteArray, 2.f, 1, 2, 3, 4, 5, 6),					new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 3.f, 1, 2, 3, 4, 5, 6),					new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 11, 2, 3, 4, 5, 6),					new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 12, 3, 4, 5, 6),					new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 13, 4, 5, 6),					new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 3, 14, 5, 6),					new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 3, 4, 15, 6),					new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 3, 4, 5, 16),																																			};			for (int i = 0; i < f2s.length; ++i)			{				H263Format f2 = f2s[i];				//System.out.println(f2);				assertFalse(f1.equals(f2));				assertFalse(f1.matches(f2));				assertFalse(f2.equals(f1));				assertFalse(f2.matches(f1));			}		}		// not equal but match:		{						final H263Format[] f2s = new H263Format[]{					new H263Format(new Dimension(1, 1), 2001, Format.shortArray, 2.f, 1, 2, 3, 4, 5, 6),					new H263Format(null, 2000, Format.shortArray, 2.f, 1, 2, 3, 4, 5, 6),					new H263Format(new Dimension(1, 1), Format.NOT_SPECIFIED, Format.shortArray, 2.f, 1, 2, 3, 4, 5, 6),					new H263Format(new Dimension(1, 1), 2000, null, 2.f, 1, 2, 3, 4, 5, 6),					new H263Format(new Dimension(1, 1), 2000, Format.shortArray, Format.NOT_SPECIFIED, 1, 2, 3, 4, 5, 6),					new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, Format.NOT_SPECIFIED, 2, 3, 4, 5, 6),					new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, Format.NOT_SPECIFIED, 3, 4, 5, 6),					new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, Format.NOT_SPECIFIED, 4, 5, 6),					new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 3, Format.NOT_SPECIFIED, 5, 6),					new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 3, 4, Format.NOT_SPECIFIED, 6),					new H263Format(new Dimension(1, 1), 2000, Format.shortArray, 2.f, 1, 2, 3, 4, 5, Format.NOT_SPECIFIED),																																};			for (int i = 0; i < f2s.length; ++i)			{				H263Format f2 = f2s[i];				//System.out.println(f2);				assertFalse(f1.equals(f2));				assertTrue(f1.matches(f2));				assertFalse(f2.equals(f1));				assertTrue(f2.matches(f1));			}		}	}		public void testEqualsMatches_IndexedColorFormat2()	{		final byte[] arr1 = new byte[] {0, 0};		final byte[] arr2 = new byte[] {0, 0};		final byte[] arr3 = new byte[] {0, 0};				final IndexedColorFormat f1 = new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, arr1, arr2, arr3);		// IndexedColorFormat - equal and match:		{			final IndexedColorFormat[] f2s = new IndexedColorFormat[]{					new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, arr1, arr2, arr3),						(IndexedColorFormat) f1.clone(),						(IndexedColorFormat) f1.intersects(f1)			};			for (int i = 0; i < f2s.length; ++i)			{				IndexedColorFormat f2 = f2s[i];				assertTrue(f1.equals(f2));				assertTrue(f1.matches(f2));				assertTrue(f2.equals(f1));				assertTrue(f2.matches(f1));			}		}				// IndexedColorFormat - not equal and not match:		{						final IndexedColorFormat[] f2s = new IndexedColorFormat[]{					new IndexedColorFormat(new Dimension(1, 2), 2000, Format.byteArray, 3.f, 1, 2, arr1, arr2, arr3),					new IndexedColorFormat(new Dimension(1, 1), 2000, Format.shortArray, 3.f, 1, 2, arr1, arr2, arr3),					new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 4.f, 1, 2, arr1, arr2, arr3),					new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 11, 2, arr1, arr2, arr3),					new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 12, arr1, arr2, arr3),					new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, arr2, arr2, arr3),					new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, arr1, arr3, arr3),					new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, arr1, arr2, arr1),																																								};			for (int i = 0; i < f2s.length; ++i)			{				IndexedColorFormat f2 = f2s[i];				//System.out.println(f2);				assertFalse(f1.equals(f2));				assertFalse(f1.matches(f2));				assertFalse(f2.equals(f1));				assertFalse(f2.matches(f1));			}		}		// IndexedColorFormat - not equal but match:		{						final IndexedColorFormat[] f2s = new IndexedColorFormat[]{					new IndexedColorFormat(new Dimension(1, 1), 2001, Format.byteArray, 3.f, 1, 2, arr1, arr2, arr3),					new IndexedColorFormat(null, 2000, Format.byteArray, 3.f, 1, 2, arr1, arr2, arr3),					new IndexedColorFormat(new Dimension(1, 1), Format.NOT_SPECIFIED, Format.byteArray, 3.f, 1, 2, arr1, arr2, arr3),					new IndexedColorFormat(new Dimension(1, 1), 2000, null, 3.f, 1, 2, arr1, arr2, arr3),					new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, Format.NOT_SPECIFIED, 1, 2, arr1, arr2, arr3),					new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, Format.NOT_SPECIFIED, 2, arr1, arr2, arr3),					new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, Format.NOT_SPECIFIED, arr1, arr2, arr3),					new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, null, arr2, arr3),					new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, arr1, null, arr3),					new IndexedColorFormat(new Dimension(1, 1), 2000, Format.byteArray, 3.f, 1, 2, arr1, arr2, null),																																									};			for (int i = 0; i < f2s.length; ++i)			{				IndexedColorFormat f2 = f2s[i];				//System.out.println(f2);				assertFalse(f1.equals(f2));				assertTrue(f1.matches(f2));				assertFalse(f2.equals(f1));				assertTrue(f2.matches(f1));			}		}	}		public void testEqualsMatches_JPEGFormat()	{		final JPEGFormat f1 = new JPEGFormat(new Dimension(1, 1), 1000, Format.shortArray, 1.f, 2, 3);		// equal and match:		{			final JPEGFormat[] f2s = new JPEGFormat[]{					new JPEGFormat(new Dimension(1, 1), 1000, Format.shortArray, 1.f, 2, 3),						(JPEGFormat) f1.clone(),						(JPEGFormat) f1.intersects(f1)			};			for (int i = 0; i < f2s.length; ++i)			{				JPEGFormat f2 = f2s[i];				assertTrue(f1.equals(f2));				assertTrue(f1.matches(f2));				assertTrue(f2.equals(f1));				assertTrue(f2.matches(f1));			}		}				// not equal and not match:		{			final JPEGFormat[] f2s = new JPEGFormat[]{					new JPEGFormat(new Dimension(1, 2), 1000, Format.shortArray, 1.f, 2, 3),					new JPEGFormat(new Dimension(1, 1), 1000, Format.byteArray, 1.f, 2, 3),					new JPEGFormat(new Dimension(1, 1), 1000, Format.shortArray, 2.f, 2, 3),					new JPEGFormat(new Dimension(1, 1), 1000, Format.shortArray, 1.f, 12, 3),					new JPEGFormat(new Dimension(1, 1), 1000, Format.shortArray, 1.f, 2, 13),															};			for (int i = 0; i < f2s.length; ++i)			{				JPEGFormat f2 = f2s[i];				//System.out.println(f2);				assertFalse(f1.equals(f2));				assertFalse(f1.matches(f2));				assertFalse(f2.equals(f1));				assertFalse(f2.matches(f1));			}		}		// not equal but match:		{						final JPEGFormat[] f2s = new JPEGFormat[]{					new JPEGFormat(new Dimension(1, 1), 2000, Format.shortArray, 1.f, 2, 3),					new JPEGFormat(null, 1000, Format.shortArray, 1.f, 2, 3),					new JPEGFormat(new Dimension(1, 1), Format.NOT_SPECIFIED, Format.shortArray, 1.f, 2, 3),					new JPEGFormat(new Dimension(1, 1), 1000, null, 1.f, 2, 3),					new JPEGFormat(new Dimension(1, 1), 1000, Format.shortArray, Format.NOT_SPECIFIED, 2, 3),					new JPEGFormat(new Dimension(1, 1), 1000, Format.shortArray, 1.f, Format.NOT_SPECIFIED, 3),					new JPEGFormat(new Dimension(1, 1), 1000, Format.shortArray, 1.f, 2, Format.NOT_SPECIFIED),								};			for (int i = 0; i < f2s.length; ++i)			{				JPEGFormat f2 = f2s[i];				//System.out.println(f2);				assertFalse(f1.equals(f2));				assertTrue(f1.matches(f2));				assertFalse(f2.equals(f1));				assertTrue(f2.matches(f1));			}		}	}		public void testEqualsMatches_VideoFormat()	{		final VideoFormat f1 = new VideoFormat(VideoFormat.MPEG, new Dimension(0, 0), 1000, Format.byteArray, 1.f);		// equal and match:		{			final VideoFormat[] f2s = new VideoFormat[]{					new VideoFormat(VideoFormat.MPEG, new Dimension(0, 0), 1000, Format.byteArray, 1.f),						(VideoFormat) f1.clone(),						(VideoFormat) f1.intersects(f1)			};			for (int i = 0; i < f2s.length; ++i)			{				VideoFormat f2 = f2s[i];				assertTrue(f1.equals(f2));				assertTrue(f1.matches(f2));				assertTrue(f2.equals(f1));				assertTrue(f2.matches(f1));			}		}				// not equal and not match:		{			final VideoFormat[] f2s = new VideoFormat[]{					new VideoFormat(VideoFormat.CINEPAK, new Dimension(0, 0), 1000, Format.byteArray, 1.f),					new VideoFormat(VideoFormat.MPEG, new Dimension(1, 0), 1000, Format.byteArray, 1.f),					new VideoFormat(VideoFormat.MPEG, new Dimension(0, 0), 1000, Format.shortArray, 1.f),					new VideoFormat(VideoFormat.MPEG, new Dimension(0, 0), 1000, Format.byteArray, 2.f),															};			for (int i = 0; i < f2s.length; ++i)			{				VideoFormat f2 = f2s[i];				//System.out.println(f2);				assertFalse(f1.equals(f2));				assertFalse(f1.matches(f2));				assertFalse(f2.equals(f1));				assertFalse(f2.matches(f1));			}		}		// not equal but match:		{						final VideoFormat[] f2s = new VideoFormat[]{					new VideoFormat(VideoFormat.MPEG, new Dimension(0, 0), 2000, Format.byteArray, 1.f),					new VideoFormat(null, new Dimension(0, 0), 1000, Format.byteArray, 1.f),					new VideoFormat(VideoFormat.MPEG, null, 1000, Format.byteArray, 1.f),					new VideoFormat(VideoFormat.MPEG, new Dimension(0, 0), Format.NOT_SPECIFIED, Format.byteArray, 1.f),					new VideoFormat(VideoFormat.MPEG, new Dimension(0, 0), 1000, null, 1.f),					new VideoFormat(VideoFormat.MPEG, new Dimension(0, 0), 1000, Format.byteArray, Format.NOT_SPECIFIED),			};			for (int i = 0; i < f2s.length; ++i)			{				VideoFormat f2 = f2s[i];				//System.out.println(f2);				assertFalse(f1.equals(f2));				assertTrue(f1.matches(f2));				assertFalse(f2.equals(f1));				assertTrue(f2.matches(f1));			}		}	}		public void testEqualsMatches_Format()	{		final Format f1 = new Format("abc", Format.byteArray);				// equal and match:		{			final Format[] f2s = new Format[]{					new Format("abc", Format.byteArray),						(Format) f1.clone(),						(Format) f1.intersects(f1)			};			for (int i = 0; i < f2s.length; ++i)			{				Format f2 = f2s[i];				assertTrue(f1.equals(f2));				assertTrue(f1.matches(f2));				assertTrue(f2.equals(f1));				assertTrue(f2.matches(f1));			}		}				// not equal and not match:		{			final Format[] f2s = new Format[]{					new Format("xyz", Format.byteArray),					new Format("abc", Format.shortArray),					new Format("abc", Format.intArray),																							};			for (int i = 0; i < f2s.length; ++i)			{				Format f2 = f2s[i];				//System.out.println(f2);				assertFalse(f1.equals(f2));				assertFalse(f1.matches(f2));				assertFalse(f2.equals(f1));				assertFalse(f2.matches(f1));			}

⌨️ 快捷键说明

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