    width = (decoder_ctx->width + 3) & ~3;
    height = decoder_ctx->height;
    visionbuf_compute_aligned_width_and_height(width, height, &aligned_width, &aligned_height);
  
    if (has_cuda_device && !no_cuda) {
      if (!initHardwareDecoder(AV_HWDEVICE_TYPE_CUDA)) {
        rWarning("No CUDA capable device was found. fallback to CPU decoding.");
      } else {
        nv12toyuv_buffer.resize(getYUVSize());
      }
    }
  
 
</s> remove   if (hw_pix_fmt == AV_PIX_FMT_CUDA) {
 </s> add   if (hw_pix_fmt == HW_PIX_FMT) { </s> remove     success = frames[id]->load(file, flags & REPLAY_FLAG_NO_CUDA, &abort_, local_cache, 20 * 1024 * 1024, 3);
 </s> add     success = frames[id]->load(file, flags & REPLAY_FLAG_NO_HW_DECODER, &abort_, local_cache, 20 * 1024 * 1024, 3); </s> remove     has_cuda_device = false;
 </s> add     has_hw_decoder = false; </s> remove   rWarning("Please run replay with the --no-cuda flag!");
 </s> add   rWarning("Please run replay with the --no-hw-decoder flag!"); </s> remove   bool load(const std::string &url, bool no_cuda = false, std::atomic<bool> *abort = nullptr, bool local_cache = false, int chunk_size = -1, int retries = 0);
  bool load(const std::byte *data, size_t size, bool no_cuda = false, std::atomic<bool> *abort = nullptr);
 </s> add   bool load(const std::string &url, bool no_hw_decoder = false, std::atomic<bool> *abort = nullptr, bool local_cache = false, int chunk_size = -1, int retries = 0);
  bool load(const std::byte *data, size_t size, bool no_hw_decoder = false, std::atomic<bool> *abort = nullptr);
  if (has_hw_decoder && !no_hw_decoder) {
    if (!initHardwareDecoder(HW_DEVICE_TYPE)) {
      rWarning("No device with hardware decoder found. fallback to CPU decoding.");
    width = (decoder_ctx->width + 3) & ~3;
    height = decoder_ctx->height;
    visionbuf_compute_aligned_width_and_height(width, height, &aligned_width, &aligned_height);
  
  if (has_hw_decoder && !no_hw_decoder) {
    if (!initHardwareDecoder(HW_DEVICE_TYPE)) {
      rWarning("No device with hardware decoder found. fallback to CPU decoding.");
  if (has_hw_decoder && !no_hw_decoder) {
    if (!initHardwareDecoder(HW_DEVICE_TYPE)) {
      rWarning("No device with hardware decoder found. fallback to CPU decoding.");
  if (has_hw_decoder && !no_hw_decoder) {
    if (!initHardwareDecoder(HW_DEVICE_TYPE)) {
      rWarning("No device with hardware decoder found. fallback to CPU decoding.");
      } else {
        nv12toyuv_buffer.resize(getYUVSize());
      }
    }
  
keep keep keep keep replace replace replace keep keep keep keep keep
 replay: use VideoToolbox HW decoder on Mac (#23832)

* replay: support VideoToolbox HW decoding

* rename flag

* remove debug assert 
selfdrive/ui/replay/framereader.cc