Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Morlunk/Jumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Comminos <andrew@morlunk.com>2015-01-04 07:48:50 +0300
committerAndrew Comminos <andrew@morlunk.com>2015-01-04 07:48:50 +0300
commitf7ec75882e0055a08f78a91b0de44fb92f55fe2b (patch)
treecba6762e350c7d48a1c0ae8e6e29249335f61c72
parentf4fb2ce973964ccc1d65b2286c010213d432f097 (diff)
Report current bandwidth being used by AudioHandler.
-rw-r--r--src/main/java/com/morlunk/jumble/JumbleService.java2
-rw-r--r--src/main/java/com/morlunk/jumble/protocol/AudioHandler.java4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/com/morlunk/jumble/JumbleService.java b/src/main/java/com/morlunk/jumble/JumbleService.java
index 6e92f6c..80713ad 100644
--- a/src/main/java/com/morlunk/jumble/JumbleService.java
+++ b/src/main/java/com/morlunk/jumble/JumbleService.java
@@ -457,7 +457,7 @@ public class JumbleService extends Service implements JumbleConnection.JumbleCon
@Override
public int getCurrentBandwidth() throws RemoteException {
- return 0;
+ return mAudioHandler.getCurrentBandwidth();
}
@Override
diff --git a/src/main/java/com/morlunk/jumble/protocol/AudioHandler.java b/src/main/java/com/morlunk/jumble/protocol/AudioHandler.java
index eeeeff1..b8997d4 100644
--- a/src/main/java/com/morlunk/jumble/protocol/AudioHandler.java
+++ b/src/main/java/com/morlunk/jumble/protocol/AudioHandler.java
@@ -448,6 +448,10 @@ public class AudioHandler extends JumbleNetworkListener implements AudioInput.Au
// FIXME
}
+ public int getCurrentBandwidth() {
+ return JumbleConnection.calculateAudioBandwidth(mBitrate, mFramesPerPacket);
+ }
+
/**
* Shuts down the audio handler, halting input and output.
* The handler may still be reinitialized with {@link AudioHandler#initialize()} after.