RetroArch
Macros | Functions | Variables
mpv-libretro.c File Reference
#include <math.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <mpv/client.h>
#include <mpv/render_gl.h>
#include <libretro.h>
#include "version.h"
Include dependency graph for mpv-libretro.c:

Macros

#define CORE_PREFIX(s)   s
 

Functions

static retro_video_refresh_t CORE_PREFIX (video_cb)
 
static retro_audio_sample_t CORE_PREFIX (audio_cb)
 
static retro_audio_sample_batch_t CORE_PREFIX (audio_batch_cb)
 
static retro_environment_t CORE_PREFIX (environ_cb)
 
static retro_input_poll_t CORE_PREFIX (input_poll_cb)
 
static retro_input_state_t CORE_PREFIX (input_state_cb)
 
void on_mpv_redraw (void *cb_ctx)
 
static void fallback_log (enum retro_log_level level, const char *fmt,...)
 
static void process_mpv_events (mpv_event_id event_block)
 
static voidget_proc_address_mpv (void *fn_ctx, const char *name)
 
void CORE_PREFIX() retro_init (void)
 
void CORE_PREFIX() retro_deinit (void)
 
unsigned CORE_PREFIX() retro_api_version (void)
 
void CORE_PREFIX() retro_set_controller_port_device (unsigned port, unsigned device)
 
void CORE_PREFIX() retro_get_system_info (struct retro_system_info *info)
 
void CORE_PREFIX() retro_get_system_av_info (struct retro_system_av_info *info)
 
void CORE_PREFIX() retro_set_environment (retro_environment_t cb)
 
static void context_reset (void)
 
static void context_destroy (void)
 
static bool retro_init_hw_context (void)
 
void CORE_PREFIX() retro_set_audio_sample (retro_audio_sample_t cb)
 
void CORE_PREFIX() retro_set_audio_sample_batch (retro_audio_sample_batch_t cb)
 
void CORE_PREFIX() retro_set_input_poll (retro_input_poll_t cb)
 
void CORE_PREFIX() retro_set_input_state (retro_input_state_t cb)
 
void CORE_PREFIX() retro_set_video_refresh (retro_video_refresh_t cb)
 
void CORE_PREFIX() retro_reset (void)
 
static void audio_callback (double fps)
 
static void retropad_update_input (void)
 
void CORE_PREFIX() retro_run (void)
 
size_t CORE_PREFIX() retro_serialize_size (void)
 
bool CORE_PREFIX() retro_serialize (void *data_, size_t size)
 
bool CORE_PREFIX() retro_unserialize (const void *data_, size_t size)
 
bool CORE_PREFIX() retro_load_game (const struct retro_game_info *info)
 
bool CORE_PREFIX() retro_load_game_special (unsigned type, const struct retro_game_info *info, size_t num)
 
void CORE_PREFIX() retro_unload_game (void)
 
unsigned CORE_PREFIX() retro_get_region (void)
 
void *CORE_PREFIX() retro_get_memory_data (unsigned id)
 
size_t CORE_PREFIX() retro_get_memory_size (unsigned id)
 
void CORE_PREFIX() retro_cheat_reset (void)
 
void CORE_PREFIX() retro_cheat_set (unsigned index, bool enabled, const char *code)
 

Variables

static struct retro_hw_render_callback hw_render
 
static struct retro_log_callback logging
 
static retro_log_printf_t log_cb
 
static mpv_handle * mpv
 
static mpv_render_context * mpv_gl
 
static int64_t playback_time = 0
 
static char * filepath = NULL
 
static volatile int frame_queue = 0
 

Macro Definition Documentation

◆ CORE_PREFIX

#define CORE_PREFIX (   s)    s

Function Documentation

◆ audio_callback()

static void audio_callback ( double  fps)
static
Here is the caller graph for this function:

◆ context_destroy()

static void context_destroy ( void  )
static
Here is the caller graph for this function:

◆ context_reset()

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

◆ CORE_PREFIX() [1/6]

static retro_video_refresh_t CORE_PREFIX ( video_cb  )
static

◆ CORE_PREFIX() [2/6]

static retro_audio_sample_t CORE_PREFIX ( audio_cb  )
static

◆ CORE_PREFIX() [3/6]

static retro_audio_sample_batch_t CORE_PREFIX ( audio_batch_cb  )
static

◆ CORE_PREFIX() [4/6]

static retro_environment_t CORE_PREFIX ( environ_cb  )
static

◆ CORE_PREFIX() [5/6]

