#pragma once

#include <cstdint>
#include <string>

namespace smartcut::media {

enum class VideoOutputCodec { source, mpeg2, h264, hevc, av1, vp9, ffv1, prores };
enum class VideoHardwareEncoder { automatic, software, qsv, nvenc, amf, vulkan };

struct VideoTransformOptions {
  VideoOutputCodec codec = VideoOutputCodec::source;
  VideoHardwareEncoder hardware = VideoHardwareEncoder::automatic;
  int width = 0;
  int height = 0;
  int bit_depth = 0;
  int bitrate_kbps = 0;
  int max_bitrate_kbps = 0;
  std::string aspect_ratio = "No Change";
  std::string deinterlace = "None";
  std::string frame_rate = "No Change";
  bool trial_watermark = false;
};

VideoOutputCodec video_output_codec_from_name(const std::string& name);
VideoHardwareEncoder video_hardware_encoder_from_name(const std::string& name);
bool video_transform_requested(const VideoTransformOptions& options);

std::string transcode_mkv_video_range(const std::string& input, const std::string& output,
                                      std::uint64_t first_frame, std::uint64_t end_frame,
                                      const VideoTransformOptions& options);
std::string validate_transcoded_video(const std::string& output,
                                      const VideoTransformOptions& options);
std::string video_encoder_capabilities_report();

}  // namespace smartcut::media
