RetroArch
Classes | Typedefs | Enumerations | Functions | Variables
netplay.h File Reference
#include <stdint.h>
#include <stddef.h>
#include <boolean.h>
#include <libretro.h>
#include "../../core.h"
Include dependency graph for netplay.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mitm_server
 

Typedefs

typedef struct netplay netplay_t
 
typedef struct mitm_server mitm_server_t
 

Enumerations

enum  rarch_netplay_ctl_state {
  RARCH_NETPLAY_CTL_NONE = 0, RARCH_NETPLAY_CTL_GAME_WATCH, RARCH_NETPLAY_CTL_POST_FRAME, RARCH_NETPLAY_CTL_PRE_FRAME,
  RARCH_NETPLAY_CTL_ENABLE_SERVER, RARCH_NETPLAY_CTL_ENABLE_CLIENT, RARCH_NETPLAY_CTL_DISABLE, RARCH_NETPLAY_CTL_IS_ENABLED,
  RARCH_NETPLAY_CTL_IS_REPLAYING, RARCH_NETPLAY_CTL_IS_SERVER, RARCH_NETPLAY_CTL_IS_CONNECTED, RARCH_NETPLAY_CTL_IS_DATA_INITED,
  RARCH_NETPLAY_CTL_PAUSE, RARCH_NETPLAY_CTL_UNPAUSE, RARCH_NETPLAY_CTL_LOAD_SAVESTATE, RARCH_NETPLAY_CTL_RESET,
  RARCH_NETPLAY_CTL_DISCONNECT, RARCH_NETPLAY_CTL_FINISHED_NAT_TRAVERSAL, RARCH_NETPLAY_CTL_DESYNC_PUSH, RARCH_NETPLAY_CTL_DESYNC_POP
}
 
enum  rarch_netplay_share_digital_preference {
  RARCH_NETPLAY_SHARE_DIGITAL_NO_SHARING = 0, RARCH_NETPLAY_SHARE_DIGITAL_NO_PREFERENCE, RARCH_NETPLAY_SHARE_DIGITAL_OR, RARCH_NETPLAY_SHARE_DIGITAL_XOR,
  RARCH_NETPLAY_SHARE_DIGITAL_VOTE, RARCH_NETPLAY_SHARE_DIGITAL_LAST
}
 
enum  rarch_netplay_share_analog_preference {
  RARCH_NETPLAY_SHARE_ANALOG_NO_SHARING = 0, RARCH_NETPLAY_SHARE_ANALOG_NO_PREFERENCE, RARCH_NETPLAY_SHARE_ANALOG_MAX, RARCH_NETPLAY_SHARE_ANALOG_AVERAGE,
  RARCH_NETPLAY_SHARE_ANALOG_LAST
}
 

Functions

int16_t input_state_net (unsigned port, unsigned device, unsigned idx, unsigned id)
 
void video_frame_net (const void *data, unsigned width, unsigned height, size_t pitch)
 
void audio_sample_net (int16_t left, int16_t right)
 
size_t audio_sample_batch_net (const int16_t *data, size_t frames)
 
bool init_netplay_deferred (const char *server, unsigned port)
 
bool init_netplay (void *direct_host, const char *server, unsigned port)
 
void deinit_netplay (void)
 
bool netplay_driver_ctl (enum rarch_netplay_ctl_state state, void *data)
 
int netplay_rooms_parse (const char *buf)
 
struct netplay_roomnetplay_room_get (int index)
 
int netplay_rooms_get_count (void)
 
void netplay_rooms_free (void)
 
void netplay_get_architecture (char *frontend_architecture, size_t size)
 

Variables

static const mitm_server_t netplay_mitm_server_list []
 

Typedef Documentation

◆ mitm_server_t

typedef struct mitm_server mitm_server_t

◆ netplay_t

typedef struct netplay netplay_t

Enumeration Type Documentation

◆ rarch_netplay_ctl_state