static retro_input_poll_t CORE_PREFIX ( input_poll_cb  )
static

◆ CORE_PREFIX() [6/6]

static retro_input_state_t CORE_PREFIX ( input_state_cb  )
static

◆ fallback_log()

static void fallback_log ( enum retro_log_level  level,
const char *  fmt,
  ... 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_proc_address_mpv()

static void* get_proc_address_mpv ( void fn_ctx,
const char *  name 
)
static
Here is the caller graph for this function:

◆ on_mpv_redraw()

void on_mpv_redraw ( void cb_ctx)
Here is the caller graph for this function:

◆ process_mpv_events()

static void process_mpv_events ( mpv_event_id  event_block)
static

Process various events triggered by mpv, such as printing log messages.

Parameters
event_blockWait until the mpv triggers specified event. Should be NULL if no wait is required.
Here is the caller graph for this function:

◆ retro_api_version()

unsigned CORE_PREFIX() retro_api_version ( void  )

◆ retro_cheat_reset()

void CORE_PREFIX() retro_cheat_reset ( void  )

◆ retro_cheat_set()

void CORE_PREFIX() retro_cheat_set ( unsigned  index,
bool  enabled,
const char *  code 
)
Here is the call graph for this function:

◆ retro_deinit()

void CORE_PREFIX() retro_deinit ( void  )

◆ retro_get_memory_data()

void* CORE_PREFIX() retro_get_memory_data ( unsigned  id)

◆ retro_get_memory_size()

size_t CORE_PREFIX() retro_get_memory_size ( unsigned  id)

◆ retro_get_region()

unsigned CORE_PREFIX() retro_get_region ( void  )

◆ retro_get_system_av_info()

void CORE_PREFIX() retro_get_system_av_info ( struct retro_system_av_info info)

◆ retro_get_system_info()

void CORE_PREFIX() retro_get_system_info ( struct retro_system_info info)
Here is the call graph for this function:

◆ retro_init()

void CORE_PREFIX() retro_init ( void  )

◆ retro_init_hw_context()

static bool retro_init_hw_context ( void  )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ retro_load_game()

bool CORE_PREFIX() retro_load_game ( const struct retro_game_info info)
Here is the call graph for this function:

◆ retro_load_game_special()

bool CORE_PREFIX() retro_load_game_special ( unsigned  type,
const struct retro_game_info info,
size_t  num 
)

◆ retro_reset()

void CORE_PREFIX() retro_reset ( void  )

◆ retro_run()

void CORE_PREFIX() retro_run ( void  )
Here is the call graph for this function:

◆ retro_serialize()

bool CORE_PREFIX() retro_serialize ( void data_,
size_t  size 
)

◆ retro_serialize_size()

size_t CORE_PREFIX() retro_serialize_size ( void  )

◆ retro_set_audio_sample()

void CORE_PREFIX() retro_set_audio_sample ( retro_audio_sample_t  cb)

◆ retro_set_audio_sample_batch()

void CORE_PREFIX() retro_set_audio_sample_batch ( retro_audio_sample_batch_t  cb)

◆ retro_set_controller_port_device()

void CORE_PREFIX() retro_set_controller_port_device ( unsigned  port,
unsigned  device 
)

◆ retro_set_environment()

void CORE_PREFIX() retro_set_environment ( retro_environment_t  cb)
Here is the call graph for this function:

◆ retro_set_input_poll()

void CORE_PREFIX() retro_set_input_poll ( retro_input_poll_t  cb)

◆ retro_set_input_state()

void CORE_PREFIX() retro_set_input_state ( retro_input_state_t  cb)

◆ retro_set_video_refresh()

void CORE_PREFIX() retro_set_video_refresh ( retro_video_refresh_t  cb)

◆ retro_unload_game()

void CORE_PREFIX() retro_unload_game ( void  )
Here is the call graph for this function:

◆ retro_unserialize()

bool CORE_PREFIX() retro_unserialize ( const void data_,
size_t  size 
)

◆ retropad_update_input()

static void retropad_update_input ( void  )
static
Here is the caller graph for this function:

Variable Documentation

◆ filepath

char* filepath = NULL
static

◆ frame_queue

volatile int frame_queue = 0
static

◆ hw_render

struct retro_hw_render_callback hw_render
static

◆ log_cb

retro_log_printf_t log_cb
static

◆ logging

struct retro_log_callback logging
static

◆ mpv

mpv_handle* mpv
static

◆ mpv_gl

mpv_render_context* mpv_gl
static

◆ playback_time

int64_t playback_time = 0
static