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/media/android/webmediaplayer_android.h" | 5 #include "content/renderer/media/android/webmediaplayer_android.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <limits> | 9 #include <limits> |
10 | 10 |
(...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1254 | 1254 |
1255 scoped_refptr<VideoFrame> new_frame = VideoFrame::WrapNativeTexture( | 1255 scoped_refptr<VideoFrame> new_frame = VideoFrame::WrapNativeTexture( |
1256 media::PIXEL_FORMAT_ARGB, | 1256 media::PIXEL_FORMAT_ARGB, |
1257 gpu::MailboxHolder(texture_mailbox, texture_mailbox_sync_token, | 1257 gpu::MailboxHolder(texture_mailbox, texture_mailbox_sync_token, |
1258 texture_target), | 1258 texture_target), |
1259 media::BindToCurrentLoop(base::Bind(&OnReleaseTexture, | 1259 media::BindToCurrentLoop(base::Bind(&OnReleaseTexture, |
1260 stream_texture_factory_, | 1260 stream_texture_factory_, |
1261 remote_playback_texture_id)), | 1261 remote_playback_texture_id)), |
1262 canvas_size /* coded_size */, gfx::Rect(canvas_size) /* visible_rect */, | 1262 canvas_size /* coded_size */, gfx::Rect(canvas_size) /* visible_rect */, |
1263 canvas_size /* natural_size */, base::TimeDelta() /* timestamp */); | 1263 canvas_size /* natural_size */, base::TimeDelta() /* timestamp */); |
| 1264 if (!new_frame) |
| 1265 return; |
1264 SetCurrentFrameInternal(new_frame); | 1266 SetCurrentFrameInternal(new_frame); |
1265 } | 1267 } |
1266 | 1268 |
1267 void WebMediaPlayerAndroid::ReallocateVideoFrame() { | 1269 void WebMediaPlayerAndroid::ReallocateVideoFrame() { |
1268 DCHECK(main_thread_checker_.CalledOnValidThread()); | 1270 DCHECK(main_thread_checker_.CalledOnValidThread()); |
1269 if (needs_external_surface_) { | 1271 if (needs_external_surface_) { |
1270 // VideoFrame::CreateHoleFrame is only defined under VIDEO_HOLE. | 1272 // VideoFrame::CreateHoleFrame is only defined under VIDEO_HOLE. |
1271 #if defined(VIDEO_HOLE) | 1273 #if defined(VIDEO_HOLE) |
1272 if (!natural_size_.isEmpty()) { | 1274 if (!natural_size_.isEmpty()) { |
1273 // Now we finally know that "stream texture" and "video frame" won't | 1275 // Now we finally know that "stream texture" and "video frame" won't |
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1958 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER; | 1960 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER; |
1959 } else if (is_hls_url == is_hls) { | 1961 } else if (is_hls_url == is_hls) { |
1960 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER; | 1962 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER; |
1961 } | 1963 } |
1962 UMA_HISTOGRAM_ENUMERATION( | 1964 UMA_HISTOGRAM_ENUMERATION( |
1963 "Media.Android.IsHttpLiveStreamingMediaPredictionResult", | 1965 "Media.Android.IsHttpLiveStreamingMediaPredictionResult", |
1964 result, PREDICTION_RESULT_MAX); | 1966 result, PREDICTION_RESULT_MAX); |
1965 } | 1967 } |
1966 | 1968 |
1967 } // namespace content | 1969 } // namespace content |
OLD | NEW |