Enumerator
RARCH_NETPLAY_CTL_NONE 
RARCH_NETPLAY_CTL_GAME_WATCH 
RARCH_NETPLAY_CTL_POST_FRAME 
RARCH_NETPLAY_CTL_PRE_FRAME 
RARCH_NETPLAY_CTL_ENABLE_SERVER 
RARCH_NETPLAY_CTL_ENABLE_CLIENT 
RARCH_NETPLAY_CTL_DISABLE 
RARCH_NETPLAY_CTL_IS_ENABLED 
RARCH_NETPLAY_CTL_IS_REPLAYING 
RARCH_NETPLAY_CTL_IS_SERVER 
RARCH_NETPLAY_CTL_IS_CONNECTED 
RARCH_NETPLAY_CTL_IS_DATA_INITED 
RARCH_NETPLAY_CTL_PAUSE 
RARCH_NETPLAY_CTL_UNPAUSE 
RARCH_NETPLAY_CTL_LOAD_SAVESTATE 
RARCH_NETPLAY_CTL_RESET 
RARCH_NETPLAY_CTL_DISCONNECT 
RARCH_NETPLAY_CTL_FINISHED_NAT_TRAVERSAL 
RARCH_NETPLAY_CTL_DESYNC_PUSH 
RARCH_NETPLAY_CTL_DESYNC_POP 

◆ rarch_netplay_share_analog_preference

Enumerator
RARCH_NETPLAY_SHARE_ANALOG_NO_SHARING 
RARCH_NETPLAY_SHARE_ANALOG_NO_PREFERENCE 
RARCH_NETPLAY_SHARE_ANALOG_MAX 
RARCH_NETPLAY_SHARE_ANALOG_AVERAGE 
RARCH_NETPLAY_SHARE_ANALOG_LAST 

◆ rarch_netplay_share_digital_preference

Enumerator
RARCH_NETPLAY_SHARE_DIGITAL_NO_SHARING 
RARCH_NETPLAY_SHARE_DIGITAL_NO_PREFERENCE 
RARCH_NETPLAY_SHARE_DIGITAL_OR 
RARCH_NETPLAY_SHARE_DIGITAL_XOR 
RARCH_NETPLAY_SHARE_DIGITAL_VOTE 
RARCH_NETPLAY_SHARE_DIGITAL_LAST 

Function Documentation

◆ audio_sample_batch_net()

size_t audio_sample_batch_net ( const int16_t data,
size_t  frames 
)
Here is the call graph for this function:

◆ audio_sample_net()

void audio_sample_net ( int16_t  left,
int16_t  right 
)
Here is the call graph for this function:

◆ deinit_netplay()

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

◆ init_netplay()

bool init_netplay ( void direct_host,
const char *  server,
unsigned  port 
)

init_netplay : Host to connect to directly, if applicable (client only) : server address to connect to (client only) : TCP port to host on/connect to

Initializes netplay.

If netplay is already initialized, will return false (0).

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

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

◆ init_netplay_deferred()

bool init_netplay_deferred ( const char *  server,
unsigned  port 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ input_state_net()

int16_t input_state_net ( unsigned  port,
unsigned  device,
unsigned  idx,
unsigned  id 
)
Here is the call graph for this function:

◆ netplay_driver_ctl()

bool netplay_driver_ctl ( enum rarch_netplay_ctl_state  state,
void data 
)

netplay_driver_ctl

Frontend access to Netplay functionality

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

◆ netplay_get_architecture()

void netplay_get_architecture ( char *  frontend_architecture,
size_t  size 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ netplay_room_get()

struct netplay_room* netplay_room_get ( int  index)

◆ netplay_rooms_free()

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

◆ netplay_rooms_get_count()

int netplay_rooms_get_count ( void  )

◆ netplay_rooms_parse()

int netplay_rooms_parse ( const char *  buf)
Here is the call graph for this function:

◆ video_frame_net()

void video_frame_net ( const void data,
unsigned  width,
unsigned  height,
size_t  pitch 
)
Here is the call graph for this function:

Variable Documentation

◆ netplay_mitm_server_list

const mitm_server_t netplay_mitm_server_list[]
static
Initial value:
= {
{ "nyc", "New York City, USA" },
{ "madrid", "Madrid, Spain" },
{ "montreal", "Montreal, Canada" },
}