From 037df87585f2cef843f7e800911b2d7d5e494748 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 19 Oct 2014 00:24:47 -0400 Subject: [PATCH] Add connection listener callbacks to fix crash on starting streaming --- Limelight/Connection.m | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/Limelight/Connection.m b/Limelight/Connection.m index 2a8f0e1..27f36ee 100644 --- a/Limelight/Connection.m +++ b/Limelight/Connection.m @@ -125,6 +125,41 @@ void ArDecodeAndPlaySample(char* sampleData, int sampleLength) } } +void ClStageStarting(int stage) +{ + NSLog(@"Starting stage: %d", stage); +} + +void ClStageComplete(int stage) +{ + NSLog(@"Stage %d complete", stage); +} + +void ClStageFailed(int stage, long errorCode) +{ + NSLog(@"Stage %d failed: %ld", stage, errorCode); +} + +void ClConnectionStarted(void) +{ + NSLog(@"Connection started"); +} + +void ClConnectionTerminated(long errorCode) +{ + NSLog(@"ConnectionTerminated: %ld", errorCode); +} + +void ClDisplayMessage(char* message) +{ + NSLog(@"DisplayMessage: %s", message); +} + +void ClDisplayTransientMessage(char* message) +{ + NSLog(@"DisplayTransientMessage: %s", message); +} + -(id) initWithHost:(int)ipaddr width:(int)width height:(int)height renderer:(VideoDecoderRenderer*)renderer { self = [super init]; @@ -133,6 +168,9 @@ void ArDecodeAndPlaySample(char* sampleData, int sampleLength) streamConfig.width = width; streamConfig.height = height; streamConfig.fps = 30; + streamConfig.bitrate = 5000; + streamConfig.packetSize = 1024; + // FIXME: RI AES members drCallbacks.setup = DrSetup; drCallbacks.start = DrStart; @@ -146,6 +184,13 @@ void ArDecodeAndPlaySample(char* sampleData, int sampleLength) arCallbacks.release = ArRelease; arCallbacks.decodeAndPlaySample = ArDecodeAndPlaySample; + clCallbacks.stageStarting = ClStageStarting; + clCallbacks.stageComplete = ClStageComplete; + clCallbacks.stageFailed = ClStageFailed; + clCallbacks.connectionStarted = ClConnectionStarted; + clCallbacks.connectionTerminated = ClConnectionTerminated; + clCallbacks.displayMessage = ClDisplayMessage; + clCallbacks.displayTransientMessage = ClDisplayTransientMessage; //////// Don't think any of this is used ///////// NSError *audioSessionError = nil;