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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2338213005: Look into full URL spec to see whether it is MP4 (Closed)
Patch Set: Simplified the test for "mp4" Created 4 years, 3 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 | media/base/mime_util_internal.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 // 789 //
790 // Note that HLS and MP4 detection are pre-redirect and path-based. It is 790 // Note that HLS and MP4 detection are pre-redirect and path-based. It is
791 // possible to load such a URL and find different content. 791 // possible to load such a URL and find different content.
792 bool UseWebMediaPlayerImpl(const GURL& url) { 792 bool UseWebMediaPlayerImpl(const GURL& url) {
793 // WMPI does not support HLS. 793 // WMPI does not support HLS.
794 if (media::MediaCodecUtil::IsHLSURL(url)) 794 if (media::MediaCodecUtil::IsHLSURL(url))
795 return false; 795 return false;
796 796
797 // Don't use WMPI if the container likely contains a codec we can't decode in 797 // Don't use WMPI if the container likely contains a codec we can't decode in
798 // software and platform decoders are not available. 798 // software and platform decoders are not available.
799 if (base::EndsWith(url.path(), ".mp4", 799 if (!media::HasPlatformDecoderSupport()) {
800 base::CompareCase::INSENSITIVE_ASCII) && 800 // Assume "mp4" means H264.
piman 2016/09/16 01:45:00 nit: please add a link to the bug. This logic is v
Tima Vaisburd 2016/09/16 19:04:22 Done.
801 !media::HasPlatformDecoderSupport()) { 801 if (base::ToLowerASCII(url.spec()).find("mp4") != std::string::npos)
802 return false; 802 return false;
803 } 803 }
804 804
805 // Indicates if the Android MediaPlayer should be used instead of WMPI. 805 // Indicates if the Android MediaPlayer should be used instead of WMPI.
806 if (GetContentClient()->renderer()->ShouldUseMediaPlayerForURL(url)) 806 if (GetContentClient()->renderer()->ShouldUseMediaPlayerForURL(url))
807 return false; 807 return false;
808 808
809 // Otherwise enable WMPI if indicated via experiment or command line. 809 // Otherwise enable WMPI if indicated via experiment or command line.
810 return media::IsUnifiedMediaPipelineEnabled(); 810 return media::IsUnifiedMediaPipelineEnabled();
811 } 811 }
812 #endif // defined(OS_ANDROID) 812 #endif // defined(OS_ANDROID)
(...skipping 5538 matching lines...) Expand 10 before | Expand all | Expand 10 after
6351 // event target. Potentially a Pepper plugin will receive the event. 6351 // event target. Potentially a Pepper plugin will receive the event.
6352 // In order to tell whether a plugin gets the last mouse event and which it 6352 // In order to tell whether a plugin gets the last mouse event and which it
6353 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6353 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6354 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6354 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6355 // |pepper_last_mouse_event_target_|. 6355 // |pepper_last_mouse_event_target_|.
6356 pepper_last_mouse_event_target_ = nullptr; 6356 pepper_last_mouse_event_target_ = nullptr;
6357 #endif 6357 #endif
6358 } 6358 }
6359 6359
6360 } // namespace content 6360 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | media/base/mime_util_internal.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698