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

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: mcasas@ comments. 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 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after
1249 1249
1250 scoped_refptr<VideoFrame> new_frame = VideoFrame::WrapNativeTexture( 1250 scoped_refptr<VideoFrame> new_frame = VideoFrame::WrapNativeTexture(
1251 media::PIXEL_FORMAT_ARGB, 1251 media::PIXEL_FORMAT_ARGB,
1252 gpu::MailboxHolder(texture_mailbox, texture_mailbox_sync_token, 1252 gpu::MailboxHolder(texture_mailbox, texture_mailbox_sync_token,
1253 texture_target), 1253 texture_target),
1254 media::BindToCurrentLoop(base::Bind(&OnReleaseTexture, 1254 media::BindToCurrentLoop(base::Bind(&OnReleaseTexture,
1255 stream_texture_factory_, 1255 stream_texture_factory_,
1256 remote_playback_texture_id)), 1256 remote_playback_texture_id)),
1257 canvas_size /* coded_size */, gfx::Rect(canvas_size) /* visible_rect */, 1257 canvas_size /* coded_size */, gfx::Rect(canvas_size) /* visible_rect */,
1258 canvas_size /* natural_size */, base::TimeDelta() /* timestamp */); 1258 canvas_size /* natural_size */, base::TimeDelta() /* timestamp */);
1259 if (!new_frame)
1260 return;
1259 SetCurrentFrameInternal(new_frame); 1261 SetCurrentFrameInternal(new_frame);
1260 } 1262 }
1261 1263
1262 void WebMediaPlayerAndroid::ReallocateVideoFrame() { 1264 void WebMediaPlayerAndroid::ReallocateVideoFrame() {
1263 DCHECK(main_thread_checker_.CalledOnValidThread()); 1265 DCHECK(main_thread_checker_.CalledOnValidThread());
1264 if (needs_external_surface_) { 1266 if (needs_external_surface_) {
1265 // VideoFrame::CreateHoleFrame is only defined under VIDEO_HOLE. 1267 // VideoFrame::CreateHoleFrame is only defined under VIDEO_HOLE.
1266 #if defined(VIDEO_HOLE) 1268 #if defined(VIDEO_HOLE)
1267 if (!natural_size_.isEmpty()) { 1269 if (!natural_size_.isEmpty()) {
1268 // Now we finally know that "stream texture" and "video frame" won't 1270 // Now we finally know that "stream texture" and "video frame" won't
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
1953 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER; 1955 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER;
1954 } else if (is_hls_url == is_hls) { 1956 } else if (is_hls_url == is_hls) {
1955 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER; 1957 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER;
1956 } 1958 }
1957 UMA_HISTOGRAM_ENUMERATION( 1959 UMA_HISTOGRAM_ENUMERATION(
1958 "Media.Android.IsHttpLiveStreamingMediaPredictionResult", 1960 "Media.Android.IsHttpLiveStreamingMediaPredictionResult",
1959 result, PREDICTION_RESULT_MAX); 1961 result, PREDICTION_RESULT_MAX);
1960 } 1962 }
1961 1963
1962 } // namespace content 1964 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698