<?php

declare(strict_types=1);

namespace Drupal\ffmpeg_media\Service;

use Drupal\Core\Form\FormStateInterface;

/**
 * Interface for validating ProfileForm outputs and building codec option lists.
 *
 * @internal Runtime service, not part of the supported contrib extension API.
 */
interface ProfileFormValidatorInterface {

  /**
   * Validates all output configurations in the form state.
   *
   * Iterates over every numeric-keyed output in $form_state, checks
   * container/codec compatibility, audio codec compatibility, two-pass
   * support, and (when $hwAccel === 'required') hardware encoder availability.
   *
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The form state object, used both to read values and to set errors.
   * @param string $hwAccel
   *   The hardware acceleration setting from the profile form ('' or
   *   'required').
   */
  public function validateOutputs(FormStateInterface $form_state, string $hwAccel): void;

  /**
   * Gets video codec options grouped by patent status for a select element.
   *
   * @return array<string, array<string, string>>
   *   Nested options array with group labels as keys.
   */
  public function getGroupedCodecOptions(): array;

  /**
   * Gets audio codec options grouped by patent status for a select element.
   *
   * @return array<string, array<string, string|\Drupal\Core\StringTranslation\TranslatableMarkup>>
   *   Nested options array with group labels as keys.
   */
  public function getGroupedAudioCodecOptions(): array;

}
