RetroArch
Classes | Enumerations | Functions | Variables
video_thread_wrapper.c File Reference
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <compat/strl.h>
#include <features/features_cpu.h>
#include <rthreads/rthreads.h>
#include <string/stdstring.h>
#include "video_thread_wrapper.h"
#include "font_driver.h"
#include "../retroarch.h"
#include "../verbosity.h"
Include dependency graph for video_thread_wrapper.c:

Classes

struct  thread_packet
 
struct  thread_video
 

Enumerations

enum  thread_cmd {
  CMD_VIDEO_NONE = 0, CMD_INIT, CMD_SET_SHADER, CMD_FREE,
  CMD_ALIVE, CMD_SET_VIEWPORT, CMD_SET_ROTATION, CMD_READ_VIEWPORT,
  CMD_OVERLAY_ENABLE, CMD_OVERLAY_LOAD, CMD_OVERLAY_TEX_GEOM, CMD_OVERLAY_VERTEX_GEOM,
  CMD_OVERLAY_FULL_SCREEN, CMD_POKE_SET_VIDEO_MODE, CMD_POKE_SET_FILTERING, CMD_POKE_SET_FBO_STATE,
  CMD_POKE_GET_FBO_STATE, CMD_POKE_SET_ASPECT_RATIO, CMD_POKE_SET_OSD_MSG, CMD_FONT_INIT,
  CMD_CUSTOM_COMMAND, CMD_DUMMY = INT_MAX
}
 

Functions

static voidvideo_thread_init_never_call (const video_info_t *video, const input_driver_t **input, void **input_data)
 
static void video_thread_reply (thread_video_t *thr, const thread_packet_t *pkt)
 
static void video_thread_send_packet (thread_video_t *thr, const thread_packet_t *pkt)
 
static void video_thread_wait_reply (thread_video_t *thr, thread_packet_t *pkt)
 
static void video_thread_send_and_wait_user_to_thread (thread_video_t *thr, thread_packet_t *pkt)
 
static void thread_update_driver_state (thread_video_t *thr)
 
static bool video_thread_handle_packet (thread_video_t *thr, const thread_packet_t *incoming)
 
static void video_thread_loop (void *data)
 
static bool video_thread_alive (void *data)
 
static bool video_thread_focus (void *data)
 
static bool video_thread_suppress_screensaver (void *data, bool enable)
 
static bool video_thread_has_windowed (void *data)
 
static bool video_thread_frame (void *data, const void *frame_, unsigned width, unsigned height, uint64_t frame_count, unsigned pitch, const char *msg, video_frame_info_t *video_info)
 
static void video_thread_set_nonblock_state (void *data, bool state)
 
static bool video_thread_init (thread_video_t *thr, const video_info_t info, const input_driver_t **input, void **input_data)
 
static bool video_thread_set_shader (void *data, enum rarch_shader_type type, const char *path)
 
static void video_thread_set_viewport (void *data, unsigned width, unsigned height, bool force_full, bool allow_rotate)
 
static void video_thread_set_rotation (void *data, unsigned rotation)
 
static void video_thread_viewport_info (void *data, struct video_viewport *vp)
 
static bool video_thread_read_viewport (void *data, uint8_t *buffer, bool is_idle)
 
static void video_thread_free (void *data)
 
static void thread_set_video_mode (void *data, unsigned width, unsigned height, bool fullscreen)
 
static void thread_set_filtering (void *data, unsigned idx, bool smooth)
 
static void thread_get_video_output_size (void *data, unsigned *width, unsigned *height)
 
static void thread_get_video_output_prev (void *data)
 
static void thread_get_video_output_next (void *data)
 
static void thread_set_aspect_ratio (void *data, unsigned aspectratio_idx)
 
static void thread_set_texture_frame (void *data, const void *frame, bool rgb32, unsigned width, unsigned height, float alpha)
 
static void thread_set_texture_enable (void *data, bool state, bool full_screen)
 
static void thread_set_osd_msg (void *data, video_frame_info_t *video_info, const char *msg, const void *params, void *font)
 
static uintptr_t thread_load_texture (void *video_data, void *data, bool threaded, enum texture_filter_type filter_type)
 
static void thread_unload_texture (void *video_data, uintptr_t id)
 
