<?php

declare(strict_types=1);

namespace Drupal\ffmpeg_media\Attribute;

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

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

  /**
   * Constructs an FFmpegCodec attribute.
   *
   * @param string $id
   *   The plugin ID.
   * @param \Drupal\Core\StringTranslation\TranslatableMarkup $label
   *   The human-readable name of the codec.
   * @param \Drupal\Core\StringTranslation\TranslatableMarkup|null $description
   *   Optional description of the codec.
   * @param string $encoder
   *   The FFmpeg encoder name (e.g., 'libx264', 'libsvtav1').
   * @param array<int, string> $supportedContainers
   *   Array of supported container formats (e.g., ['mp4', 'mkv']).
   * @param bool $hardwareAccelerated
   *   Whether this codec supports hardware acceleration.
   * @param bool $twoPassSupported
   *   Whether this codec supports two-pass encoding.
   * @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 $encoder = '',
    public readonly array $supportedContainers = [],
    public readonly bool $hardwareAccelerated = FALSE,
    public readonly bool $twoPassSupported = FALSE,
    public readonly int $weight = 0,
    public readonly ?string $deriver = NULL,
  ) {}

}
