Move video_data_own to gfx/video_driver.c

This commit is contained in:
twinaphex 2015-11-29 20:23:16 +01:00
parent d181870caa
commit c62150c2a2
5 changed files with 18 additions and 7 deletions

View File

@ -359,7 +359,7 @@ void init_drivers(int flags)
rarch_system_info_t *system = rarch_system_info_get_ptr();
if (flags & DRIVER_VIDEO)
driver->video_data_own = false;
video_driver_ctl(RARCH_DISPLAY_CTL_UNSET_OWN_DRIVER, NULL);
if (flags & DRIVER_AUDIO)
driver->audio_data_own = false;
if (flags & DRIVER_INPUT)

View File

@ -249,7 +249,6 @@ typedef struct driver
*
* Typically, if a driver intends to make use of this, it should
* set this to true at the end of its 'init' function. */
bool video_data_own;
bool audio_data_own;
bool input_data_own;
bool camera_data_own;

View File

@ -765,7 +765,7 @@ static void *d3d_init(const video_info_t *info,
input_driver_set(input, input_data);
driver->video_data_own = true;
video_driver_ctl(RARCH_DISPLAY_CTL_SET_OWN_DRIVER, NULL);
return vid;
}
}
@ -806,7 +806,7 @@ static void *d3d_init(const video_info_t *info,
vid->keep_aspect = info->force_aspect;
#ifdef _XBOX
driver->video_data_own = true;
video_driver_ctl(RARCH_DISPLAY_CTL_SET_OWN_DRIVER, NULL);
driver->input_data_own = true;
#endif

View File

@ -94,6 +94,7 @@ static bool gfx_use_rgba;
static uint64_t video_frame_count;
static void *video_data;
static bool video_data_own;
static const video_driver_t *current_video;
/* Interface for "poking". */
@ -533,7 +534,7 @@ static bool uninit_video_input(void)
input_driver_ctl(RARCH_INPUT_CTL_DEINIT, NULL);
if (
!driver->video_data_own &&
!video_data_own &&
video_data &&
current_video &&
current_video->free)
@ -553,7 +554,7 @@ static bool uninit_video_input(void)
video_driver_ctl(RARCH_DISPLAY_CTL_UNSET_RGBA, NULL);
current_video = NULL;
if (!driver->video_data_own)
if (!video_data_own)
video_data = NULL;
return true;
@ -1618,6 +1619,14 @@ bool video_driver_ctl(enum rarch_display_ctl_state state, void *data)
global->console.screen.flicker_filter_index);
}
return true;
case RARCH_DISPLAY_CTL_SET_OWN_DRIVER:
video_data_own = true;
break;
case RARCH_DISPLAY_CTL_UNSET_OWN_DRIVER:
video_data_own = false;
break;
case RARCH_DISPLAY_CTL_OWNS_DRIVER:
return video_data_own;
case RARCH_DISPLAY_CTL_NONE:
default:
break;

View File

@ -313,7 +313,10 @@ enum rarch_display_ctl_state
RARCH_DISPLAY_CTL_CACHED_FRAME_RENDER,
RARCH_DISPLAY_CTL_CACHED_FRAME_HAS_VALID_FB,
RARCH_DISPLAY_CTL_SHOW_MOUSE,
RARCH_DISPLAY_CTL_GET_FRAME_COUNT
RARCH_DISPLAY_CTL_GET_FRAME_COUNT,
RARCH_DISPLAY_CTL_SET_OWN_DRIVER,
RARCH_DISPLAY_CTL_UNSET_OWN_DRIVER,
RARCH_DISPLAY_CTL_OWNS_DRIVER
};
bool video_driver_ctl(enum rarch_display_ctl_state state, void *data);