Files
terebi/Sources/Core/cast_media.h
T

35 lines
1.2 KiB
C

#pragma once
#include <stdbool.h>
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct CastMedia CastMedia;
typedef struct CastMediaSource {
const char *video_url;
const char *video_headers;
const char *audio_url;
const char *audio_headers;
bool local;
bool restricted;
bool live;
double duration;
} CastMediaSource;
// create copies input. start/probe/destroy may block; call off the UI thread.
CastMedia *cast_media_create(const CastMediaSource *source, char error[512]);
bool cast_media_start(CastMedia *media, const char *receiver_host, char url[512], double *duration, char error[512]);
// Copies a validated UTF-8 WebVTT resource, at most 4 MiB/track and 32 tracks.
bool cast_media_subtitle(CastMedia *media, int identifier, const void *bytes, size_t size, char url[512]);
#ifdef CAST_MEDIA_CHECK
// Dedicated check build only: fixed monotonic clock; waits for publication.
bool cast_media_check_advance(CastMedia *media, double seconds);
#endif
// Nonblocking cancellation; destroy subsequently joins all workers and closes sockets.
void cast_media_cancel(CastMedia *media);
void cast_media_destroy(CastMedia *media);
#ifdef __cplusplus
}
#endif