mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 09:25:49 +00:00
Manually cleanup files that somehow survived the mass find/replace
This commit is contained in:
parent
35835898c3
commit
5ba0f82b35
@ -58,7 +58,7 @@ typedef struct _QUEUED_AUDIO_PACKET {
|
||||
} q;
|
||||
} QUEUED_AUDIO_PACKET, *PQUEUED_AUDIO_PACKET;
|
||||
|
||||
/* Initialize the audio stream */
|
||||
// Initialize the audio stream
|
||||
void initializeAudioStream(void) {
|
||||
if ((AudioCallbacks.capabilities & CAPABILITY_DIRECT_SUBMIT) == 0) {
|
||||
LbqInitializeLinkedBlockingQueue(&packetQueue, 30);
|
||||
@ -80,7 +80,7 @@ static void freePacketList(PLINKED_BLOCKING_QUEUE_ENTRY entry) {
|
||||
}
|
||||
}
|
||||
|
||||
/* Tear down the audio stream once we're done with it */
|
||||
// Tear down the audio stream once we're done with it
|
||||
void destroyAudioStream(void) {
|
||||
if ((AudioCallbacks.capabilities & CAPABILITY_DIRECT_SUBMIT) == 0) {
|
||||
freePacketList(LbqDestroyLinkedBlockingQueue(&packetQueue));
|
||||
@ -89,7 +89,7 @@ void destroyAudioStream(void) {
|
||||
}
|
||||
|
||||
static void UdpPingThreadProc(void* context) {
|
||||
/* Ping in ASCII */
|
||||
// Ping in ASCII
|
||||
char pingData[] = { 0x50, 0x49, 0x4E, 0x47 };
|
||||
struct sockaddr_in6 saddr;
|
||||
SOCK_RET err;
|
||||
@ -97,7 +97,7 @@ static void UdpPingThreadProc(void* context) {
|
||||
memcpy(&saddr, &RemoteAddr, sizeof(saddr));
|
||||
saddr.sin6_port = htons(RTP_PORT);
|
||||
|
||||
/* Send PING every 500 milliseconds */
|
||||
// Send PING every 500 milliseconds
|
||||
while (!PltIsThreadInterrupted(&udpPingThread)) {
|
||||
err = sendto(rtpSocket, pingData, sizeof(pingData), 0, (struct sockaddr*)&saddr, RemoteAddrLen);
|
||||
if (err != sizeof(pingData)) {
|
||||
@ -110,7 +110,7 @@ static void UdpPingThreadProc(void* context) {
|
||||
}
|
||||
}
|
||||
|
||||
static int queuePacketToLbq(PQUEUED_AUDIO_PACKET *packet) {
|
||||
static int queuePacketToLbq(PQUEUED_AUDIO_PACKET* packet) {
|
||||
int err;
|
||||
|
||||
err = LbqOfferQueueItem(&packetQueue, *packet, &(*packet)->q.lentry);
|
||||
|
@ -8,7 +8,7 @@ void BbInitializeWrappedBuffer(PBYTE_BUFFER buff, char* data, int offset, int le
|
||||
buff->byteOrder = byteOrder;
|
||||
}
|
||||
|
||||
/* Get the long long in the correct byte order */
|
||||
// Get the long long in the correct byte order
|
||||
static long long byteSwapLongLong(PBYTE_BUFFER buff, long long l) {
|
||||
if (buff->byteOrder == BYTE_ORDER_BIG) {
|
||||
return HTONLL(l);
|
||||
@ -18,7 +18,7 @@ static long long byteSwapLongLong(PBYTE_BUFFER buff, long long l) {
|
||||
}
|
||||
}
|
||||
|
||||
/* Get the int in the correct byte order */
|
||||
// Get the int in the correct byte order
|
||||
static int byteSwapInt(PBYTE_BUFFER buff, int i) {
|
||||
if (buff->byteOrder == BYTE_ORDER_BIG) {
|
||||
return htonl(i);
|
||||
@ -28,7 +28,7 @@ static int byteSwapInt(PBYTE_BUFFER buff, int i) {
|
||||
}
|
||||
}
|
||||
|
||||
/* Get the short in the correct byte order */
|
||||
// Get the short in the correct byte order
|
||||
static int byteSwapShort(PBYTE_BUFFER buff, short s) {
|
||||
if (buff->byteOrder == BYTE_ORDER_BIG) {
|
||||
return htons(s);
|
||||
@ -38,7 +38,7 @@ static int byteSwapShort(PBYTE_BUFFER buff, short s) {
|
||||
}
|
||||
}
|
||||
|
||||
/* Get a byte from the byte buffer */
|
||||
// Get a byte from the byte buffer
|
||||
int BbGet(PBYTE_BUFFER buff, char* c) {
|
||||
if (buff->position + sizeof(*c) > buff->length) {
|
||||
return 0;
|
||||
@ -50,7 +50,7 @@ int BbGet(PBYTE_BUFFER buff, char* c) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Get a short from the byte buffer */
|
||||
// Get a short from the byte buffer
|
||||
int BbGetShort(PBYTE_BUFFER buff, short* s) {
|
||||
if (buff->position + sizeof(*s) >= buff->length) {
|
||||
return 0;
|
||||
@ -64,7 +64,7 @@ int BbGetShort(PBYTE_BUFFER buff, short* s) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Get an int from the byte buffer */
|
||||
// Get an int from the byte buffer
|
||||
int BbGetInt(PBYTE_BUFFER buff, int* i) {
|
||||
if (buff->position + sizeof(*i) > buff->length) {
|
||||
return 0;
|
||||
@ -78,7 +78,7 @@ int BbGetInt(PBYTE_BUFFER buff, int* i) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Get a long from the byte buffer */
|
||||
// Get a long from the byte buffer
|
||||
int BbGetLong(PBYTE_BUFFER buff, long long* l) {
|
||||
if (buff->position + sizeof(*l) > buff->length) {
|
||||
return 0;
|
||||
@ -92,7 +92,7 @@ int BbGetLong(PBYTE_BUFFER buff, long long* l) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Put an int into the byte buffer */
|
||||
// Put an int into the byte buffer
|
||||
int BbPutInt(PBYTE_BUFFER buff, int i) {
|
||||
if (buff->position + sizeof(i) > buff->length) {
|
||||
return 0;
|
||||
@ -106,7 +106,7 @@ int BbPutInt(PBYTE_BUFFER buff, int i) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Put a long into the byte buffer */
|
||||
// Put a long into the byte buffer
|
||||
int BbPutLong(PBYTE_BUFFER buff, long long l) {
|
||||
if (buff->position + sizeof(l) > buff->length) {
|
||||
return 0;
|
||||
@ -120,7 +120,7 @@ int BbPutLong(PBYTE_BUFFER buff, long long l) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Put a short into the byte buffer */
|
||||
// Put a short into the byte buffer
|
||||
int BbPutShort(PBYTE_BUFFER buff, short s) {
|
||||
if (buff->position + sizeof(s) > buff->length) {
|
||||
return 0;
|
||||
@ -134,7 +134,7 @@ int BbPutShort(PBYTE_BUFFER buff, short s) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Put a byte into the buffer */
|
||||
// Put a byte into the buffer
|
||||
int BbPut(PBYTE_BUFFER buff, char c) {
|
||||
if (buff->position + sizeof(c) > buff->length) {
|
||||
return 0;
|
||||
|
@ -122,7 +122,7 @@ void destroyControlStream(void) {
|
||||
freeFrameInvalidationList(LbqDestroyLinkedBlockingQueue(&invalidReferenceFrameTuples));
|
||||
}
|
||||
|
||||
int getNextFrameInvalidationTuple(PQUEUED_FRAME_INVALIDATION_TUPLE *qfit) {
|
||||
int getNextFrameInvalidationTuple(PQUEUED_FRAME_INVALIDATION_TUPLE* qfit) {
|
||||
int err = LbqPollQueueElement(&invalidReferenceFrameTuples, (void**)qfit);
|
||||
return (err == LBQ_SUCCESS);
|
||||
}
|
||||
|
@ -38,8 +38,8 @@ static CONNECTION_LISTENER_CALLBACKS fakeClCallbacks = {
|
||||
.displayTransientMessage = fakeClDisplayTransientMessage,
|
||||
};
|
||||
|
||||
void fixupMissingCallbacks(PDECODER_RENDERER_CALLBACKS *drCallbacks, PAUDIO_RENDERER_CALLBACKS *arCallbacks,
|
||||
PCONNECTION_LISTENER_CALLBACKS *clCallbacks)
|
||||
void fixupMissingCallbacks(PDECODER_RENDERER_CALLBACKS* drCallbacks, PAUDIO_RENDERER_CALLBACKS* arCallbacks,
|
||||
PCONNECTION_LISTENER_CALLBACKS* clCallbacks)
|
||||
{
|
||||
if (*drCallbacks == NULL) {
|
||||
*drCallbacks = &fakeDrCallbacks;
|
||||
|
@ -17,8 +17,8 @@ extern AUDIO_RENDERER_CALLBACKS AudioCallbacks;
|
||||
|
||||
int isBeforeSignedInt(int numA, int numB, int ambiguousCase);
|
||||
|
||||
void fixupMissingCallbacks(PDECODER_RENDERER_CALLBACKS *drCallbacks, PAUDIO_RENDERER_CALLBACKS *arCallbacks,
|
||||
PCONNECTION_LISTENER_CALLBACKS *clCallbacks);
|
||||
void fixupMissingCallbacks(PDECODER_RENDERER_CALLBACKS* drCallbacks, PAUDIO_RENDERER_CALLBACKS* arCallbacks,
|
||||
PCONNECTION_LISTENER_CALLBACKS* clCallbacks);
|
||||
|
||||
char* getSdpPayloadForStreamConfig(int rtspClientVersion, int* length);
|
||||
|
||||
|
@ -45,7 +45,7 @@ extern "C" {
|
||||
|
||||
typedef struct _LENTRY {
|
||||
// Pointer to the next entry or NULL if this is the last entry
|
||||
struct _LENTRY *next;
|
||||
struct _LENTRY* next;
|
||||
|
||||
// Pointer to data (never NULL)
|
||||
char* data;
|
||||
|
@ -6,14 +6,14 @@ void addrToUrlSafeString(struct sockaddr_storage* addr, char* string)
|
||||
char addrstr[INET6_ADDRSTRLEN];
|
||||
|
||||
if (addr->ss_family == AF_INET6) {
|
||||
struct sockaddr_in6* sin6 = (struct sockaddr_in6 *)addr;
|
||||
struct sockaddr_in6* sin6 = (struct sockaddr_in6*)addr;
|
||||
inet_ntop(addr->ss_family, &sin6->sin6_addr, addrstr, sizeof(addrstr));
|
||||
|
||||
// IPv6 addresses need to be enclosed in brackets for URLs
|
||||
sprintf(string, "[%s]", addrstr);
|
||||
}
|
||||
else {
|
||||
struct sockaddr_in* sin = (struct sockaddr_in *)addr;
|
||||
struct sockaddr_in* sin = (struct sockaddr_in*)addr;
|
||||
inet_ntop(addr->ss_family, &sin->sin_addr, addrstr, sizeof(addrstr));
|
||||
|
||||
// IPv4 addresses are returned without changes
|
||||
@ -61,7 +61,7 @@ SOCKET bindUdpSocket(int addrfamily, int bufferSize) {
|
||||
return s;
|
||||
}
|
||||
|
||||
SOCKET connectTcpSocket(struct sockaddr_storage *dstaddr, SOCKADDR_LEN addrlen, unsigned short port) {
|
||||
SOCKET connectTcpSocket(struct sockaddr_storage* dstaddr, SOCKADDR_LEN addrlen, unsigned short port) {
|
||||
SOCKET s;
|
||||
struct sockaddr_in6 addr;
|
||||
int err;
|
||||
|
@ -10,8 +10,8 @@ typedef struct _RTP_QUEUE_ENTRY {
|
||||
|
||||
uint64_t queueTimeMs;
|
||||
|
||||
struct _RTP_QUEUE_ENTRY *next;
|
||||
struct _RTP_QUEUE_ENTRY *prev;
|
||||
struct _RTP_QUEUE_ENTRY* next;
|
||||
struct _RTP_QUEUE_ENTRY* prev;
|
||||
} RTP_QUEUE_ENTRY, *PRTP_QUEUE_ENTRY;
|
||||
|
||||
typedef struct _RTP_REORDER_QUEUE {
|
||||
|
@ -57,8 +57,18 @@ static int getMessageLength(PRTSP_MESSAGE msg) {
|
||||
|
||||
// Given an RTSP message string rtspMessage, parse it into an RTSP_MESSAGE struct msg
|
||||
int parseRtspMessage(PRTSP_MESSAGE msg, char* rtspMessage, int length) {
|
||||
char* token, *protocol, *endCheck, *target, *statusStr, *command, *sequence, flag;
|
||||
char messageEnded = 0, *payload = NULL, *opt = NULL;
|
||||
char* token;
|
||||
char* protocol;
|
||||
char* endCheck;
|
||||
char* target;
|
||||
char* statusStr;
|
||||
char* command;
|
||||
char* sequence;
|
||||
char flag;
|
||||
char messageEnded = 0;
|
||||
|
||||
char* payload = NULL;
|
||||
char* opt = NULL;
|
||||
int statusCode = 0;
|
||||
int sequenceNum;
|
||||
int exitCode;
|
||||
|
@ -15,7 +15,7 @@ typedef struct _SDP_OPTION {
|
||||
char name[MAX_OPTION_NAME_LEN + 1];
|
||||
void* payload;
|
||||
int payloadLen;
|
||||
struct _SDP_OPTION *next;
|
||||
struct _SDP_OPTION* next;
|
||||
} SDP_OPTION, *PSDP_OPTION;
|
||||
|
||||
// Cleanup the attribute list
|
||||
@ -60,7 +60,7 @@ static int fillSerializedAttributeList(char* buffer, PSDP_OPTION head) {
|
||||
}
|
||||
|
||||
// Add an attribute
|
||||
static int addAttributeBinary(PSDP_OPTION *head, char* name, const void* payload, int payloadLen) {
|
||||
static int addAttributeBinary(PSDP_OPTION* head, char* name, const void* payload, int payloadLen) {
|
||||
PSDP_OPTION option, currentOption;
|
||||
|
||||
option = malloc(sizeof(*option) + payloadLen);
|
||||
@ -89,12 +89,12 @@ static int addAttributeBinary(PSDP_OPTION *head, char* name, const void* payload
|
||||
}
|
||||
|
||||
// Add an attribute string
|
||||
static int addAttributeString(PSDP_OPTION *head, char* name, const char* payload) {
|
||||
static int addAttributeString(PSDP_OPTION* head, char* name, const char* payload) {
|
||||
// We purposefully omit the null terminating character
|
||||
return addAttributeBinary(head, name, payload, (int)strlen(payload));
|
||||
}
|
||||
|
||||
static int addGen3Options(PSDP_OPTION *head, char* addrStr) {
|
||||
static int addGen3Options(PSDP_OPTION* head, char* addrStr) {
|
||||
int payloadInt;
|
||||
int err = 0;
|
||||
|
||||
@ -135,7 +135,7 @@ static int addGen3Options(PSDP_OPTION *head, char* addrStr) {
|
||||
return err;
|
||||
}
|
||||
|
||||
static int addGen4Options(PSDP_OPTION *head, char* addrStr) {
|
||||
static int addGen4Options(PSDP_OPTION* head, char* addrStr) {
|
||||
char payloadStr[92];
|
||||
int err = 0;
|
||||
unsigned char slicesPerFrame;
|
||||
|
@ -8,7 +8,7 @@ typedef struct _QUEUED_DECODE_UNIT {
|
||||
} QUEUED_DECODE_UNIT, *PQUEUED_DECODE_UNIT;
|
||||
|
||||
void freeQueuedDecodeUnit(PQUEUED_DECODE_UNIT qdu);
|
||||
int getNextQueuedDecodeUnit(PQUEUED_DECODE_UNIT *qdu);
|
||||
int getNextQueuedDecodeUnit(PQUEUED_DECODE_UNIT* qdu);
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
|
@ -159,7 +159,7 @@ static int getSpecialSeq(PBUFFER_DESC current, PBUFFER_DESC candidate) {
|
||||
}
|
||||
|
||||
// Get the first decode unit available
|
||||
int getNextQueuedDecodeUnit(PQUEUED_DECODE_UNIT *qdu) {
|
||||
int getNextQueuedDecodeUnit(PQUEUED_DECODE_UNIT* qdu) {
|
||||
int err = LbqWaitForQueueElement(&decodeUnitQueue, (void**)qdu);
|
||||
if (err == LBQ_SUCCESS) {
|
||||
return 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user