@Test public void handleEof() { decoder = create.videoDecoder().whichDecodesTo(Frame.EOF()).construct(); decoder.push(Frame.EOF()); decoder.start(); new CopyDataCommandHandler(decoder, encoder).handle(); verify(mediaCodec).queueInputBuffer(anyInt(), anyInt(), anyInt(), anyLong(), eq(IMediaCodec.BUFFER_FLAG_END_OF_STREAM)); }
@Override public void handle() { Frame encoderFrame = input.findFreeFrame(); if (encoderFrame == null) { restoreCommands(); return; } Frame decoderFrame = output.getFrame(); if (decoderFrame == null) return; encoderFrame.copyDataFrom(decoderFrame); input.push(encoderFrame); output.releaseOutputBuffer(decoderFrame.getBufferIndex()); }
CopyDataCommandHandler implements ICommandHandler { @Override public void handle() { Frame encoderFrame = input.findFreeFrame(); if (encoderFrame == null) { restoreCommands(); return; } Frame decoderFrame = output.getFrame(); if (decoderFrame == null) return; encoderFrame.copyDataFrom(decoderFrame); input.push(encoderFrame); output.releaseOutputBuffer(decoderFrame.getBufferIndex()); } }
CopyDataCommandHandler implements ICommandHandler { @Override public void handle() { Frame encoderFrame = input.findFreeFrame(); if (encoderFrame == null) { restoreCommands(); return; } Frame decoderFrame = output.getFrame(); if (decoderFrame == null) return; encoderFrame.copyDataFrom(decoderFrame); input.push(encoderFrame); output.releaseOutputBuffer(decoderFrame.getBufferIndex()); } CopyDataCommandHandler(IPluginOutput output, MediaCodecPlugin input); }
CopyDataCommandHandler implements ICommandHandler { @Override public void handle() { Frame encoderFrame = input.findFreeFrame(); if (encoderFrame == null) { restoreCommands(); return; } Frame decoderFrame = output.getFrame(); if (decoderFrame == null) return; encoderFrame.copyDataFrom(decoderFrame); input.push(encoderFrame); output.releaseOutputBuffer(decoderFrame.getBufferIndex()); } CopyDataCommandHandler(IPluginOutput output, MediaCodecPlugin input); @Override void handle(); }
CopyDataCommandHandler implements ICommandHandler { @Override public void handle() { Frame encoderFrame = input.findFreeFrame(); if (encoderFrame == null) { restoreCommands(); return; } Frame decoderFrame = output.getFrame(); if (decoderFrame == null) return; encoderFrame.copyDataFrom(decoderFrame); input.push(encoderFrame); output.releaseOutputBuffer(decoderFrame.getBufferIndex()); } CopyDataCommandHandler(IPluginOutput output, MediaCodecPlugin input); @Override void handle();  }