Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: media/base/android/media_codec_util.cc

Issue 2046253002: When HLS redirects are encountered recreate WebMediaPlayer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile failures. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/base/android/media_codec_util.h ('k') | media/blink/buffered_data_source.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/base/android/media_codec_util.h" 5 #include "media/base/android/media_codec_util.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 // "OMX.google" prefix is always used for SW decoders, so that's what we 171 // "OMX.google" prefix is always used for SW decoders, so that's what we
172 // use. "OMX.SEC.*" codec is Samsung software implementation - report it 172 // use. "OMX.SEC.*" codec is Samsung software implementation - report it
173 // as unaccelerated as well. 173 // as unaccelerated as well.
174 return base::StartsWith(codec_name, "OMX.google.", 174 return base::StartsWith(codec_name, "OMX.google.",
175 base::CompareCase::SENSITIVE) || 175 base::CompareCase::SENSITIVE) ||
176 base::StartsWith(codec_name, "OMX.SEC.", base::CompareCase::SENSITIVE); 176 base::StartsWith(codec_name, "OMX.SEC.", base::CompareCase::SENSITIVE);
177 } 177 }
178 178
179 // static 179 // static
180 bool MediaCodecUtil::IsHLSPath(const GURL& url) { 180 bool MediaCodecUtil::IsHLSPath(const GURL& url) {
181 if (!url.SchemeIsHTTPOrHTTPS() && !url.SchemeIsFile()) 181 return (url.SchemeIsHTTPOrHTTPS() || url.SchemeIsFile()) &&
182 return false; 182 base::EndsWith(url.path(), ".m3u8",
183 183 base::CompareCase::INSENSITIVE_ASCII);
184 std::string path = url.path();
185 return base::EndsWith(path, ".m3u8", base::CompareCase::INSENSITIVE_ASCII);
186 } 184 }
187 185
188 // static 186 // static
189 bool MediaCodecUtil::IsHLSURL(const GURL& url) { 187 bool MediaCodecUtil::IsHLSURL(const GURL& url) {
190 if (!url.SchemeIsHTTPOrHTTPS() && !url.SchemeIsFile()) 188 return (url.SchemeIsHTTPOrHTTPS() || url.SchemeIsFile()) &&
191 return false; 189 url.spec().find("m3u8") != std::string::npos;
192
193 std::string spec = url.spec();
194 if (base::EndsWith(spec, ".m3u8", base::CompareCase::INSENSITIVE_ASCII))
195 return true;
196
197 return (spec.find("m3u8") != std::string::npos);
198 } 190 }
199 191
200 // static 192 // static
201 bool MediaCodecUtil::RegisterMediaCodecUtil(JNIEnv* env) { 193 bool MediaCodecUtil::RegisterMediaCodecUtil(JNIEnv* env) {
202 return RegisterNativesImpl(env); 194 return RegisterNativesImpl(env);
203 } 195 }
204 196
205 // static 197 // static
206 bool MediaCodecUtil::IsVp8DecoderAvailable() { 198 bool MediaCodecUtil::IsVp8DecoderAvailable() {
207 return IsMediaCodecAvailable() && IsDecoderSupportedByDevice(kVp8MimeType); 199 return IsMediaCodecAvailable() && IsDecoderSupportedByDevice(kVp8MimeType);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 if (base::StartsWith(model, model_prefixes[i], 231 if (base::StartsWith(model, model_prefixes[i],
240 base::CompareCase::INSENSITIVE_ASCII)) { 232 base::CompareCase::INSENSITIVE_ASCII)) {
241 return false; 233 return false;
242 } 234 }
243 } 235 }
244 236
245 return true; 237 return true;
246 } 238 }
247 239
248 } // namespace media 240 } // namespace media
OLDNEW
« no previous file with comments | « media/base/android/media_codec_util.h ('k') | media/blink/buffered_data_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698