/* Initializes the input stream */ int initializeInputStream(char* aesKeyData, int aesKeyDataLength, char* aesIv, int aesIvLength) { if (aesIvLength != OAES_BLOCK_SIZE) { Limelog("AES IV is incorrect length. Should be %d\n", aesIvLength); return -1; } oaesContext = oaes_alloc(); if (oaesContext == NULL) { Limelog("Failed to allocate OpenAES context\n"); return -1; } if (oaes_set_option(oaesContext, OAES_OPTION_CBC, aesIv) != OAES_RET_SUCCESS) { Limelog("Failed to set CBC and IV on OAES context\n"); return -1; } if (oaes_key_import_data(oaesContext, (const unsigned char*)aesKeyData, aesKeyDataLength) != OAES_RET_SUCCESS) { Limelog("Failed to import AES key data\n"); return -1; } LbqInitializeLinkedBlockingQueue(&packetQueue, 30); initialized = 1; return 0; }
/* Initialize the audio stream */ void initializeAudioStream(IP_ADDRESS host, PAUDIO_RENDERER_CALLBACKS arCallbacks, PCONNECTION_LISTENER_CALLBACKS clCallbacks) { memcpy(&callbacks, arCallbacks, sizeof(callbacks)); remoteHost = host; listenerCallbacks = clCallbacks; LbqInitializeLinkedBlockingQueue(&packetQueue, 30); }
// Initialize the audio stream void initializeAudioStream(void) { if ((AudioCallbacks.capabilities & CAPABILITY_DIRECT_SUBMIT) == 0) { LbqInitializeLinkedBlockingQueue(&packetQueue, 30); } RtpqInitializeQueue(&rtpReorderQueue, RTPQ_DEFAULT_MAX_SIZE, RTPQ_DEFAULT_QUEUE_TIME); lastSeq = 0; receivedDataFromPeer = 0; }
/* Initializes the control stream */ int initializeControlStream(void) { PltCreateEvent(&invalidateRefFramesEvent); LbqInitializeLinkedBlockingQueue(&invalidReferenceFrameTuples, 20); if (ServerMajorVersion == 3) { packetTypes = (short*)packetTypesGen3; payloadLengths = (short*)payloadLengthsGen3; preconstructedPayloads = (char**)preconstructedPayloadsGen3; } else { packetTypes = (short*)packetTypesGen4; payloadLengths = (short*)payloadLengthsGen4; preconstructedPayloads = (char**)preconstructedPayloadsGen4; } idrFrameRequired = 0; currentFrame = 0; lossCountSinceLastReport = 0; return 0; }