code: def _update_recording(self, frame, config):
      '''Adds a frame to the current video output.'''
      # pylint: disable=redefined-variable-type
      should_record = config['is_recording']
  
      if should_record:
        if not self.is_recording:
          self.is_recording = True
          logger.info(
              'Starting recording using %s',
              self.video_writer.current_output().name())
        self.video_writer.write_frame(frame)
      elif self.is_recording:
        self.is_recording = False
        self.video_writer.finish()
        logger.info('Finished recording'f _update_recording(self, frame, config):
      '''Adds a frame to the current video output.'''
      # pylint: disable=redefined-variable-type
      should_record = config['is_recording']
  
      if should_record:
        if not self.is_recording:
          self.is_recording = True
          logger.info(
              'Starting recording using %s',
              self.video_writer.current_output().name())
        self.video_writer.write_frame(frame)
      elif self.is_recording:
        self.is_recording = False
        self.video_writer.finish()
        logger.info('Finished recording')
docs: Adds a frame to the current video output.