2012-04-03 17:19:18 +00:00
|
|
|
/* SSNES - A frontend for libretro.
|
2012-01-08 00:08:18 +00:00
|
|
|
* Copyright (C) 2010-2012 - Hans-Kristian Arntzen
|
2011-12-24 12:46:12 +00:00
|
|
|
*
|
|
|
|
* SSNES is free software: you can redistribute it and/or modify it under the terms
|
|
|
|
* of the GNU General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* SSNES is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with SSNES.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
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
|
|
|
|
|
|
|
|
// Parameters passed to ffemu_new()
|
|
|
|
struct ffemu_params
|
|
|
|
{
|
2011-11-16 17:56:42 +00:00
|
|
|
// FPS of input video.
|
|
|
|
double fps;
|
|
|
|
// Sample rate of input audio.
|
|
|
|
double samplerate;
|
|
|
|
|
2011-01-03 16:51:17 +00:00
|
|
|
// 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 16:51:17 +00:00
|
|
|
|
2011-11-16 17:56:42 +00:00
|
|
|
// Aspect ratio of input video. Parameters are passed to the muxer,
|
|
|
|
// the video itself is not scaled.
|
|
|
|
float aspect_ratio;
|
2011-01-03 16:51:17 +00:00
|
|
|
|
|
|
|
// Audio channels.
|
|
|
|
unsigned channels;
|
|
|
|
|
2011-08-11 03:25:31 +00:00
|
|
|
// If input is ARGB or XRGB1555.
|
|
|
|
bool rgb32;
|
|
|
|
|
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-11-22 16:27:02 +00:00
|
|
|
bool is_dupe;
|
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);
|
|
|
|
|
2011-11-16 17:56:42 +00:00
|
|
|
bool ffemu_push_video(ffemu_t *handle, const struct ffemu_video_data *data);
|
|
|
|
bool ffemu_push_audio(ffemu_t *handle, const struct ffemu_audio_data *data);
|
|
|
|
bool ffemu_finalize(ffemu_t *handle);
|
2011-01-03 16:51:17 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|