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