Change HAVE_FFMPEG ifdefs into HAVE_RECORD - recording will get

a proper interface soon so there can be multiple implementations
instead of just ffmpeg
This commit is contained in:
twinaphex 2014-05-03 00:21:07 +02:00
parent d56f1e0104
commit 08965cfa0d
7 changed files with 22 additions and 22 deletions

View File

@ -328,7 +328,7 @@ endif
ifeq ($(HAVE_FFMPEG), 1)
OBJ += record/ffemu.o
LIBS += $(AVCODEC_LIBS) $(AVFORMAT_LIBS) $(AVUTIL_LIBS) $(SWSCALE_LIBS)
DEFINES += $(AVCODEC_CFLAGS) $(AVFORMAT_CFLAGS) $(AVUTIL_CFLAGS) $(SWSCALE_CFLAGS)
DEFINES += $(AVCODEC_CFLAGS) $(AVFORMAT_CFLAGS) $(AVUTIL_CFLAGS) $(SWSCALE_CFLAGS) -DHAVE_RECORD
endif
ifeq ($(HAVE_DYNAMIC), 1)

View File

@ -249,7 +249,7 @@ endif
ifeq ($(HAVE_FFMPEG), 1)
LIBS += -lavformat -lavcodec -lavutil -lswscale -lws2_32 -lz
DEFINES += -DHAVE_FFMPEG -Iffmpeg
DEFINES += -DHAVE_FFMPEG -DHAVE_RECORD -Iffmpeg
OBJ += record/ffemu.o
endif

View File