static void thread_apply_state_changes (void *data)
 
static struct video_shaderthread_get_current_shader (void *data)
 
static uint32_t thread_get_flags (void *data)
 
static void video_thread_get_poke_interface (void *data, const video_poke_interface_t **iface)
 
static void video_thread_set_callbacks (thread_video_t *thr, const video_driver_t *drv)
 
bool video_init_thread (const video_driver_t **out_driver, void **out_data, const input_driver_t **input, void **input_data, const video_driver_t *drv, const video_info_t info)
 
voidvideo_thread_get_ptr (const video_driver_t **drv)
 
const char * video_thread_get_ident (void)
 
static void video_thread_send_and_wait (thread_video_t *thr, thread_packet_t *pkt)
 
bool video_thread_font_init (const void **font_driver, void **font_handle, void *data, const char *font_path, float font_size, enum font_driver_render_api api, custom_font_command_method_t func, bool is_threaded)
 
unsigned video_thread_texture_load (void *data, custom_command_method_t func)
 

Variables

static const video_poke_interface_t thread_poke
 
static const video_driver_t video_thread
 

Enumeration Type Documentation

◆ thread_cmd

enum thread_cmd
Enumerator
CMD_VIDEO_NONE 
CMD_INIT 
CMD_SET_SHADER 
CMD_FREE 
CMD_ALIVE 
CMD_SET_VIEWPORT 
CMD_SET_ROTATION 
CMD_READ_VIEWPORT 
CMD_OVERLAY_ENABLE 
CMD_OVERLAY_LOAD 
CMD_OVERLAY_TEX_GEOM 
CMD_OVERLAY_VERTEX_GEOM 
CMD_OVERLAY_FULL_SCREEN 
CMD_POKE_SET_VIDEO_MODE 
CMD_POKE_SET_FILTERING 
CMD_POKE_SET_FBO_STATE 
CMD_POKE_GET_FBO_STATE 
CMD_POKE_SET_ASPECT_RATIO 
CMD_POKE_SET_OSD_MSG 
CMD_FONT_INIT 
CMD_CUSTOM_COMMAND 
CMD_DUMMY 

Function Documentation

◆ thread_apply_state_changes()

static void thread_apply_state_changes ( void data)
static
Here is the call graph for this function:

◆ thread_get_current_shader()

static struct video_shader* thread_get_current_shader ( void data)
static

◆ thread_get_flags()

static uint32_t thread_get_flags ( void data)
static

◆ thread_get_video_output_next()

static void thread_get_video_output_next ( void data)
static

◆ thread_get_video_output_prev()

static void thread_get_video_output_prev ( void data)
static

◆ thread_get_video_output_size()

static void thread_get_video_output_size ( void data,
unsigned *  width,
unsigned *  height 
)
static

◆ thread_load_texture()

static uintptr_t thread_load_texture ( void video_data,
void data,
bool  threaded,
enum texture_filter_type  filter_type 
)
static

◆ thread_set_aspect_ratio()

static void thread_set_aspect_ratio ( void data,
unsigned  aspectratio_idx 
)
static
Here is the call graph for this function:

◆ thread_set_filtering()

static void thread_set_filtering ( void data,
unsigned  idx,
bool  smooth 
)
static
Here is the call graph for this function:

◆ thread_set_osd_msg()

static void thread_set_osd_msg ( void data,
video_frame_info_t video_info,
const char *  msg,
const void params,
void font 
)
static

◆ thread_set_texture_enable()

static void thread_set_texture_enable ( void data,
bool  state,
bool  full_screen 
)
static
Here is the call graph for this function:

◆ thread_set_texture_frame()

static void thread_set_texture_frame ( void data,
const void frame,
bool  rgb32,
unsigned  width,
unsigned  height,
float  alpha 
)
static
Here is the call graph for this function:

◆ thread_set_video_mode()

static void thread_set_video_mode ( void data,
unsigned  width,
unsigned  height,
bool  fullscreen 
)
static
Here is the call graph for this function:

◆ thread_unload_texture()

static void thread_unload_texture ( void video_data,
uintptr_t  id 
)
static

◆ thread_update_driver_state()

static void thread_update_driver_state ( thread_video_t thr)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ video_init_thread()

