AndroidSequenceEncoder extends SequenceEncoder { public void encodeImage(Bitmap bi) throws IOException { encodeNativeFrame(BitmapUtil.fromBitmap(bi)); } AndroidSequenceEncoder(SeekableByteChannel ch, Rational fps); static AndroidSequenceEncoder createSequenceEncoder(File out, int fps); static AndroidSequenceEncoder create25Fps(File out); static AndroidSequenceEncoder create30Fps(File out); static AndroidSequenceEncoder create2997Fps(File out); static AndroidSequenceEncoder create24Fps(File out); void encodeImage(Bitmap bi);  }
@Test public void testEncoder() throws IOException { final Picture[] enc = new Picture[1]; File temp = File.createTempFile("temp-file-name", ".tmp"); AndroidSequenceEncoder se = new AndroidSequenceEncoder(NIOUtils.writableChannel(temp), Rational.ONE) { @Override public void encodeNativeFrame(Picture pic) throws IOException { enc[0] = pic; } }; final Picture pic = Picture.create(32, 32, ColorSpace.RGB); fillGradient(pic); se.encodeImage(new MyBitmap(pic)); Assert.assertNotNull(enc[0]); Assert.assertArrayEquals(pic.getPlaneData(0), enc[0].getPlaneData(0)); }