@ -700,7 +700,7 @@ bool driver_update_system_av_info(const struct retro_system_av_info *info)
rarch_set_fullscreen(g_settings.video.fullscreen);
// Cannot continue recording with different parameters.
// Take the easiest route out and just restart the recording.
#ifdef HAVE_FFMPEG
#ifdef HAVE_RECORD
if (g_extern.recording)
{
static const char *msg = "Restarting FFmpeg recording due to driver reinit.";

View File

@ -814,7 +814,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
RARCH_LOG("Environ SET_AUDIO_CALLBACK.\n");
const struct retro_audio_callback *info = (const struct retro_audio_callback*)data;
#ifdef HAVE_FFMPEG
#ifdef HAVE_RECORD
if (g_extern.recording) // A/V sync is a must.
return false;
#endif

View File

@ -588,7 +588,7 @@ struct global
#endif
// FFmpeg record.
#ifdef HAVE_FFMPEG
#ifdef HAVE_RECORD
ffemu_t *rec;
char record_path[PATH_MAX];
char record_config[PATH_MAX];
@ -747,7 +747,7 @@ void rarch_save_state(void);
void rarch_state_slot_increase(void);
void rarch_state_slot_decrease(void);
#ifdef HAVE_FFMPEG
#ifdef HAVE_RECORD
void rarch_init_recording(void);
void rarch_deinit_recording(void);
#endif

View File

@ -58,7 +58,7 @@
gl->ctx_driver->write_egl_image(gl, frame, width, height, pitch, base_size, tex_index,img)
#endif
#if defined(HAVE_FFMPEG) && (!defined(HAVE_OPENGLES) || defined(HAVE_OPENGLES3))
#if defined(HAVE_RECORD) && (!defined(HAVE_OPENGLES) || defined(HAVE_OPENGLES3))
#define HAVE_GL_ASYNC_READBACK
#endif

View File

@ -211,7 +211,7 @@ static void readjust_audio_input_rate(void)
// g_extern.audio_data.src_ratio, g_extern.audio_data.orig_src_ratio);
}
#ifdef HAVE_FFMPEG
#ifdef HAVE_RECORD
static void recording_dump_frame(const void *data, unsigned width, unsigned height, size_t pitch)
{
struct ffemu_video_data ffemu_data = {0};
@ -298,7 +298,7 @@ static void video_frame(const void *data, unsigned width, unsigned height, size_
// Slightly messy code,
// but we really need to do processing before blocking on VSync for best possible scheduling.
#ifdef HAVE_FFMPEG
#ifdef HAVE_RECORD
if (g_extern.recording && (!g_extern.filter.filter || !g_settings.video.post_filter_record || !data || g_extern.record_gpu_buffer))
recording_dump_frame(data, width, height, pitch);
#endif
@ -323,7 +323,7 @@ static void video_frame(const void *data, unsigned width, unsigned height, size_
data, width, height, pitch);
RARCH_PERFORMANCE_STOP(softfilter_process);
#ifdef HAVE_FFMPEG
#ifdef HAVE_RECORD
if (g_extern.recording && g_settings.video.post_filter_record)
recording_dump_frame(g_extern.filter.buffer, owidth, oheight, opitch);
#endif
@ -337,7 +337,7 @@ static void video_frame(const void *data, unsigned width, unsigned height, size_
void rarch_render_cached_frame(void)
{
#ifdef HAVE_FFMPEG
#ifdef HAVE_RECORD
// Cannot allow FFmpeg recording when pushing duped frames.
bool recording = g_extern.recording;
g_extern.recording = false;
@ -355,14 +355,14 @@ void rarch_render_cached_frame(void)
g_extern.frame_cache.height,
g_extern.frame_cache.pitch);
#ifdef HAVE_FFMPEG
#ifdef HAVE_RECORD
g_extern.recording = recording;
#endif
}
static bool audio_flush(const int16_t *data, size_t samples)
{
#ifdef HAVE_FFMPEG
#ifdef HAVE_RECORD
if (g_extern.recording)
{
struct ffemu_audio_data ffemu_data = {0};
@ -802,7 +802,7 @@ static void print_help(void)
puts("\t\tAvailable commands are listed if command is invalid.");
#endif
#ifdef HAVE_FFMPEG
#ifdef HAVE_RECORD
puts("\t-r/--record: Path to record video file.\n\t\tUsing .mkv extension is recommended.");
puts("\t--recordconfig: Path to settings used during recording.");
puts("\t--size: Overrides output video size when recording with FFmpeg (format: WIDTHxHEIGHT).");
@ -913,7 +913,7 @@ static void parse_input(int argc, char *argv[])
{ "help", 0, NULL, 'h' },
{ "save", 1, NULL, 's' },
{ "fullscreen", 0, NULL, 'f' },
#ifdef HAVE_FFMPEG
#ifdef HAVE_RECORD
{ "record", 1, NULL, 'r' },
{ "recordconfig", 1, &val, 'R' },
{ "size", 1, &val, 's' },
@ -951,7 +951,7 @@ static void parse_input(int argc, char *argv[])
{ NULL, 0, NULL, 0 }
};
#ifdef HAVE_FFMPEG
#ifdef HAVE_RECORD
#define FFMPEG_RECORD_ARG "r:"
#else
#define FFMPEG_RECORD_ARG
@ -1060,7 +1060,7 @@ static void parse_input(int argc, char *argv[])
strlcpy(g_extern.config_path, optarg, sizeof(g_extern.config_path));
break;
#ifdef HAVE_FFMPEG
#ifdef HAVE_RECORD
case 'r':
strlcpy(g_extern.record_path, optarg, sizeof(g_extern.record_path));
g_extern.recording = true;
@ -1176,7 +1176,7 @@ static void parse_input(int argc, char *argv[])
g_extern.block_patch = true;
break;
#ifdef HAVE_FFMPEG
#ifdef HAVE_RECORD
case 's':
{
if (sscanf(optarg, "%ux%u", &g_extern.record_width, &g_extern.record_height) != 2)
@ -1293,7 +1293,7 @@ static inline void save_files(void)
}
}
#ifdef HAVE_FFMPEG
#ifdef HAVE_RECORD
void rarch_init_recording(void)
{
if (!g_extern.recording)
@ -2944,7 +2944,7 @@ int rarch_main_init(int argc, char *argv[])
init_controllers();
#ifdef HAVE_FFMPEG
#ifdef HAVE_RECORD
rarch_init_recording();
#endif
@ -3014,7 +3014,7 @@ static inline void update_frame_time(void)
retro_time_t delta = 0;
bool is_locked_fps = g_extern.is_paused || driver.nonblock_state;
#ifdef HAVE_FFMPEG
#ifdef HAVE_RECORD
is_locked_fps |= g_extern.recording;
#endif
@ -3145,7 +3145,7 @@ void rarch_main_deinit(void)
rarch_deinit_autosave();
#endif
#ifdef HAVE_FFMPEG
#ifdef HAVE_RECORD
rarch_deinit_recording();
#endif