  class FrameReader {
  public:
    FrameReader();
    ~FrameReader();
    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);
    bool get(int idx, uint8_t *rgb, uint8_t *yuv);
    int getRGBSize() const { return aligned_width * aligned_height * 3; }
    int getYUVSize() const { return width * height * 3 / 2; }
    size_t getFrameCount() const { return packets.size(); }
    bool valid() const { return valid_; }
 
</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 bool FrameReader::load(const std::byte *data, size_t size, bool no_cuda, std::atomic<bool> *abort) {
 </s> add bool FrameReader::load(const std::byte *data, size_t size, bool no_hw_decoder, std::atomic<bool> *abort) { </s> remove bool FrameReader::load(const std::string &url, bool no_cuda, std::atomic<bool> *abort, bool local_cache, int chunk_size, int retries) {
 </s> add bool FrameReader::load(const std::string &url, bool no_hw_decoder, std::atomic<bool> *abort, bool local_cache, int chunk_size, int retries) { </s> remove     has_cuda_device = false;
 </s> add     has_hw_decoder = false;
  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);
  class FrameReader {
  public:
    FrameReader();
    ~FrameReader();
  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);
  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);
    bool get(int idx, uint8_t *rgb, uint8_t *yuv);
    int getRGBSize() const { return aligned_width * aligned_height * 3; }
    int getYUVSize() const { return width * height * 3 / 2; }
    size_t getFrameCount() const { return packets.size(); }
    bool valid() const { return valid_; }
keep keep keep keep 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.h