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

Side by Side Diff: content/renderer/media/media_factory.cc

Issue 2770293002: Detect HLS from demuxing results (Closed)
Patch Set: Minor changes in comments Created 3 years, 4 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 | « no previous file | gpu/ipc/service/stream_texture_android.cc » ('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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "content/renderer/media/media_factory.h" 5 #include "content/renderer/media/media_factory.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/metrics/field_trial_params.h" 9 #include "base/metrics/field_trial_params.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 // Returns true if the MediaPlayerRenderer should be used for playback, false 117 // Returns true if the MediaPlayerRenderer should be used for playback, false
118 // if the default renderer should be used instead. 118 // if the default renderer should be used instead.
119 // 119 //
120 // Note that HLS and MP4 detection are pre-redirect and path-based. It is 120 // Note that HLS and MP4 detection are pre-redirect and path-based. It is
121 // possible to load such a URL and find different content. 121 // possible to load such a URL and find different content.
122 bool UseMediaPlayerRenderer(const GURL& url) { 122 bool UseMediaPlayerRenderer(const GURL& url) {
123 // Always use the default renderer for playing blob URLs. 123 // Always use the default renderer for playing blob URLs.
124 if (url.SchemeIsBlob()) 124 if (url.SchemeIsBlob())
125 return false; 125 return false;
126 126
127 // The default renderer does not support HLS.
128 if (media::MediaCodecUtil::IsHLSURL(url))
129 return true;
130
131 // Don't use the default renderer if the container likely contains a codec we 127 // Don't use the default renderer if the container likely contains a codec we
132 // can't decode in software and platform decoders are not available. 128 // can't decode in software and platform decoders are not available.
133 if (!media::HasPlatformDecoderSupport()) { 129 if (!media::HasPlatformDecoderSupport()) {
134 // Assume that "mp4" means H264. Without platform decoder support we cannot 130 // Assume that "mp4" means H264. Without platform decoder support we cannot
135 // play it with the default renderer so use MediaPlayerRenderer. 131 // play it with the default renderer so use MediaPlayerRenderer.
136 // http://crbug.com/642988. 132 // http://crbug.com/642988.
137 if (base::ToLowerASCII(url.spec()).find("mp4") != std::string::npos) 133 if (base::ToLowerASCII(url.spec()).find("mp4") != std::string::npos)
138 return true; 134 return true;
139 } 135 }
140 136
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 DCHECK(remote_interfaces_); 492 DCHECK(remote_interfaces_);
497 media_interface_factory_.reset( 493 media_interface_factory_.reset(
498 new MediaInterfaceFactory(remote_interfaces_)); 494 new MediaInterfaceFactory(remote_interfaces_));
499 } 495 }
500 496
501 return media_interface_factory_.get(); 497 return media_interface_factory_.get();
502 } 498 }
503 #endif // BUILDFLAG(ENABLE_MOJO_MEDIA) 499 #endif // BUILDFLAG(ENABLE_MOJO_MEDIA)
504 500
505 } // namespace content 501 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | gpu/ipc/service/stream_texture_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698