#ifndef WEBRTCPUSH_H264_READER_H
#define WEBRTCPUSH_H264_READER_H

#include <glib.h>
#include <stddef.h>
#include <stdint.h>

typedef struct H264Reader H264Reader;

H264Reader *h264_reader_open(const char *path, char **error_message);
void h264_reader_close(H264Reader *reader);

/* Returned data belongs to reader and stays valid until the next call. */
gboolean h264_reader_next(H264Reader *reader, gboolean force_idr,
                          const uint8_t **data, size_t *size,
                          gboolean *is_idr);

size_t h264_reader_frame_count(const H264Reader *reader);

#endif
