Create video_driver_get_record_status

This commit is contained in:
twinaphex 2017-01-25 15:30:51 +01:00
parent 4b01726f48
commit 41a647945b
3 changed files with 22 additions and 18 deletions

View File

@ -1837,14 +1837,12 @@ bool video_driver_is_active(void)
return video_driver_active;
}
bool video_driver_has_gpu_record(void)
void video_driver_get_record_status(
bool *has_gpu_record,
uint8_t **gpu_buf)
{
return video_driver_record_gpu_buffer != NULL;
}
uint8_t *video_driver_get_gpu_record(void)
{
return video_driver_record_gpu_buffer;
*gpu_buf = video_driver_record_gpu_buffer;
*has_gpu_record = video_driver_record_gpu_buffer != NULL;
}
bool video_driver_gpu_record_init(unsigned size)

View File

@ -328,8 +328,6 @@ void video_driver_set_video_cache_context_ack(void);
bool video_driver_is_video_cache_context_ack(void);
void video_driver_set_active(void);
bool video_driver_is_active(void);
bool video_driver_has_gpu_record(void);
uint8_t *video_driver_get_gpu_record(void);
bool video_driver_gpu_record_init(unsigned size);
void video_driver_gpu_record_deinit(void);
bool video_driver_get_current_software_framebuffer(struct
@ -558,6 +556,10 @@ void video_driver_reinit(void);
void video_driver_get_window_title(char *buf, unsigned len);
void video_driver_get_record_status(
bool *has_gpu_record,
uint8_t **gpu_buf);
void video_driver_get_status(uint64_t *frame_count, bool * is_alive,
bool *is_focused);

View File

@ -185,16 +185,21 @@ bool record_driver_init_first(const record_driver_t **backend, void **data,
void recording_dump_frame(const void *data, unsigned width,
unsigned height, size_t pitch, bool is_idle)
{
struct ffemu_video_data ffemu_data = {0};
bool has_gpu_record = false;
uint8_t *gpu_buf = NULL;
struct ffemu_video_data
ffemu_data = {0};
ffemu_data.pitch = pitch;
ffemu_data.width = width;
ffemu_data.height = height;
ffemu_data.data = data;
video_driver_get_record_status(&has_gpu_record,
&gpu_buf);
if (video_driver_has_gpu_record())
ffemu_data.pitch = pitch;
ffemu_data.width = width;
ffemu_data.height = height;
ffemu_data.data = data;
if (has_gpu_record)
{
uint8_t *gpu_buf = NULL;
struct video_viewport vp = {0};
video_driver_get_viewport_info(&vp);
@ -222,7 +227,6 @@ void recording_dump_frame(const void *data, unsigned width,
return;
}
gpu_buf = video_driver_get_gpu_record();
if (!gpu_buf)
return;
@ -240,7 +244,7 @@ void recording_dump_frame(const void *data, unsigned width,
ffemu_data.pitch = -ffemu_data.pitch;
}
if (!video_driver_has_gpu_record())
if (!has_gpu_record)
ffemu_data.is_dupe = !data;
if (recording_driver && recording_driver->push_video)