bool video_init_thread ( const video_driver_t **  out_driver,
void **  out_data,
const input_driver_t **  input,
void **  input_data,
const video_driver_t drv,
const video_info_t  info 
)

video_init_thread: : Output video driver : Output video data : Input input driver : Input input data : Input Video driver : Video info handle.

Creates, initializes and starts a video driver in a new thread. Access to video driver will be mediated through this driver.

Returns: true (1) if successful, otherwise false (0).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ video_thread_alive()

static bool video_thread_alive ( void data)
static
Here is the call graph for this function:

◆ video_thread_focus()

static bool video_thread_focus ( void data)
static
Here is the call graph for this function:

◆ video_thread_font_init()

bool video_thread_font_init ( const void **  font_driver,
void **  font_handle,
void data,
const char *  font_path,
float  font_size,
enum font_driver_render_api  api,
custom_font_command_method_t  func,
bool  is_threaded 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ video_thread_frame()

static bool video_thread_frame ( void data,
const void frame_,
unsigned  width,
unsigned  height,
uint64_t  frame_count,
unsigned  pitch,
const char *  msg,
video_frame_info_t video_info 
)
static
Here is the call graph for this function:

◆ video_thread_free()

static void video_thread_free ( void data)
static
Here is the call graph for this function:

◆ video_thread_get_ident()

const char* video_thread_get_ident ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ video_thread_get_poke_interface()

static void video_thread_get_poke_interface ( void data,
const video_poke_interface_t **  iface 
)
static

◆ video_thread_get_ptr()

void* video_thread_get_ptr ( const video_driver_t **  drv)

video_thread_get_ptr: : Found driver.

Gets the underlying video driver associated with the threaded video wrapper. Sets to the found video driver.

Returns: Video driver data of the video driver associated with the threaded wrapper (if successful). If not successful, NULL.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ video_thread_handle_packet()

static bool video_thread_handle_packet ( thread_video_t thr,
const thread_packet_t incoming 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ video_thread_has_windowed()

static bool video_thread_has_windowed ( void data)
static
Here is the call graph for this function:

◆ video_thread_init()

static bool video_thread_init ( thread_video_t thr,
const video_info_t  info,
const input_driver_t **  input,
void **  input_data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ video_thread_init_never_call()

static void* video_thread_init_never_call ( const video_info_t video,
const input_driver_t **  input,
void **  input_data 
)
static
Here is the call graph for this function:

◆ video_thread_loop()

static void video_thread_loop ( void data)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ video_thread_read_viewport()

static bool video_thread_read_viewport ( void data,
uint8_t buffer,
bool  is_idle 
)
static
Here is the call graph for this function:

◆ video_thread_reply()

static void video_thread_reply ( thread_video_t thr,
const thread_packet_t pkt 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ video_thread_send_and_wait()

static void video_thread_send_and_wait ( thread_video_t thr,
thread_packet_t pkt 
)
static
Here is the caller graph for this function:

◆ video_thread_send_and_wait_user_to_thread()

static void video_thread_send_and_wait_user_to_thread ( thread_video_t thr,
thread_packet_t pkt 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ video_thread_send_packet()

static void video_thread_send_packet ( thread_video_t thr,
const thread_packet_t pkt 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ video_thread_set_callbacks()

static void video_thread_set_callbacks ( thread_video_t thr,
const video_driver_t drv 
)
static
Here is the caller graph for this function:

◆ video_thread_set_nonblock_state()

static void video_thread_set_nonblock_state ( void data,
bool  state 
)
static

◆ video_thread_set_rotation()

static void video_thread_set_rotation ( void data,
unsigned  rotation 
)
static
Here is the call graph for this function:

◆ video_thread_set_shader()

static bool video_thread_set_shader ( void data,
enum rarch_shader_type  type,
const char *  path 
)
static
Here is the call graph for this function:

◆ video_thread_set_viewport()

static void video_thread_set_viewport ( void data,
unsigned  width,
unsigned  height,
bool  force_full,
bool  allow_rotate 
)
static
Here is the call graph for this function:

◆ video_thread_suppress_screensaver()

static bool video_thread_suppress_screensaver ( void data,
bool  enable 
)
static
Here is the call graph for this function:

◆ video_thread_texture_load()

unsigned video_thread_texture_load ( void data,
custom_command_method_t  func 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ video_thread_viewport_info()

static void video_thread_viewport_info ( void data,
struct video_viewport vp 
)
static
Here is the call graph for this function:

◆ video_thread_wait_reply()

static void video_thread_wait_reply ( thread_video_t thr,
thread_packet_t pkt 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ thread_poke

const video_poke_interface_t thread_poke
static
Initial value:
= {
NULL,
NULL,
NULL,
NULL,
NULL,
}
static void thread_set_aspect_ratio(void *data, unsigned aspectratio_idx)
Definition: video_thread_wrapper.c:1119
static void thread_get_video_output_prev(void *data)
Definition: video_thread_wrapper.c:1097
static uint32_t thread_get_flags(void *data)
Definition: video_thread_wrapper.c:1231
static void thread_set_osd_msg(void *data, video_frame_info_t *video_info, const char *msg, const void *params, void *font)
Definition: video_thread_wrapper.c:1171
static void thread_set_video_mode(void *data, unsigned width, unsigned height, bool fullscreen)
Definition: video_thread_wrapper.c:1054
#define NULL
Pointer to 0.
Definition: gctypes.h:65
static void thread_set_filtering(void *data, unsigned idx, bool smooth)
Definition: video_thread_wrapper.c:1070
static uintptr_t thread_load_texture(void *video_data, void *data, bool threaded, enum texture_filter_type filter_type)
Definition: video_thread_wrapper.c:1187
static void thread_get_video_output_size(void *data, unsigned *width, unsigned *height)
Definition: video_thread_wrapper.c:1083
static struct video_shader * thread_get_current_shader(void *data)
Definition: video_thread_wrapper.c:1223
static void thread_apply_state_changes(void *data)
Definition: video_thread_wrapper.c:1209
static void thread_set_texture_enable(void *data, bool state, bool full_screen)
Definition: video_thread_wrapper.c:1159
static void thread_unload_texture(void *video_data, uintptr_t id)
Definition: video_thread_wrapper.c:1198
static void thread_set_texture_frame(void *data, const void *frame, bool rgb32, unsigned width, unsigned height, float alpha)
Definition: video_thread_wrapper.c:1131
static void thread_get_video_output_next(void *data)
Definition: video_thread_wrapper.c:1108

◆ video_thread

const video_driver_t video_thread
static
Initial value:
= {
"Thread wrapper",
NULL,
}
static bool video_thread_has_windowed(void *data)
Definition: video_thread_wrapper.c:678
static void * video_thread_init_never_call(const video_info_t *video, const input_driver_t **input, void **input_data)
Definition: video_thread_wrapper.c:221
static void video_thread_set_viewport(void *data, unsigned width, unsigned height, bool force_full, bool allow_rotate)
Definition: video_thread_wrapper.c:847
static void video_thread_viewport_info(void *data, struct video_viewport *vp)
Definition: video_thread_wrapper.c:881
#define NULL
Pointer to 0.
Definition: gctypes.h:65
static bool video_thread_set_shader(void *data, enum rarch_shader_type type, const char *path)
Definition: video_thread_wrapper.c:831
static bool video_thread_focus(void *data)
Definition: video_thread_wrapper.c:654
static bool video_thread_suppress_screensaver(void *data, bool enable)
Definition: video_thread_wrapper.c:666
static bool video_thread_read_viewport(void *data, uint8_t *buffer, bool is_idle)
Definition: video_thread_wrapper.c:896
static bool video_thread_alive(void *data)
Definition: video_thread_wrapper.c:634
static void video_thread_set_rotation(void *data, unsigned rotation)
Definition: video_thread_wrapper.c:863
static void video_thread_get_poke_interface(void *data, const video_poke_interface_t **iface)
Definition: video_thread_wrapper.c:1267
static void video_thread_free(void *data)
Definition: video_thread_wrapper.c:912
static void video_thread_set_nonblock_state(void *data, bool state)
Definition: video_thread_wrapper.c:782
static bool video_thread_frame(void *data, const void *frame_, unsigned width, unsigned height, uint64_t frame_count, unsigned pitch, const char *msg, video_frame_info_t *video_info)
Definition: video_thread_wrapper.c:690