service-ingest.h 893 B

123456789101112131415161718192021222324252627282930
  1. #pragma once
  2. /* service-ingest.h is common between the Amazon IVS service
  3. * and the Twitch streaming service.
  4. */
  5. #include <file-updater/file-updater.h>
  6. #include <util/threading.h>
  7. struct ingest {
  8. char *name;
  9. char *url;
  10. char *rtmps_url;
  11. };
  12. struct service_ingests {
  13. update_info_t *update_info;
  14. pthread_mutex_t mutex;
  15. bool ingests_refreshed;
  16. bool ingests_refreshing;
  17. bool ingests_loaded;
  18. DARRAY(struct ingest) cur_ingests;
  19. const char *cache_old_filename;
  20. const char *cache_new_filename;
  21. };
  22. void init_service_data(struct service_ingests *si);
  23. void service_ingests_refresh(struct service_ingests *si, int seconds, const char *log_prefix, const char *file_url);
  24. void load_service_data(struct service_ingests *si, const char *cache_filename, struct ingest *def);
  25. void unload_service_data(struct service_ingests *si);
  26. struct ingest get_ingest(struct service_ingests *si, size_t idx);