<?php

declare(strict_types=1);

namespace Drupal\ffmpeg_media\Attribute;

use Drupal\Component\Plugin\Attribute\Plugin;
use Drupal\Core\StringTranslation\TranslatableMarkup;

/**
 * Attribute for FFmpeg output format plugins.
 */
#[\Attribute(\Attribute::TARGET_CLASS)]
final class FFmpegOutput extends Plugin {

  /**
   * Constructs an FFmpegOutput attribute.
   *
   * @param string $id
   *   The plugin ID.
   * @param \Drupal\Core\StringTranslation\TranslatableMarkup $label
   *   The human-readable name of the output format.
   * @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $description
   *   Optional description of the output format.
   * @param string $extension
   *   File extension (e.g., 'mp4', 'webm').
   * @param string $mimeType
   *   MIME type (e.g., 'video/mp4', 'video/webm').
   * @param array<int, string> $supportedCodecs
   *   Array of supported codec plugin IDs.
   * @param string $defaultCodec
   *   Default codec plugin ID for this output.
   * @param array<int, string> $supportedAudioCodecs
   *   Array of supported audio codec IDs. Empty array means all are allowed.
   * @param bool $supportsAudio
   *   Whether this output format supports audio (FALSE for image-only).
   * @param int $weight
   *   Plugin weight for ordering.
   * @param class-string|null $deriver
   *   Optional deriver class.
   */
  public function __construct(
    public readonly string $id,
    public readonly TranslatableMarkup $label,
    public readonly ?TranslatableMarkup $description = NULL,
    public readonly string $extension = '',
    public readonly string $mimeType = 'application/octet-stream',
    public readonly array $supportedCodecs = [],
    public readonly string $defaultCodec = '',
    public readonly array $supportedAudioCodecs = [],
    public readonly bool $supportsAudio = TRUE,
    public readonly int $weight = 0,
    public readonly ?string $deriver = NULL,
  ) {}

}
