@Test public void shouldSkipEof() throws RuntimeException { IOutput twoFilesMediaSource = create.multipleMediaSource() .with(create.mediaSource().with(1).frame(1, 1, 1)) .with(create.mediaSource().with(1).frame(2, 2, 2)) .construct(); ByteBuffer decoderInputBuffer = create.byteBuffer(0, 0, 0); IMediaCodec mediaCodec = create.mediaCodec().construct(); when(mediaCodec.getInputBuffers()).thenReturn(new ByteBuffer[]{decoderInputBuffer}); VideoDecoder decoder = create.videoDecoder().with(mediaCodec).construct(); twoFilesMediaSource.start(); decoder.start(); decoder.fillCommandQueues(); PushDataCommandHandler pushDataCommandHandler = new PushDataCommandHandler(twoFilesMediaSource, decoder, decoder); pushDataCommandHandler.handle(); pushDataCommandHandler.handle(); assertEquals(create.byteBuffer(2, 2, 2), decoderInputBuffer); }
@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();  }