1 |
--- chromium-61.0.3153.0/media/base/mime_util_internal.cc.android 2017-07-16 16:14:43.401675874 +0200 |
2 |
+++ chromium-61.0.3153.0/media/base/mime_util_internal.cc 2017-07-16 16:24:49.798008839 +0200 |
3 |
@@ -593,142 +593,6 @@ |
4 |
allow_proprietary_codecs_ = false; |
5 |
} |
6 |
|
7 |
-// static |
8 |
-bool MimeUtil::IsCodecSupportedOnAndroid( |
9 |
- Codec codec, |
10 |
- const std::string& mime_type_lower_case, |
11 |
- bool is_encrypted, |
12 |
- const PlatformInfo& platform_info) { |
13 |
- DVLOG(3) << __func__; |
14 |
- DCHECK_NE(mime_type_lower_case, ""); |
15 |
- |
16 |
- // Encrypted block support is never available without platform decoders. |
17 |
- if (is_encrypted && !platform_info.has_platform_decoders) |
18 |
- return false; |
19 |
- |
20 |
- // NOTE: We do not account for Media Source Extensions (MSE) within these |
21 |
- // checks since it has its own isTypeSupported() which will handle platform |
22 |
- // specific codec rejections. See http://crbug.com/587303. |
23 |
- |
24 |
- switch (codec) { |
25 |
- // ---------------------------------------------------------------------- |
26 |
- // The following codecs are never supported. |
27 |
- // ---------------------------------------------------------------------- |
28 |
- case INVALID_CODEC: |
29 |
- case THEORA: |
30 |
- return false; |
31 |
- |
32 |
- // ---------------------------------------------------------------------- |
33 |
- // The remaining codecs may be supported depending on platform abilities. |
34 |
- // ---------------------------------------------------------------------- |
35 |
- case MPEG2_AAC: |
36 |
- // MPEG2_AAC cannot be used in HLS (mpegurl suffix), but this is enforced |
37 |
- // in the parsing step by excluding MPEG2_AAC from the list of |
38 |
- // valid codecs to be used with HLS mime types. |
39 |
- DCHECK(!base::EndsWith(mime_type_lower_case, "mpegurl", |
40 |
- base::CompareCase::SENSITIVE)); |
41 |
- case PCM: |
42 |
- case MP3: |
43 |
- case MPEG4_AAC: |
44 |
- case FLAC: |
45 |
- case VORBIS: |
46 |
- // These codecs are always supported; via a platform decoder (when used |
47 |
- // with MSE/EME), a software decoder (the unified pipeline), or with |
48 |
- // MediaPlayer. |
49 |
- DCHECK(!is_encrypted || platform_info.has_platform_decoders); |
50 |
- return true; |
51 |
- |
52 |
- case OPUS: |
53 |
- // If clear, the unified pipeline can always decode Opus in software. |
54 |
- if (!is_encrypted) |
55 |
- return true; |
56 |
- |
57 |
- // Otherwise, platform support is required. |
58 |
- if (!platform_info.supports_opus) { |
59 |
- DVLOG(3) << "Platform does not support opus"; |
60 |
- return false; |
61 |
- } |
62 |
- |
63 |
- // MediaPlayer does not support Opus in ogg containers. |
64 |
- if (base::EndsWith(mime_type_lower_case, "ogg", |
65 |
- base::CompareCase::SENSITIVE)) { |
66 |
- return false; |
67 |
- } |
68 |
- |
69 |
- DCHECK(!is_encrypted || platform_info.has_platform_decoders); |
70 |
- return true; |
71 |
- |
72 |
- case H264: |
73 |
- // When content is not encrypted we fall back to MediaPlayer, thus we |
74 |
- // always support H264. For EME we need MediaCodec. |
75 |
- return !is_encrypted || platform_info.has_platform_decoders; |
76 |
- |
77 |
- case HEVC: |
78 |
-#if BUILDFLAG(ENABLE_HEVC_DEMUXING) |
79 |
- if (!platform_info.has_platform_decoders) |
80 |
- return false; |
81 |
- |
82 |
-#if defined(OS_ANDROID) |
83 |
- // HEVC/H.265 is supported in Lollipop+ (API Level 21), according to |
84 |
- // http://developer.android.com/reference/android/media/MediaFormat.html |
85 |
- return base::android::BuildInfo::GetInstance()->sdk_int() >= 21; |
86 |
-#else |
87 |
- return true; |
88 |
-#endif // defined(OS_ANDROID) |
89 |
-#else |
90 |
- return false; |
91 |
-#endif // BUILDFLAG(ENABLE_HEVC_DEMUXING) |
92 |
- |
93 |
- case VP8: |
94 |
- // If clear, the unified pipeline can always decode VP8 in software. |
95 |
- if (!is_encrypted) |
96 |
- return true; |
97 |
- |
98 |
- if (is_encrypted) |
99 |
- return platform_info.has_platform_vp8_decoder; |
100 |
- |
101 |
- // MediaPlayer can always play VP8. Note: This is incorrect for MSE, but |
102 |
- // MSE does not use this code. http://crbug.com/587303. |
103 |
- return true; |
104 |
- |
105 |
- case VP9: { |
106 |
- if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
107 |
- switches::kReportVp9AsAnUnsupportedMimeType)) { |
108 |
- return false; |
109 |
- } |
110 |
- |
111 |
- // If clear, the unified pipeline can always decode VP9 in software. |
112 |
- if (!is_encrypted) |
113 |
- return true; |
114 |
- |
115 |
- if (!platform_info.has_platform_vp9_decoder) |
116 |
- return false; |
117 |
- |
118 |
- // Encrypted content is demuxed so the container is irrelevant. |
119 |
- if (is_encrypted) |
120 |
- return true; |
121 |
- |
122 |
- // MediaPlayer only supports VP9 in WebM. |
123 |
- return mime_type_lower_case == "video/webm"; |
124 |
- } |
125 |
- |
126 |
- case DOLBY_VISION: |
127 |
- // This function is only called on Android which doesn't support Dolby |
128 |
- // Vision. |
129 |
- return false; |
130 |
- |
131 |
- case AC3: |
132 |
- case EAC3: |
133 |
-#if BUILDFLAG(ENABLE_AC3_EAC3_AUDIO_DEMUXING) |
134 |
- return true; |
135 |
-#else |
136 |
- return false; |
137 |
-#endif |
138 |
- } |
139 |
- |
140 |
- return false; |
141 |
-} |
142 |
- |
143 |
// Make a default ParsedCodecResult. Values should indicate "unspecified" |
144 |
// where possible. Color space is an exception where we choose a default value |
145 |
// because most codec strings will not describe a color space. |
146 |
@@ -995,15 +859,6 @@ |
147 |
return IsNotSupported; |
148 |
} |
149 |
|
150 |
-#if defined(OS_ANDROID) |
151 |
- // TODO(chcunningham): Delete this. Android platform support should be |
152 |
- // handled by (android specific) media::IsSupportedVideoConfig() above. |
153 |
- if (!IsCodecSupportedOnAndroid(codec, mime_type_lower_case, is_encrypted, |
154 |
- platform_info_)) { |
155 |
- return IsNotSupported; |
156 |
- } |
157 |
-#endif |
158 |
- |
159 |
return ambiguous_platform_support ? MayBeSupported : IsSupported; |
160 |
} |
161 |
|