#ifndef PROBE_H
#define PROBE_H
#include "language.h"
#define PROBE_STREAM_LIMIT 64
typedef struct {
ValueType type;
size_t stream_index;
bool duration_known;
double duration;
char codec_name[32];
} ProbeStream;
typedef struct {
bool has_video;
bool has_audio;
bool has_subtitles;
bool video_duration_known;
bool audio_duration_known;
double video_duration;
double audio_duration;
bool subtitle_duration_known;
double subtitle_duration;
ProbeStream streams[PROBE_STREAM_LIMIT];
size_t stream_count;
} ProbeResult;
typedef bool (*ProbeRunner)(const char* path, ProbeResult* result, void* context, Error* error);
typedef struct ProbeCacheEntry ProbeCacheEntry;
typedef struct {
Arena arena;
ProbeCacheEntry* entries;
ProbeRunner runner;
void* runner_context;
size_t invocation_count;
} ProbeCache;
void probe_cache_init(ProbeCache* cache, ProbeRunner runner, void* context);
bool probe_cache_get(ProbeCache* cache, const char* path, ProbeResult* result, Error* error);
void probe_cache_destroy(ProbeCache* cache);
bool probe_run_ffprobe(const char* path, ProbeResult* result, void* context, Error* error);
#endif