Files
Juli bd05fca812 Add opentopia.com as a second camera provider
Listing pages (rated/newest) and per-camera pages are fetched over HTTPS
with the certificate bundle; the camera page's Live Feed mode yields the
camera's own MJPEG URL (Current Still as fallback), resolved just before
playing and cached in favourites. New Provider menu row: insecam /
opentopia / mixed. cam_info_t gains provider + title fields and the
settings blob a version byte; older favourites and settings still load.
2026-09-17 02:04:57 +02:00

27 lines
1.1 KiB
C

#pragma once
#include <stddef.h>
#include <stdint.h>
#include "esp_err.h"
typedef enum { PROVIDER_INSECAM = 0, PROVIDER_OPENTOPIA = 1 } provider_t;
typedef struct {
uint32_t id; // view id on the provider's site
char url[300]; // direct camera URL (may contain a COUNTER placeholder); empty until resolved
char place[64]; // "Imola, Italy" (ASCII-folded for the built-in font)
char maker[24]; // "Mobotix" (insecam)
// appended later; older favourite blobs without these fields still load
uint8_t provider; // provider_t
char title[40]; // camera name (opentopia)
} cam_info_t;
typedef enum { INSECAM_BY_RATING, INSECAM_BY_NEW } insecam_listing_t;
// Copies the camera URL with any COUNTER placeholder replaced by a fresh random number.
void insecam_effective_url(const cam_info_t *cam, char *out, size_t cap);
// Downloads one listing page (six cameras) and parses it. total_pages is
// updated from the page's own paginator when found.
esp_err_t insecam_fetch_page(insecam_listing_t listing, int page, cam_info_t *out, int max,
int *count, int *total_pages);