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:
parent
d56f1e0104
commit
08965cfa0d
2
Makefile
2
Makefile
|
@ -328,7 +328,7 @@ endif
|
||||||
ifeq ($(HAVE_FFMPEG), 1)
|
ifeq ($(HAVE_FFMPEG), 1)
|
||||||
OBJ += record/ffemu.o
|
OBJ += record/ffemu.o
|
||||||
LIBS += $(AVCODEC_LIBS) $(AVFORMAT_LIBS) $(AVUTIL_LIBS) $(SWSCALE_LIBS)
|
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
|
endif
|
||||||
|
|
||||||
ifeq ($(HAVE_DYNAMIC), 1)
|
ifeq ($(HAVE_DYNAMIC), 1)
|
||||||
|
|
|
@ -249,7 +249,7 @@ endif
|
||||||
|
|
||||||
ifeq ($(HAVE_FFMPEG), 1)
|
ifeq ($(HAVE_FFMPEG), 1)
|
||||||
LIBS += -lavformat -lavcodec -lavutil -lswscale -lws2_32 -lz
|
LIBS += -lavformat -lavcodec -lavutil -lswscale -lws2_32 -lz
|
||||||
DEFINES += -DHAVE_FFMPEG -Iffmpeg
|
DEFINES += -DHAVE_FFMPEG -DHAVE_RECORD -Iffmpeg
|
||||||
OBJ += record/ffemu.o
|
OBJ += record/ffemu.o
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
2
driver.c
2
driver.c
|
@ -700,7 +700,7 @@ bool driver_update_system_av_info(const struct retro_system_av_info *info)
|
||||||
rarch_set_fullscreen(g_settings.video.fullscreen);
|
rarch_set_fullscreen(g_settings.video.fullscreen);
|
||||||
// Cannot continue recording with different parameters.
|
// Cannot continue recording with different parameters.
|
||||||
// Take the easiest route out and just restart the recording.
|
// Take the easiest route out and just restart the recording.
|
||||||
#ifdef HAVE_FFMPEG
|
#ifdef HAVE_RECORD
|
||||||
if (g_extern.recording)
|
if (g_extern.recording)
|
||||||
{
|
{
|
||||||
static const char *msg = "Restarting FFmpeg recording due to driver reinit.";
|
static const char *msg = "Restarting FFmpeg recording due to driver reinit.";
|
||||||
|
|
|
@ -814,7 +814,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
||||||
RARCH_LOG("Environ SET_AUDIO_CALLBACK.\n");
|
RARCH_LOG("Environ SET_AUDIO_CALLBACK.\n");
|
||||||
const struct retro_audio_callback *info = (const struct retro_audio_callback*)data;
|
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.
|
if (g_extern.recording) // A/V sync is a must.
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -588,7 +588,7 @@ struct global
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// FFmpeg record.
|
// FFmpeg record.
|
||||||
#ifdef HAVE_FFMPEG
|
#ifdef HAVE_RECORD
|
||||||
ffemu_t *rec;
|
ffemu_t *rec;
|
||||||
char record_path[PATH_MAX];
|
char record_path[PATH_MAX];
|
||||||
char record_config[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_increase(void);
|
||||||
void rarch_state_slot_decrease(void);
|
void rarch_state_slot_decrease(void);
|
||||||
|
|
||||||
#ifdef HAVE_FFMPEG
|
#ifdef HAVE_RECORD
|
||||||
void rarch_init_recording(void);
|
void rarch_init_recording(void);
|
||||||
void rarch_deinit_recording(void);
|
void rarch_deinit_recording(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -58,7 +58,7 @@
|
||||||
gl->ctx_driver->write_egl_image(gl, frame, width, height, pitch, base_size, tex_index,img)
|
gl->ctx_driver->write_egl_image(gl, frame, width, height, pitch, base_size, tex_index,img)
|
||||||
#endif
|
#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
|
#define HAVE_GL_ASYNC_READBACK
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
30
retroarch.c
30
retroarch.c
|
@ -211,7 +211,7 @@ static void readjust_audio_input_rate(void)
|
||||||
// g_extern.audio_data.src_ratio, g_extern.audio_data.orig_src_ratio);
|
// 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)
|
static void recording_dump_frame(const void *data, unsigned width, unsigned height, size_t pitch)
|
||||||
{
|
{
|
||||||
struct ffemu_video_data ffemu_data = {0};
|
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,
|
// Slightly messy code,
|
||||||
// but we really need to do processing before blocking on VSync for best possible scheduling.
|
// 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))
|
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);
|
recording_dump_frame(data, width, height, pitch);
|
||||||
#endif
|
#endif
|
||||||
|
@ -323,7 +323,7 @@ static void video_frame(const void *data, unsigned width, unsigned height, size_
|
||||||
data, width, height, pitch);
|
data, width, height, pitch);
|
||||||
RARCH_PERFORMANCE_STOP(softfilter_process);
|
RARCH_PERFORMANCE_STOP(softfilter_process);
|
||||||
|
|
||||||
#ifdef HAVE_FFMPEG
|
#ifdef HAVE_RECORD
|
||||||
if (g_extern.recording && g_settings.video.post_filter_record)
|
if (g_extern.recording && g_settings.video.post_filter_record)
|
||||||
recording_dump_frame(g_extern.filter.buffer, owidth, oheight, opitch);
|
recording_dump_frame(g_extern.filter.buffer, owidth, oheight, opitch);
|
||||||
#endif
|
#endif
|
||||||
|
@ -337,7 +337,7 @@ static void video_frame(const void *data, unsigned width, unsigned height, size_
|
||||||
|
|
||||||
void rarch_render_cached_frame(void)
|
void rarch_render_cached_frame(void)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_FFMPEG
|
#ifdef HAVE_RECORD
|
||||||
// Cannot allow FFmpeg recording when pushing duped frames.
|
// Cannot allow FFmpeg recording when pushing duped frames.
|
||||||
bool recording = g_extern.recording;
|
bool recording = g_extern.recording;
|
||||||
g_extern.recording = false;
|
g_extern.recording = false;
|
||||||
|
@ -355,14 +355,14 @@ void rarch_render_cached_frame(void)
|
||||||
g_extern.frame_cache.height,
|
g_extern.frame_cache.height,
|
||||||
g_extern.frame_cache.pitch);
|
g_extern.frame_cache.pitch);
|
||||||
|
|
||||||
#ifdef HAVE_FFMPEG
|
#ifdef HAVE_RECORD
|
||||||
g_extern.recording = recording;
|
g_extern.recording = recording;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool audio_flush(const int16_t *data, size_t samples)
|
static bool audio_flush(const int16_t *data, size_t samples)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_FFMPEG
|
#ifdef HAVE_RECORD
|
||||||
if (g_extern.recording)
|
if (g_extern.recording)
|
||||||
{
|
{
|
||||||
struct ffemu_audio_data ffemu_data = {0};
|
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.");
|
puts("\t\tAvailable commands are listed if command is invalid.");
|
||||||
#endif
|
#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-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--recordconfig: Path to settings used during recording.");
|
||||||
puts("\t--size: Overrides output video size when recording with FFmpeg (format: WIDTHxHEIGHT).");
|
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' },
|
{ "help", 0, NULL, 'h' },
|
||||||
{ "save", 1, NULL, 's' },
|
{ "save", 1, NULL, 's' },
|
||||||
{ "fullscreen", 0, NULL, 'f' },
|
{ "fullscreen", 0, NULL, 'f' },
|
||||||
#ifdef HAVE_FFMPEG
|
#ifdef HAVE_RECORD
|
||||||
{ "record", 1, NULL, 'r' },
|
{ "record", 1, NULL, 'r' },
|
||||||
{ "recordconfig", 1, &val, 'R' },
|
{ "recordconfig", 1, &val, 'R' },
|
||||||
{ "size", 1, &val, 's' },
|
{ "size", 1, &val, 's' },
|
||||||
|
@ -951,7 +951,7 @@ static void parse_input(int argc, char *argv[])
|
||||||
{ NULL, 0, NULL, 0 }
|
{ NULL, 0, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef HAVE_FFMPEG
|
#ifdef HAVE_RECORD
|
||||||
#define FFMPEG_RECORD_ARG "r:"
|
#define FFMPEG_RECORD_ARG "r:"
|
||||||
#else
|
#else
|
||||||
#define FFMPEG_RECORD_ARG
|
#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));
|
strlcpy(g_extern.config_path, optarg, sizeof(g_extern.config_path));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef HAVE_FFMPEG
|
#ifdef HAVE_RECORD
|
||||||
case 'r':
|
case 'r':
|
||||||
strlcpy(g_extern.record_path, optarg, sizeof(g_extern.record_path));
|
strlcpy(g_extern.record_path, optarg, sizeof(g_extern.record_path));
|
||||||
g_extern.recording = true;
|
g_extern.recording = true;
|
||||||
|
@ -1176,7 +1176,7 @@ static void parse_input(int argc, char *argv[])
|
||||||
g_extern.block_patch = true;
|
g_extern.block_patch = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef HAVE_FFMPEG
|
#ifdef HAVE_RECORD
|
||||||
case 's':
|
case 's':
|
||||||
{
|
{
|
||||||
if (sscanf(optarg, "%ux%u", &g_extern.record_width, &g_extern.record_height) != 2)
|
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)
|
void rarch_init_recording(void)
|
||||||
{
|
{
|
||||||
if (!g_extern.recording)
|
if (!g_extern.recording)
|
||||||
|
@ -2944,7 +2944,7 @@ int rarch_main_init(int argc, char *argv[])
|
||||||
|
|
||||||
init_controllers();
|
init_controllers();
|
||||||
|
|
||||||
#ifdef HAVE_FFMPEG
|
#ifdef HAVE_RECORD
|
||||||
rarch_init_recording();
|
rarch_init_recording();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -3014,7 +3014,7 @@ static inline void update_frame_time(void)
|
||||||
retro_time_t delta = 0;
|
retro_time_t delta = 0;
|
||||||
|
|
||||||
bool is_locked_fps = g_extern.is_paused || driver.nonblock_state;
|
bool is_locked_fps = g_extern.is_paused || driver.nonblock_state;
|
||||||
#ifdef HAVE_FFMPEG
|
#ifdef HAVE_RECORD
|
||||||
is_locked_fps |= g_extern.recording;
|
is_locked_fps |= g_extern.recording;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -3145,7 +3145,7 @@ void rarch_main_deinit(void)
|
||||||
rarch_deinit_autosave();
|
rarch_deinit_autosave();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_FFMPEG
|
#ifdef HAVE_RECORD
|
||||||
rarch_deinit_recording();
|
rarch_deinit_recording();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue