| 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 "media/blink/webmediaplayer_impl.h" | 5 #include "media/blink/webmediaplayer_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 873 | 873 |
| 874 return did_loading_progress; | 874 return did_loading_progress; |
| 875 } | 875 } |
| 876 | 876 |
| 877 void WebMediaPlayerImpl::Paint(blink::WebCanvas* canvas, | 877 void WebMediaPlayerImpl::Paint(blink::WebCanvas* canvas, |
| 878 const blink::WebRect& rect, | 878 const blink::WebRect& rect, |
| 879 cc::PaintFlags& flags) { | 879 cc::PaintFlags& flags) { |
| 880 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 880 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 881 TRACE_EVENT0("media", "WebMediaPlayerImpl:paint"); | 881 TRACE_EVENT0("media", "WebMediaPlayerImpl:paint"); |
| 882 | 882 |
| 883 // TODO(sandersd): Move this check into GetCurrentFrameFromCompositor() when | 883 // We can't copy from protected frames. |
| 884 // we have other ways to check if decoder owns video frame. | |
| 885 // See http://crbug.com/595716 and http://crbug.com/602708 | |
| 886 if (cdm_) | 884 if (cdm_) |
| 887 return; | 885 return; |
| 888 | 886 |
| 889 scoped_refptr<VideoFrame> video_frame = GetCurrentFrameFromCompositor(); | 887 scoped_refptr<VideoFrame> video_frame = GetCurrentFrameFromCompositor(); |
| 890 | 888 |
| 891 gfx::Rect gfx_rect(rect); | 889 gfx::Rect gfx_rect(rect); |
| 892 Context3D context_3d; | 890 Context3D context_3d; |
| 893 if (video_frame.get() && video_frame->HasTextures()) { | 891 if (video_frame.get() && video_frame->HasTextures()) { |
| 894 if (!context_3d_cb_.is_null()) | 892 if (!context_3d_cb_.is_null()) |
| 895 context_3d = context_3d_cb_.Run(); | 893 context_3d = context_3d_cb_.Run(); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 951 gpu::gles2::GLES2Interface* gl, | 949 gpu::gles2::GLES2Interface* gl, |
| 952 unsigned int texture, | 950 unsigned int texture, |
| 953 unsigned internal_format, | 951 unsigned internal_format, |
| 954 unsigned format, | 952 unsigned format, |
| 955 unsigned type, | 953 unsigned type, |
| 956 bool premultiply_alpha, | 954 bool premultiply_alpha, |
| 957 bool flip_y) { | 955 bool flip_y) { |
| 958 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 956 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
| 959 TRACE_EVENT0("media", "WebMediaPlayerImpl:copyVideoTextureToPlatformTexture"); | 957 TRACE_EVENT0("media", "WebMediaPlayerImpl:copyVideoTextureToPlatformTexture"); |
| 960 | 958 |
| 961 // TODO(sandersd): Move this check into GetCurrentFrameFromCompositor() when | 959 // We can't copy from protected frames. |
| 962 // we have other ways to check if decoder owns video frame. | |
| 963 // See http://crbug.com/595716 and http://crbug.com/602708 | |
| 964 if (cdm_) | 960 if (cdm_) |
| 965 return false; | 961 return false; |
| 966 | 962 |
| 967 scoped_refptr<VideoFrame> video_frame = GetCurrentFrameFromCompositor(); | 963 scoped_refptr<VideoFrame> video_frame = GetCurrentFrameFromCompositor(); |
| 968 if (!video_frame.get() || !video_frame->HasTextures()) { | 964 if (!video_frame.get() || !video_frame->HasTextures()) { |
| 969 return false; | 965 return false; |
| 970 } | 966 } |
| 971 | 967 |
| 972 Context3D context_3d; | 968 Context3D context_3d; |
| 973 if (!context_3d_cb_.is_null()) | 969 if (!context_3d_cb_.is_null()) |
| (...skipping 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2395 | 2391 |
| 2396 if (is_encrypted_) | 2392 if (is_encrypted_) |
| 2397 UMA_HISTOGRAM_VIDEO_HEIGHT("Media.VideoHeight.Initial.EME", height); | 2393 UMA_HISTOGRAM_VIDEO_HEIGHT("Media.VideoHeight.Initial.EME", height); |
| 2398 | 2394 |
| 2399 UMA_HISTOGRAM_VIDEO_HEIGHT("Media.VideoHeight.Initial.All", height); | 2395 UMA_HISTOGRAM_VIDEO_HEIGHT("Media.VideoHeight.Initial.All", height); |
| 2400 } | 2396 } |
| 2401 | 2397 |
| 2402 #undef UMA_HISTOGRAM_VIDEO_HEIGHT | 2398 #undef UMA_HISTOGRAM_VIDEO_HEIGHT |
| 2403 | 2399 |
| 2404 } // namespace media | 2400 } // namespace media |
| OLD | NEW |