refactored StreamingService interface so it acts as a Factory (returning new instances of called classes, eg Extractor), rather than passing Class objects (which loses type safety) which are then instantiated. Also noticed there is a conflict between existing gradle setup and mine: misc.xml and app.iml have had their jvm version values switched from 1.8 to 1.7

This commit is contained in:
Adam Howard 2015-11-02 15:03:11 +00:00
parent f67158a2a7
commit db0508b9ab
13 changed files with 56 additions and 50 deletions

View file

@ -59,7 +59,7 @@ public class VideoInfo {
public static final int VIDEO_AVAILABLE = 0x00;
public static final int VIDEO_UNAVAILABLE = 0x01;
public static final int VIDEO_UNAVAILABLE_GEMA = 0x02;
public static final int VIDEO_UNAVAILABLE_GEMA = 0x02;//German DRM organisation; sound pretty draconian
public static String getNameById(int id) {
switch(id) {
@ -68,8 +68,7 @@ public class VideoInfo {
case I_WEBM: return F_WEBM;
case I_M4A: return F_M4A;
case I_WEBMA: return F_WEBMA;
default: Log.e(TAG, "format not known: " +
Integer.toString(id) + "call the programmer he messed it up.");
default: formatNotKnown(id);
}
return "";
}
@ -81,8 +80,7 @@ public class VideoInfo {
case I_WEBM: return C_WEBM;
case I_M4A: return C_M4A;
case I_WEBMA: return C_WEBMA;
default: Log.e(TAG, "format not known: " +
Integer.toString(id) + "call the programmer he messed it up.");
default: formatNotKnown(id);
}
return "";
}
@ -94,8 +92,7 @@ public class VideoInfo {
case I_WEBM: return M_WEBM;
case I_M4A: return M_M4A;
case I_WEBMA: return M_WEBMA;
default: Log.e(TAG, "format not known: " +
Integer.toString(id) + "call the programmer he messed it up.");
default: formatNotKnown(id);
}
return "";
}
@ -109,6 +106,12 @@ public class VideoInfo {
public String resolution = "";
}
protected static void formatNotKnown(int id)
{
Log.e(TAG, "format not known: \"" +
Integer.toString(id) + "\". Call the programmer, he messed it up!");
}
public static class AudioStream {
public AudioStream(String url, int format, int bandwidth, int samplingRate) {
this.url = url; this.format = format;