frameworks/base
Révision | 9ba0bb95bec8e1210149d34096fb1ec51e493bae (tree) |
---|---|
l'heure | 2015-12-22 13:13:51 |
Auteur | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
MediaFile: support more media types
@@ -43,13 +43,19 @@ public class MediaFile { | ||
43 | 43 | public static final int FILE_TYPE_AAC = 8; |
44 | 44 | public static final int FILE_TYPE_MKA = 9; |
45 | 45 | public static final int FILE_TYPE_FLAC = 10; |
46 | + public static final int FILE_TYPE_3GPA = 11; | |
47 | + public static final int FILE_TYPE_AC3 = 12; | |
48 | + public static final int FILE_TYPE_APE = 13; | |
49 | + public static final int FILE_TYPE_WEBMA = 14; | |
50 | + public static final int FILE_TYPE_PCM = 15; | |
51 | + public static final int FILE_TYPE_DTS = 16; | |
46 | 52 | private static final int FIRST_AUDIO_FILE_TYPE = FILE_TYPE_MP3; |
47 | - private static final int LAST_AUDIO_FILE_TYPE = FILE_TYPE_FLAC; | |
53 | + private static final int LAST_AUDIO_FILE_TYPE = FILE_TYPE_DTS; | |
48 | 54 | |
49 | 55 | // MIDI file types |
50 | - public static final int FILE_TYPE_MID = 11; | |
51 | - public static final int FILE_TYPE_SMF = 12; | |
52 | - public static final int FILE_TYPE_IMY = 13; | |
56 | + public static final int FILE_TYPE_MID = 18; | |
57 | + public static final int FILE_TYPE_SMF = 19; | |
58 | + public static final int FILE_TYPE_IMY = 20; | |
53 | 59 | private static final int FIRST_MIDI_FILE_TYPE = FILE_TYPE_MID; |
54 | 60 | private static final int LAST_MIDI_FILE_TYPE = FILE_TYPE_IMY; |
55 | 61 |
@@ -64,8 +70,12 @@ public class MediaFile { | ||
64 | 70 | public static final int FILE_TYPE_MP2TS = 28; |
65 | 71 | public static final int FILE_TYPE_AVI = 29; |
66 | 72 | public static final int FILE_TYPE_WEBM = 30; |
73 | + public static final int FILE_TYPE_DIVX = 31; | |
74 | + public static final int FILE_TYPE_FLV = 32; | |
75 | + public static final int FILE_TYPE_RV = 33; | |
76 | + public static final int FILE_TYPE_VC1 = 34; | |
67 | 77 | private static final int FIRST_VIDEO_FILE_TYPE = FILE_TYPE_MP4; |
68 | - private static final int LAST_VIDEO_FILE_TYPE = FILE_TYPE_WEBM; | |
78 | + private static final int LAST_VIDEO_FILE_TYPE = FILE_TYPE_VC1; | |
69 | 79 | |
70 | 80 | // More video file types |
71 | 81 | public static final int FILE_TYPE_MP2PS = 200; |
@@ -73,12 +83,12 @@ public class MediaFile { | ||
73 | 83 | private static final int LAST_VIDEO_FILE_TYPE2 = FILE_TYPE_MP2PS; |
74 | 84 | |
75 | 85 | // Image file types |
76 | - public static final int FILE_TYPE_JPEG = 31; | |
77 | - public static final int FILE_TYPE_GIF = 32; | |
78 | - public static final int FILE_TYPE_PNG = 33; | |
79 | - public static final int FILE_TYPE_BMP = 34; | |
80 | - public static final int FILE_TYPE_WBMP = 35; | |
81 | - public static final int FILE_TYPE_WEBP = 36; | |
86 | + public static final int FILE_TYPE_JPEG = 61; | |
87 | + public static final int FILE_TYPE_GIF = 62; | |
88 | + public static final int FILE_TYPE_PNG = 63; | |
89 | + public static final int FILE_TYPE_BMP = 64; | |
90 | + public static final int FILE_TYPE_WBMP = 65; | |
91 | + public static final int FILE_TYPE_WEBP = 66; | |
82 | 92 | private static final int FIRST_IMAGE_FILE_TYPE = FILE_TYPE_JPEG; |
83 | 93 | private static final int LAST_IMAGE_FILE_TYPE = FILE_TYPE_WEBP; |
84 | 94 |
@@ -171,6 +181,7 @@ public class MediaFile { | ||
171 | 181 | addFileType("MPGA", FILE_TYPE_MP3, "audio/mpeg", MtpConstants.FORMAT_MP3); |
172 | 182 | addFileType("M4A", FILE_TYPE_M4A, "audio/mp4", MtpConstants.FORMAT_MPEG); |
173 | 183 | addFileType("WAV", FILE_TYPE_WAV, "audio/x-wav", MtpConstants.FORMAT_WAV); |
184 | + addFileType("WAV", FILE_TYPE_PCM, "audio/wav"); | |
174 | 185 | addFileType("AMR", FILE_TYPE_AMR, "audio/amr"); |
175 | 186 | addFileType("AWB", FILE_TYPE_AWB, "audio/amr-wb"); |
176 | 187 | if (isWMAEnabled()) { |
@@ -178,10 +189,13 @@ public class MediaFile { | ||
178 | 189 | } |
179 | 190 | addFileType("OGG", FILE_TYPE_OGG, "audio/ogg", MtpConstants.FORMAT_OGG); |
180 | 191 | addFileType("OGG", FILE_TYPE_OGG, "application/ogg", MtpConstants.FORMAT_OGG); |
192 | + addFileType("OGA", FILE_TYPE_OGG, "audio/ogg", MtpConstants.FORMAT_OGG); | |
181 | 193 | addFileType("OGA", FILE_TYPE_OGG, "application/ogg", MtpConstants.FORMAT_OGG); |
182 | 194 | addFileType("AAC", FILE_TYPE_AAC, "audio/aac", MtpConstants.FORMAT_AAC); |
183 | 195 | addFileType("AAC", FILE_TYPE_AAC, "audio/aac-adts", MtpConstants.FORMAT_AAC); |
184 | 196 | addFileType("MKA", FILE_TYPE_MKA, "audio/x-matroska"); |
197 | + addFileType("AC3", FILE_TYPE_AC3, "audio/ac3"); | |
198 | + addFileType("APE", FILE_TYPE_APE, "audio/x-ape"); | |
185 | 199 | |
186 | 200 | addFileType("MID", FILE_TYPE_MID, "audio/midi"); |
187 | 201 | addFileType("MIDI", FILE_TYPE_MID, "audio/midi"); |
@@ -204,7 +218,13 @@ public class MediaFile { | ||
204 | 218 | addFileType("MKV", FILE_TYPE_MKV, "video/x-matroska"); |
205 | 219 | addFileType("WEBM", FILE_TYPE_WEBM, "video/webm"); |
206 | 220 | addFileType("TS", FILE_TYPE_MP2TS, "video/mp2ts"); |
221 | + addFileType("MPG", FILE_TYPE_MP2TS, "video/mp2ts"); | |
207 | 222 | addFileType("AVI", FILE_TYPE_AVI, "video/avi"); |
223 | + addFileType("DIVX", FILE_TYPE_DIVX, "video/divx"); | |
224 | + addFileType("FLV", FILE_TYPE_FLV, "video/x-flv"); | |
225 | + addFileType("RM", FILE_TYPE_RV, "video/vnd.rn-realvideo"); | |
226 | + addFileType("RMVB", FILE_TYPE_RV, "video/vnd.rn-realvideo"); | |
227 | + addFileType("VC1", FILE_TYPE_VC1, "video/vc1"); | |
208 | 228 | |
209 | 229 | if (isWMVEnabled()) { |
210 | 230 | addFileType("WMV", FILE_TYPE_WMV, "video/x-ms-wmv", MtpConstants.FORMAT_WMV); |