Plugin extends Input implements ITransform, IPluginOutput { @Override public MediaFormatType getMediaFormatType() { if (mediaFormat.getMimeType().startsWith("audio")) { return MediaFormatType.AUDIO; } return MediaFormatType.VIDEO; } protected  Plugin(); void checkIfOutputQueueHasData(); void notifySurfaceReady(ISurface surface); @Override CommandQueue getOutputCommandQueue(); abstract void start(); abstract void stop(); @Override void push(Frame frame); @Override MediaFormatType getMediaFormatType(); @Override MediaFormat getMediaFormatByType(MediaFormatType mediaFormatType); @Override MediaFormat getOutputMediaFormat(); @Override void incrementConnectedPluginsCount(); @Override boolean canConnectFirst(IInputRaw connector); boolean canConnectFirst(IOutputRaw connector); @Override void recreate(); void setInputResolution(Resolution resolution);  }
@Test public void getMediaFormatType_Audio() { AudioFormat audioFormat = create.audioFormat().construct(); AudioEncoder audioEncoder = create.audioEncoder().construct(); AndroidMediaObjectFactoryFake factory = new AndroidMediaObjectFactoryFake(create); factory.withAudioEncoder(audioEncoder); new CameraCapture(factory, progressListener).setTargetAudioFormat(audioFormat); assertEquals(MediaFormatType.AUDIO, audioEncoder.getMediaFormatType()); }
@Test public void getMediaFormatType_Video() { VideoFormat videoFormat = create.videoFormat().withVideoBitRateInKBytes(0).withFrameRate(0).withIFrameInterval(0).construct(); VideoEncoder videoEncoder = create.videoEncoder().construct(); AndroidMediaObjectFactoryFake factory = new AndroidMediaObjectFactoryFake(create); factory.withVideoEncoder(videoEncoder); new CameraCapture(factory, progressListener).setTargetVideoFormat(videoFormat); assertEquals(MediaFormatType.VIDEO, videoEncoder.getMediaFormatType()); }