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

Side by Side Diff: content/renderer/media/android/webmediaplayer_android.cc

Issue 1476523005: Verify returned frames from media::VideoFrame::Wrap*() methods (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 11 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
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/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 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 1248
1249 scoped_refptr<VideoFrame> new_frame = VideoFrame::WrapNativeTexture( 1249 scoped_refptr<VideoFrame> new_frame = VideoFrame::WrapNativeTexture(
1250 media::PIXEL_FORMAT_ARGB, 1250 media::PIXEL_FORMAT_ARGB,
1251 gpu::MailboxHolder(texture_mailbox, texture_mailbox_sync_token, 1251 gpu::MailboxHolder(texture_mailbox, texture_mailbox_sync_token,
1252 texture_target), 1252 texture_target),
1253 media::BindToCurrentLoop(base::Bind(&OnReleaseTexture, 1253 media::BindToCurrentLoop(base::Bind(&OnReleaseTexture,
1254 stream_texture_factory_, 1254 stream_texture_factory_,
1255 remote_playback_texture_id)), 1255 remote_playback_texture_id)),
1256 canvas_size /* coded_size */, gfx::Rect(canvas_size) /* visible_rect */, 1256 canvas_size /* coded_size */, gfx::Rect(canvas_size) /* visible_rect */,
1257 canvas_size /* natural_size */, base::TimeDelta() /* timestamp */); 1257 canvas_size /* natural_size */, base::TimeDelta() /* timestamp */);
1258 if (!new_frame)
1259 return;
1258 SetCurrentFrameInternal(new_frame); 1260 SetCurrentFrameInternal(new_frame);
1259 } 1261 }
1260 1262
1261 void WebMediaPlayerAndroid::ReallocateVideoFrame() { 1263 void WebMediaPlayerAndroid::ReallocateVideoFrame() {
1262 DCHECK(main_thread_checker_.CalledOnValidThread()); 1264 DCHECK(main_thread_checker_.CalledOnValidThread());
1263 if (needs_external_surface_) { 1265 if (needs_external_surface_) {
1264 // VideoFrame::CreateHoleFrame is only defined under VIDEO_HOLE. 1266 // VideoFrame::CreateHoleFrame is only defined under VIDEO_HOLE.
1265 #if defined(VIDEO_HOLE) 1267 #if defined(VIDEO_HOLE)
1266 if (!natural_size_.isEmpty()) { 1268 if (!natural_size_.isEmpty()) {
1267 // Now we finally know that "stream texture" and "video frame" won't 1269 // Now we finally know that "stream texture" and "video frame" won't
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after
1972 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER; 1974 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER;
1973 } else if (is_hls_url == is_hls) { 1975 } else if (is_hls_url == is_hls) {
1974 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER; 1976 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER;
1975 } 1977 }
1976 UMA_HISTOGRAM_ENUMERATION( 1978 UMA_HISTOGRAM_ENUMERATION(
1977 "Media.Android.IsHttpLiveStreamingMediaPredictionResult", 1979 "Media.Android.IsHttpLiveStreamingMediaPredictionResult",
1978 result, PREDICTION_RESULT_MAX); 1980 result, PREDICTION_RESULT_MAX);
1979 } 1981 }
1980 1982
1981 } // namespace content 1983 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698