-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
427 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
app/src/main/java/com/fpvout/digiview/streaming/StreamAudioBitrate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.fpvout.digiview.streaming; | ||
|
||
public class StreamAudioBitrate { | ||
public static final String DEFAULT = "128"; | ||
|
||
public static int getBitrate(String value) { | ||
return Integer.parseInt(value) * 1024; | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
app/src/main/java/com/fpvout/digiview/streaming/StreamAudioSampleRate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.fpvout.digiview.streaming; | ||
|
||
public class StreamAudioSampleRate { | ||
public static final String DEFAULT = "44100hz"; | ||
|
||
public static int getSampleRate(String value) { | ||
switch (value) { | ||
case "8khz": | ||
return 8000; | ||
case "11025hz": | ||
return 11025; | ||
case "16khz": | ||
return 16000; | ||
case "22050hz": | ||
return 22050; | ||
case "32000hz": | ||
return 32000; | ||
case DEFAULT: | ||
return 44100; | ||
case "48khz": | ||
return 48000; | ||
case "96khz": | ||
return 96000; | ||
} | ||
|
||
return -1; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
app/src/main/java/com/fpvout/digiview/streaming/StreamAudioSource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.fpvout.digiview.streaming; | ||
|
||
import android.media.MediaRecorder; | ||
|
||
public class StreamAudioSource { | ||
public static final String DEFAULT = "default"; | ||
public static final String INTERNAL = "internal"; | ||
public static final String PERFORMANCE = "performance"; | ||
|
||
public static int getAudioSource(String value) { | ||
switch (value) { | ||
case DEFAULT: | ||
return MediaRecorder.AudioSource.DEFAULT; | ||
case "mic": | ||
return MediaRecorder.AudioSource.MIC; | ||
case "cam": | ||
return MediaRecorder.AudioSource.CAMCORDER; | ||
case "communication": | ||
return MediaRecorder.AudioSource.VOICE_COMMUNICATION; | ||
case PERFORMANCE: | ||
return MediaRecorder.AudioSource.VOICE_PERFORMANCE; | ||
} | ||
|
||
return -1; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
app/src/main/java/com/fpvout/digiview/streaming/StreamBitrate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.fpvout.digiview.streaming; | ||
|
||
public class StreamBitrate { | ||
public static final String DEFAULT = "2500"; | ||
|
||
public static int getBitrate(String value) { | ||
return Integer.parseInt(value) * 1024; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
app/src/main/java/com/fpvout/digiview/streaming/StreamFramerate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.fpvout.digiview.streaming; | ||
|
||
public class StreamFramerate { | ||
public static final String DEFAULT = "60"; | ||
|
||
public static int getFramerate(String value) { | ||
return Integer.parseInt(value); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
app/src/main/java/com/fpvout/digiview/streaming/StreamResolution.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.fpvout.digiview.streaming; | ||
|
||
public class StreamResolution { | ||
public static final String DEFAULT = "720p"; | ||
private final int width; | ||
private final int height; | ||
|
||
private StreamResolution(int width, int height) { | ||
this.width = width; | ||
this.height = height; | ||
} | ||
|
||
public static StreamResolution getResolution(String value) { | ||
switch (value) { | ||
case "240p": | ||
return new StreamResolution(426, 240); | ||
case "360p": | ||
return new StreamResolution(640, 360); | ||
case "480p": | ||
return new StreamResolution(854, 480); | ||
case DEFAULT: | ||
return new StreamResolution(1280, 720); | ||
case "1080p": | ||
return new StreamResolution(1920, 1080); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
public int getWidth() { | ||
return width; | ||
} | ||
|
||
public int getHeight() { | ||
return height; | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.