RetroArch/record/ffemu.h

92 lines
1.9 KiB
C
Raw Normal View History

2011-01-03 16:51:17 +00:00
#ifndef __FFEMU_H
#define __FFEMU_H
#include <stdint.h>
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
2011-01-03 19:46:50 +00:00
struct ffemu_rational
{
unsigned num;
unsigned den;
};
2011-01-03 16:51:17 +00:00
// Parameters passed to ffemu_new()
struct ffemu_params
{
// Desired output resolution.
unsigned out_width;
unsigned out_height;
2011-06-14 20:44:54 +00:00
// Total size of framebuffer used in input.
unsigned fb_width;
unsigned fb_height;
2011-01-03 19:46:50 +00:00
float aspect_ratio;
2011-01-03 16:51:17 +00:00
// FPS of video input.
2011-01-03 19:46:50 +00:00
struct ffemu_rational fps;
2011-01-03 16:51:17 +00:00
// Relative video quality. 0 is lossless (if available), 10 is very low quality.
// A value over 10 is codec defined if it will give even worse quality.
unsigned videoq;
// Define some video codec dependent option. (E.g. h264 profiles)
uint64_t video_opt;
// Audio sample rate.
unsigned samplerate;
// Audio channels.
unsigned channels;
2011-08-11 03:25:31 +00:00
// If input is ARGB or XRGB1555.
bool rgb32;
2011-01-03 16:51:17 +00:00
// Audio bits. Sample format is always signed PCM in native byte order.
//unsigned bits;
// Relative audio quality. 0 is lossless (if available), 10 is very low quality.
// A value over 10 is codec defined if it will give even worse quality.
// Some codecs might ignore this (lossless codecs such as FLAC).
unsigned audioq;
// Define some audio codec dependent option.
uint64_t audio_opt;
2011-01-04 14:44:05 +00:00
// Filename to dump to.
const char *filename;
2011-01-03 16:51:17 +00:00
};
struct ffemu_video_data
{
const void *data;
unsigned width;
unsigned height;
2011-01-03 19:46:50 +00:00
unsigned pitch;
2011-01-03 16:51:17 +00:00
};
struct ffemu_audio_data
{
const int16_t *data;
size_t frames;
};
typedef struct ffemu ffemu_t;
ffemu_t *ffemu_new(const struct ffemu_params *params);
void ffemu_free(ffemu_t* handle);
int ffemu_push_video(ffemu_t *handle, const struct ffemu_video_data *data);
int ffemu_push_audio(ffemu_t *handle, const struct ffemu_audio_data *data);
2011-01-04 14:44:05 +00:00
int ffemu_finalize(ffemu_t *handle);
2011-01-03 16:51:17 +00:00
#ifdef __cplusplus
}
#endif
#endif