OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 |
OLD | NEW |