2018-11-09 19:21:17 +08:00
|
|
|
#ifndef RECORDER_H
|
|
|
|
#define RECORDER_H
|
|
|
|
|
|
|
|
#include <libavformat/avformat.h>
|
|
|
|
#include <SDL2/SDL_stdinc.h>
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
|
|
|
|
struct recorder {
|
|
|
|
char *filename;
|
|
|
|
AVFormatContext *ctx;
|
|
|
|
struct size declared_frame_size;
|
2019-02-09 19:54:12 +08:00
|
|
|
SDL_bool header_written;
|
2018-11-09 19:21:17 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
SDL_bool recorder_init(struct recorder *recoder, const char *filename,
|
|
|
|
struct size declared_frame_size);
|
|
|
|
void recorder_destroy(struct recorder *recorder);
|
|
|
|
|
|
|
|
SDL_bool recorder_open(struct recorder *recorder, AVCodec *input_codec);
|
|
|
|
void recorder_close(struct recorder *recorder);
|
|
|
|
|
|
|
|
SDL_bool recorder_write(struct recorder *recorder, AVPacket *packet);
|
|
|
|
|
|
|
|
#endif
|