#pragma once

#include <cstdint>
#include <span>
#include <string>
#include <vector>

namespace smartcut::media {

struct HevcAccessUnit {
  std::size_t first_nal_offset{};
  std::size_t last_nal_end{};
  std::size_t nal_count{};
  bool random_access{};
  std::size_t rpu_count{};
  unsigned random_access_nal_type{};
  bool closed_random_access{};
  unsigned vcl_nal_type{};
};

struct HevcAccessUnitIndex {
  std::size_t input_bytes{};
  std::vector<HevcAccessUnit> access_units;
  std::string to_json() const;
};

HevcAccessUnitIndex index_hevc_annex_b(std::span<const std::uint8_t> bytes);

}  // namespace smartcut::media
