test_class.file: domain/src/test/java/org/m4m/domain/pipeline/PushDataCommandHandlerTest.java
test_class.identifier: PushDataCommandHandlerTest
test_class.superclass: extends TestBase
test_case.body: @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));
      }
test_case.class_method_signature: PushDataCommandHandlerTest.decoderShouldAskCommandProcessorToProcessNextPair_IfNoFreeInputBuffers()
test_case.full_signature: @Test public void decoderShouldAskCommandProcessorToProcessNextPair_IfNoFreeInputBuffers()
test_case.identifier: decoderShouldAskCommandProcessorToProcessNextPair_IfNoFreeInputBuffers
test_case.invocations: construct frame with mediaSource construct withDequeueInputBufferIndex videoDecoder dequeue getInputCommandQueue handle equalsTo assertThat getInputCommandQueue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void decoderShouldAskCommandProcessorToProcessNextPair_IfNoFreeInputBuffers()
focal_class.declarator: output
focal_class.modifier: protected
focal_class.original_string: protected IOutput output;
focal_class.type: IOutput
focal_class.var_name: output
focal_class.declarator: plugin
focal_class.modifier: protected
focal_class.original_string: protected Plugin plugin;
focal_class.type: Plugin
focal_class.var_name: plugin
focal_class.declarator: inputWithAllocator
focal_class.modifier: private
focal_class.original_string: private IFrameAllocator inputWithAllocator;
focal_class.type: IFrameAllocator
focal_class.var_name: inputWithAllocator
focal_class.file: domain/src/main/java/org/m4m/domain/pipeline/PushDataCommandHandler.java
focal_class.identifier: PushDataCommandHandler
focal_class.interfaces: implements ICommandHandler
focal_class.class_method_signature: PushDataCommandHandler.PushDataCommandHandler(IOutput output, Plugin plugin, IFrameAllocator frameAllocator)
focal_class.full_signature: public  PushDataCommandHandler(IOutput output, Plugin plugin, IFrameAllocator frameAllocator)
focal_class.identifier: PushDataCommandHandler
focal_class.modifiers: public
focal_class.parameters: (IOutput output, Plugin plugin, IFrameAllocator frameAllocator)
focal_class.signature:  PushDataCommandHandler(IOutput output, Plugin plugin, IFrameAllocator frameAllocator)
focal_class.class_method_signature: PushDataCommandHandler.handle()
focal_class.full_signature: @Override public void handle()
focal_class.identifier: handle
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void handle()
focal_class.class_method_signature: PushDataCommandHandler.restoreCommands()
focal_class.full_signature: private void restoreCommands()
focal_class.identifier: restoreCommands
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void restoreCommands()
focal_method.body: @Override
      public void handle() {
          Frame frame = inputWithAllocator.findFreeFrame();
  
          if (frame == null) {
              //log.info("Decoder has no free input buffers");
              restoreCommands();
              return;
          }
  
          output.pull(frame);
          plugin.push(frame);
          plugin.checkIfOutputQueueHasData();
      }
focal_method.class_method_signature: PushDataCommandHandler.handle()
focal_method.full_signature: @Override public void handle()
focal_method.identifier: handle
focal_method.invocations: findFreeFrame restoreCommands pull push checkIfOutputQueueHasData
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void handle()