mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-17 08:55:48 +00:00
Add support for handling alternate max packet sizes
This commit is contained in:
parent
a38e1f37eb
commit
8c8fcc7cbe
@ -17,7 +17,7 @@ void connectionDetectedFrameLoss(int startFrame, int endFrame);
|
||||
void connectionReceivedFrame(int frameIndex);
|
||||
void connectionLostPackets(int lastReceivedPacket, int nextReceivedPacket);
|
||||
|
||||
void initializeVideoDepacketizer(void);
|
||||
void initializeVideoDepacketizer(int pktSize);
|
||||
void destroyVideoDepacketizer(void);
|
||||
void processRtpPayload(PNV_VIDEO_PACKET videoPacket, int length);
|
||||
int getNextDecodeUnit(PDECODE_UNIT *du);
|
||||
|
@ -15,17 +15,19 @@ static int gotNextFrameStart;
|
||||
static int lastPacketInStream = 0;
|
||||
|
||||
static LINKED_BLOCKING_QUEUE decodeUnitQueue;
|
||||
static int packetSize;
|
||||
|
||||
static unsigned short lastSequenceNumber;
|
||||
|
||||
typedef struct _BUFFER_DESC {
|
||||
char* data;
|
||||
int offset;
|
||||
int length;
|
||||
unsigned int offset;
|
||||
unsigned int length;
|
||||
} BUFFER_DESC, *PBUFFER_DESC;
|
||||
|
||||
void initializeVideoDepacketizer(void) {
|
||||
void initializeVideoDepacketizer(int pktSize) {
|
||||
LbqInitializeLinkedBlockingQueue(&decodeUnitQueue, 15);
|
||||
packetSize = pktSize;
|
||||
}
|
||||
|
||||
static void clearAvcNalState(void) {
|
||||
@ -243,7 +245,7 @@ void processRtpPayload(PNV_VIDEO_PACKET videoPacket, int length) {
|
||||
currentPos.offset = 0;
|
||||
currentPos.length = length - sizeof(*videoPacket);
|
||||
|
||||
if (currentPos.length < 968) {
|
||||
if (currentPos.length < packetSize - sizeof(NV_VIDEO_PACKET)) {
|
||||
processRtpPayloadSlow(videoPacket, ¤tPos);
|
||||
return;
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ void initializeVideoStream(IP_ADDRESS host, PSTREAM_CONFIGURATION streamConfig,
|
||||
|
||||
LbqInitializeLinkedBlockingQueue(&packetQueue, 30);
|
||||
|
||||
initializeVideoDepacketizer();
|
||||
initializeVideoDepacketizer(configuration.packetSize);
|
||||
}
|
||||
|
||||
void destroyVideoStream(void) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user