@Test public void decoderShouldAskCommandProcessorToProcessNextPair_IfNoFreeInputBuffers() { IOutput mediaSource = create.mediaSource().with(1).frame().construct(); VideoDecoder decoder = create.videoDecoder().withDequeueInputBufferIndex(-1).construct(); decoder.getInputCommandQueue().dequeue(); new PushDataCommandHandler(mediaSource, decoder, decoder).handle(); assertThat(decoder.getInputCommandQueue()).equalsTo(new Pair<Command, Integer>(Command.NextPair, 0), new Pair<Command, Integer>(Command.NeedData, 0)); }
@Override public void handle() { Frame frame = inputWithAllocator.findFreeFrame(); if (frame == null) { restoreCommands(); return; } output.pull(frame); plugin.push(frame); plugin.checkIfOutputQueueHasData(); }
PushDataCommandHandler implements ICommandHandler { @Override public void handle() { Frame frame = inputWithAllocator.findFreeFrame(); if (frame == null) { restoreCommands(); return; } output.pull(frame); plugin.push(frame); plugin.checkIfOutputQueueHasData(); } }
PushDataCommandHandler implements ICommandHandler { @Override public void handle() { Frame frame = inputWithAllocator.findFreeFrame(); if (frame == null) { restoreCommands(); return; } output.pull(frame); plugin.push(frame); plugin.checkIfOutputQueueHasData(); } PushDataCommandHandler(IOutput output, Plugin plugin, IFrameAllocator frameAllocator); }
PushDataCommandHandler implements ICommandHandler { @Override public void handle() { Frame frame = inputWithAllocator.findFreeFrame(); if (frame == null) { restoreCommands(); return; } output.pull(frame); plugin.push(frame); plugin.checkIfOutputQueueHasData(); } PushDataCommandHandler(IOutput output, Plugin plugin, IFrameAllocator frameAllocator); @Override void handle(); }
PushDataCommandHandler implements ICommandHandler { @Override public void handle() { Frame frame = inputWithAllocator.findFreeFrame(); if (frame == null) { restoreCommands(); return; } output.pull(frame); plugin.push(frame); plugin.checkIfOutputQueueHasData(); } PushDataCommandHandler(IOutput output, Plugin plugin, IFrameAllocator frameAllocator); @Override void handle();  }