  
    void publisher_init();
    static void publisher_publish(VideoEncoder *e, int segment_num, uint32_t idx, VisionIpcBufExtra &extra, unsigned int flags, kj::ArrayPtr<capnp::byte> header, kj::ArrayPtr<capnp::byte> dat);
  
    void writer_open(const char* path) {
      if (this->write) write_handler_thread = std::thread(VideoEncoder::write_handler, this, path);
    }
  
    void writer_close() {
      if (this->write) {
        to_write.push(NULL);
        write_handler_thread.join();
      }
      assert(to_write.empty());
    }
  
  protected:
    bool write;
    const char* filename;
    int in_width, in_height;
 
</s> remove   bool write;
 </s> add  </s> remove   writer_close();
 </s> add  </s> remove   writer_open(path);
 </s> add  </s> remove              int bitrate, cereal::EncodeIndex::Type codec, int out_width, int out_height, bool write) :
             VideoEncoder(filename, type, in_width, in_height, fps, bitrate, codec, out_width, out_height, write) { encoder_init(); }
 </s> add              int bitrate, cereal::EncodeIndex::Type codec, int out_width, int out_height) :
             VideoEncoder(filename, type, in_width, in_height, fps, bitrate, codec, out_width, out_height) { encoder_init(); } </s> remove                 int bitrate, cereal::EncodeIndex::Type codec, int out_width, int out_height, bool write) :
                VideoEncoder(filename, type, in_width, in_height, fps, bitrate, cereal::EncodeIndex::Type::BIG_BOX_LOSSLESS, out_width, out_height, write) { encoder_init(); }
 </s> add                 int bitrate, cereal::EncodeIndex::Type codec, int out_width, int out_height) :
                VideoEncoder(filename, type, in_width, in_height, fps, bitrate, cereal::EncodeIndex::Type::BIG_BOX_LOSSLESS, out_width, out_height) { encoder_init(); }
  
    void publisher_init();
    static void publisher_publish(VideoEncoder *e, int segment_num, uint32_t idx, VisionIpcBufExtra &extra, unsigned int flags, kj::ArrayPtr<capnp::byte> header, kj::ArrayPtr<capnp::byte> dat);
  











  
  protected:
    bool write;
    const char* filename;
    int in_width, in_height;
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Encoderd: encoders don't write, they only encode (#28499)

* Encoders dont write, they encode

* Delete words

* unused

---------

Co-authored-by: Harald Schaefer <torq_boi@Haralds-MacBook-Air.local>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> 
system/loggerd/encoder/encoder.h