mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-23 16:09:47 +00:00
Revert "Create drivers_data array and no longer use recording_data"
This reverts commit e049b7e1f0
.
This commit is contained in:
parent
e049b7e1f0
commit
9e2717e927
@ -502,7 +502,7 @@ static bool audio_driver_flush(const int16_t *data, size_t samples)
|
||||
src_data.output_frames = 0;
|
||||
src_data.ratio = 0.0f;
|
||||
|
||||
if (drivers_data[DRIVER_RECORDING])
|
||||
if (recording_data)
|
||||
recording_push_audio(data, samples);
|
||||
|
||||
if (runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL) || settings->audio.mute_enable)
|
||||
|
2
driver.c
2
driver.c
@ -52,8 +52,6 @@
|
||||
#define HASH_RECORD_DRIVER 0x144cd2cfU
|
||||
#define HASH_WIFI_DRIVER 0x64d7d17fU
|
||||
|
||||
void *drivers_data[DRIVER_LAST+1];
|
||||
|
||||
/**
|
||||
* find_driver_nonempty:
|
||||
* @label : string of driver type to be found.
|
||||
|
9
driver.h
9
driver.h
@ -45,9 +45,7 @@ enum
|
||||
DRIVER_LOCATION,
|
||||
DRIVER_MENU,
|
||||
DRIVERS_VIDEO_INPUT,
|
||||
DRIVER_WIFI,
|
||||
DRIVER_RECORDING,
|
||||
DRIVER_LAST,
|
||||
DRIVER_WIFI
|
||||
};
|
||||
|
||||
enum
|
||||
@ -59,8 +57,7 @@ enum
|
||||
DRIVER_LOCATION_MASK = 1 << DRIVER_LOCATION,
|
||||
DRIVER_MENU_MASK = 1 << DRIVER_MENU,
|
||||
DRIVERS_VIDEO_INPUT_MASK = 1 << DRIVERS_VIDEO_INPUT,
|
||||
DRIVER_WIFI_MASK = 1 << DRIVER_WIFI,
|
||||
DRIVER_RECORDING_MASK = 1 << DRIVER_RECORDING
|
||||
DRIVER_WIFI_MASK = 1 << DRIVER_WIFI
|
||||
};
|
||||
|
||||
enum driver_ctl_state
|
||||
@ -125,8 +122,6 @@ typedef struct driver_ctx_info
|
||||
|
||||
bool driver_ctl(enum driver_ctl_state state, void *data);
|
||||
|
||||
extern void *drivers_data[DRIVER_LAST+1];
|
||||
|
||||
RETRO_END_DECLS
|
||||
|
||||
#endif
|
||||
|
@ -1114,7 +1114,7 @@ static bool video_driver_frame_filter(const void *data,
|
||||
data, width, height, pitch);
|
||||
performance_counter_stop(&softfilter_process);
|
||||
|
||||
if (settings->video.post_filter_record && drivers_data[DRIVER_RECORDING])
|
||||
if (settings->video.post_filter_record && recording_data)
|
||||
recording_dump_frame(video_driver_state_buffer,
|
||||
*output_width, *output_height, *output_pitch);
|
||||
|
||||
@ -1147,7 +1147,7 @@ bool video_driver_cached_frame(void)
|
||||
void *recording = recording_driver_get_data_ptr();
|
||||
|
||||
/* Cannot allow recording when pushing duped frames. */
|
||||
drivers_data[DRIVER_RECORDING] = NULL;
|
||||
recording_data = NULL;
|
||||
|
||||
/* Not 100% safe, since the library might have
|
||||
* freed the memory, but no known implementations do this.
|
||||
@ -1161,7 +1161,7 @@ bool video_driver_cached_frame(void)
|
||||
|
||||
core_frame(&info);
|
||||
|
||||
drivers_data[DRIVER_RECORDING] = recording;
|
||||
recording_data = recording;
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -2091,7 +2091,7 @@ void video_driver_frame(const void *data, unsigned width,
|
||||
|| !settings->video.post_filter_record
|
||||
|| !data
|
||||
|| video_driver_record_gpu_buffer
|
||||
) && drivers_data[DRIVER_RECORDING]
|
||||
) && recording_data
|
||||
)
|
||||
recording_dump_frame(data, width, height, pitch);
|
||||
|
||||
|
@ -52,6 +52,7 @@ static bool recording_enable = false;
|
||||
static bool recording_use_output_dir = false;
|
||||
|
||||
static const record_driver_t *recording_driver = NULL;
|
||||
void *recording_data = NULL;
|
||||
|
||||
/**
|
||||
* record_driver_find_ident:
|
||||
@ -243,22 +244,22 @@ void recording_dump_frame(const void *data, unsigned width,
|
||||
ffemu_data.is_dupe = !data;
|
||||
|
||||
if (recording_driver && recording_driver->push_video)
|
||||
recording_driver->push_video(drivers_data[DRIVER_RECORDING], &ffemu_data);
|
||||
recording_driver->push_video(recording_data, &ffemu_data);
|
||||
}
|
||||
|
||||
bool recording_deinit(void)
|
||||
{
|
||||
if (!drivers_data[DRIVER_RECORDING] || !recording_driver)
|
||||
if (!recording_data || !recording_driver)
|
||||
return false;
|
||||
|
||||
if (recording_driver->finalize)
|
||||
recording_driver->finalize(drivers_data[DRIVER_RECORDING]);
|
||||
recording_driver->finalize(recording_data);
|
||||
|
||||
if (recording_driver->free)
|
||||
recording_driver->free(drivers_data[DRIVER_RECORDING]);
|
||||
recording_driver->free(recording_data);
|
||||
|
||||
drivers_data[DRIVER_RECORDING] = NULL;
|
||||
recording_driver = NULL;
|
||||
recording_data = NULL;
|
||||
recording_driver = NULL;
|
||||
|
||||
command_event(CMD_EVENT_GPU_RECORD_DEINIT, NULL);
|
||||
|
||||
@ -283,7 +284,7 @@ void recording_push_audio(const int16_t *data, size_t samples)
|
||||
ffemu_data.frames = samples / 2;
|
||||
|
||||
if (recording_driver && recording_driver->push_audio)
|
||||
recording_driver->push_audio(drivers_data[DRIVER_RECORDING], &ffemu_data);
|
||||
recording_driver->push_audio(recording_data, &ffemu_data);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -425,7 +426,7 @@ bool recording_init(void)
|
||||
params.fb_width, params.fb_height,
|
||||
(unsigned)params.pix_fmt);
|
||||
|
||||
if (!record_driver_init_first(&recording_driver, &drivers_data[DRIVER_RECORDING], ¶ms))
|
||||
if (!record_driver_init_first(&recording_driver, &recording_data, ¶ms))
|
||||
{
|
||||
RARCH_ERR("%s\n", msg_hash_to_str(MSG_FAILED_TO_START_RECORDING));
|
||||
command_event(CMD_EVENT_GPU_RECORD_DEINIT, NULL);
|
||||
@ -438,17 +439,17 @@ bool recording_init(void)
|
||||
|
||||
void *recording_driver_get_data_ptr(void)
|
||||
{
|
||||
return drivers_data[DRIVER_RECORDING];
|
||||
return recording_data;
|
||||
}
|
||||
|
||||
void recording_driver_clear_data_ptr(void)
|
||||
{
|
||||
drivers_data[DRIVER_RECORDING] = NULL;
|
||||
recording_data = NULL;
|
||||
}
|
||||
|
||||
void recording_driver_set_data_ptr(void *data)
|
||||
{
|
||||
drivers_data[DRIVER_RECORDING] = data;
|
||||
recording_data = data;
|
||||
}
|
||||
|
||||
bool *recording_driver_get_use_output_dir_ptr(void)
|
||||
|
Loading…
Reference in New Issue
Block a user