mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-06-16 22:00:55 +00:00
Add helper functions to zero callback and configuration structures for better source compatibility with future versions
This commit is contained in:
@@ -32,6 +32,9 @@ typedef struct _STREAM_CONFIGURATION {
|
|||||||
char remoteInputAesIv[16];
|
char remoteInputAesIv[16];
|
||||||
} STREAM_CONFIGURATION, *PSTREAM_CONFIGURATION;
|
} STREAM_CONFIGURATION, *PSTREAM_CONFIGURATION;
|
||||||
|
|
||||||
|
// Use this function to zero the stream configuration when allocated on the stack or heap
|
||||||
|
void LiInitializeStreamConfiguration(PSTREAM_CONFIGURATION streamConfig);
|
||||||
|
|
||||||
typedef struct _LENTRY {
|
typedef struct _LENTRY {
|
||||||
// Pointer to the next entry or NULL if this is the last entry
|
// Pointer to the next entry or NULL if this is the last entry
|
||||||
struct _LENTRY *next;
|
struct _LENTRY *next;
|
||||||
@@ -82,6 +85,9 @@ typedef struct _DECODER_RENDERER_CALLBACKS {
|
|||||||
int capabilities;
|
int capabilities;
|
||||||
} DECODER_RENDERER_CALLBACKS, *PDECODER_RENDERER_CALLBACKS;
|
} DECODER_RENDERER_CALLBACKS, *PDECODER_RENDERER_CALLBACKS;
|
||||||
|
|
||||||
|
// Use this function to zero the video callbacks when allocated on the stack or heap
|
||||||
|
void LiInitializeVideoCallbacks(PDECODER_RENDERER_CALLBACKS drCallbacks);
|
||||||
|
|
||||||
// This callback initializes the audio renderer
|
// This callback initializes the audio renderer
|
||||||
typedef void(*AudioRendererInit)(void);
|
typedef void(*AudioRendererInit)(void);
|
||||||
|
|
||||||
@@ -98,6 +104,9 @@ typedef struct _AUDIO_RENDERER_CALLBACKS {
|
|||||||
int capabilities;
|
int capabilities;
|
||||||
} AUDIO_RENDERER_CALLBACKS, *PAUDIO_RENDERER_CALLBACKS;
|
} AUDIO_RENDERER_CALLBACKS, *PAUDIO_RENDERER_CALLBACKS;
|
||||||
|
|
||||||
|
// Use this function to zero the audio callbacks when allocated on the stack or heap
|
||||||
|
void LiInitializeAudioCallbacks(PAUDIO_RENDERER_CALLBACKS arCallbacks);
|
||||||
|
|
||||||
// Subject to change in future releases
|
// Subject to change in future releases
|
||||||
// Use LiGetStageName() for stable stage names
|
// Use LiGetStageName() for stable stage names
|
||||||
#define STAGE_NONE 0
|
#define STAGE_NONE 0
|
||||||
@@ -147,6 +156,9 @@ typedef struct _CONNECTION_LISTENER_CALLBACKS {
|
|||||||
ConnListenerDisplayTransientMessage displayTransientMessage;
|
ConnListenerDisplayTransientMessage displayTransientMessage;
|
||||||
} CONNECTION_LISTENER_CALLBACKS, *PCONNECTION_LISTENER_CALLBACKS;
|
} CONNECTION_LISTENER_CALLBACKS, *PCONNECTION_LISTENER_CALLBACKS;
|
||||||
|
|
||||||
|
// Use this function to zero the connection callbacks when allocated on the stack or heap
|
||||||
|
void LiInitializeConnectionCallbacks(PCONNECTION_LISTENER_CALLBACKS clCallbacks);
|
||||||
|
|
||||||
// This function begins streaming.
|
// This function begins streaming.
|
||||||
//
|
//
|
||||||
// Callbacks are all optional. Pass NULL for individual callbacks within each struct or pass NULL for the entire struct
|
// Callbacks are all optional. Pass NULL for individual callbacks within each struct or pass NULL for the entire struct
|
||||||
|
|||||||
@@ -16,3 +16,19 @@ int isBeforeSignedInt(int numA, int numB, int ambiguousCase) {
|
|||||||
return ambiguousCase;
|
return ambiguousCase;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LiInitializeStreamConfiguration(PSTREAM_CONFIGURATION streamConfig) {
|
||||||
|
memset(streamConfig, 0, sizeof(*streamConfig));
|
||||||
|
}
|
||||||
|
|
||||||
|
void LiInitializeVideoCallbacks(PDECODER_RENDERER_CALLBACKS drCallbacks) {
|
||||||
|
memset(drCallbacks, 0, sizeof(*drCallbacks));
|
||||||
|
}
|
||||||
|
|
||||||
|
void LiInitializeAudioCallbacks(PAUDIO_RENDERER_CALLBACKS arCallbacks) {
|
||||||
|
memset(arCallbacks, 0, sizeof(*arCallbacks));
|
||||||
|
}
|
||||||
|
|
||||||
|
void LiInitializeConnectionCallbacks(PCONNECTION_LISTENER_CALLBACKS clCallbacks) {
|
||||||
|
memset(clCallbacks, 0, sizeof(*clCallbacks));
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user