| 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 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 // | 795 // |
| 796 // Note that HLS and MP4 detection are pre-redirect and path-based. It is | 796 // Note that HLS and MP4 detection are pre-redirect and path-based. It is |
| 797 // possible to load such a URL and find different content. | 797 // possible to load such a URL and find different content. |
| 798 bool UseWebMediaPlayerImpl(const GURL& url) { | 798 bool UseWebMediaPlayerImpl(const GURL& url) { |
| 799 // WMPI does not support HLS. | 799 // WMPI does not support HLS. |
| 800 if (media::MediaCodecUtil::IsHLSURL(url)) | 800 if (media::MediaCodecUtil::IsHLSURL(url)) |
| 801 return false; | 801 return false; |
| 802 | 802 |
| 803 // Don't use WMPI if the container likely contains a codec we can't decode in | 803 // Don't use WMPI if the container likely contains a codec we can't decode in |
| 804 // software and platform decoders are not available. | 804 // software and platform decoders are not available. |
| 805 if (base::EndsWith(url.path(), ".mp4", | 805 if (!media::HasPlatformDecoderSupport()) { |
| 806 base::CompareCase::INSENSITIVE_ASCII) && | 806 // Assume that "mp4" means H264. Without platform decoder support we cannot |
| 807 !media::HasPlatformDecoderSupport()) { | 807 // play it with Spitzer, thus fall back to AVDA. http://crbug.com/642988. |
| 808 return false; | 808 if (base::ToLowerASCII(url.spec()).find("mp4") != std::string::npos) |
| 809 return false; |
| 809 } | 810 } |
| 810 | 811 |
| 811 // Indicates if the Android MediaPlayer should be used instead of WMPI. | 812 // Indicates if the Android MediaPlayer should be used instead of WMPI. |
| 812 if (GetContentClient()->renderer()->ShouldUseMediaPlayerForURL(url)) | 813 if (GetContentClient()->renderer()->ShouldUseMediaPlayerForURL(url)) |
| 813 return false; | 814 return false; |
| 814 | 815 |
| 815 // Otherwise enable WMPI if indicated via experiment or command line. | 816 // Otherwise enable WMPI if indicated via experiment or command line. |
| 816 return media::IsUnifiedMediaPipelineEnabled(); | 817 return media::IsUnifiedMediaPipelineEnabled(); |
| 817 } | 818 } |
| 818 #endif // defined(OS_ANDROID) | 819 #endif // defined(OS_ANDROID) |
| (...skipping 5563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6382 // event target. Potentially a Pepper plugin will receive the event. | 6383 // event target. Potentially a Pepper plugin will receive the event. |
| 6383 // In order to tell whether a plugin gets the last mouse event and which it | 6384 // In order to tell whether a plugin gets the last mouse event and which it |
| 6384 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6385 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
| 6385 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6386 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
| 6386 // |pepper_last_mouse_event_target_|. | 6387 // |pepper_last_mouse_event_target_|. |
| 6387 pepper_last_mouse_event_target_ = nullptr; | 6388 pepper_last_mouse_event_target_ = nullptr; |
| 6388 #endif | 6389 #endif |
| 6389 } | 6390 } |
| 6390 | 6391 |
| 6391 } // namespace content | 6392 } // namespace content |
| OLD | NEW |