VideoEncoder extends Encoder implements ITransform { public VideoEncoder(IMediaCodec mediaCodec) { super(mediaCodec); } VideoEncoder(IMediaCodec mediaCodec); @Override void setMediaFormat(MediaFormat inputMediaFormat); void setBitRateInKBytes(int bitRate); int getBitRateInKBytes(); void setFrameRate(int frameRate); int getFrameRate(); void setIFrameInterval(int iFrameInterval); int getIFrameInterval(); @Override boolean isLastFile(); @Override void setOutputSurface(ISurface surface); @Override void waitForSurface(long pts); @Override void drain(int bufferIndex); @Override void push(Frame frame); @Override void notifySurfaceReady(ISurface surface); @Override void releaseOutputBuffer(int outputBufferIndex);  }
@Test public void getSimpleSurface_whenContextIsSpecified_usesSpecifiedContext() { IEglContext eglContext = mock(IEglContext.class); PreviewContext previewContext = new PreviewContext(null, 0, eglContext); IMediaCodec mediaCodec = create.mediaCodec().construct(); VideoEncoder videoEncoder = create.videoEncoder().with(mediaCodec).construct(); videoEncoder.getSimpleSurface(previewContext.getEglContext()); verify(mediaCodec).createSimpleInputSurface(eq(eglContext)); }
@Test public void uponEncoderStart_CommandQueuesAreEmpty() { VideoEncoder videoEncoder = create.videoEncoder().construct(); videoEncoder.start(); assertThat(videoEncoder.getInputCommandQueue()).isEmpty(); assertThat(videoEncoder.getOutputCommandQueue()).isEmpty(); }