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 configureDecoderWithChangedMediaFormat() throws RuntimeException {
          IOutput twoFilesMediaSource = create.multipleMediaSource()
                  .with(create.mediaSource().with(1).frame()
                          .with(create.videoFormat().withFrameSize(1024, 768).withBitRate(100).construct()))
                  .with(create.mediaSource().with(1).frame()
                          .with(create.videoFormat().withFrameSize(1024, 768).withBitRate(250).construct()))
                  .construct();
          IMediaCodec mediaCodec = create.mediaCodec().construct();
          VideoDecoder decoder = create.videoDecoder().with(mediaCodec).construct();
          twoFilesMediaSource.start();
          decoder.start();
          decoder.fillCommandQueues();
  
          PushDataCommandHandler pushDataCommandHandler = new PushDataCommandHandler(twoFilesMediaSource, decoder, decoder);
          pushDataCommandHandler.handle();
          OutputFormatChangedHandler outputFormatChangedHandler = new OutputFormatChangedHandler(twoFilesMediaSource, decoder, decoder);
          outputFormatChangedHandler.handle();
          pushDataCommandHandler.handle();
  
          ArgumentCaptor<VideoFormat> mediaFormatCaptor = ArgumentCaptor.forClass(VideoFormat.class);
          verify(mediaCodec).configure(mediaFormatCaptor.capture(), any(ISurfaceWrapper.class), anyInt());
          assertEquals(250, mediaFormatCaptor.getValue().getVideoBitRateInKBytes());
      }
test_case.class_method_signature: PushDataCommandHandlerTest.configureDecoderWithChangedMediaFormat()
test_case.full_signature: @Test public void configureDecoderWithChangedMediaFormat()
test_case.identifier: configureDecoderWithChangedMediaFormat
test_case.invocations: construct with with multipleMediaSource with frame with mediaSource construct withBitRate withFrameSize videoFormat with frame with mediaSource construct withBitRate withFrameSize videoFormat construct mediaCodec construct with videoDecoder start start fillCommandQueues handle handle handle forClass configure verify capture any anyInt assertEquals getVideoBitRateInKBytes getValue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void configureDecoderWithChangedMediaFormat()
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()