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

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

Issue 1960563002: Add media::VideoFrame::WrapNativeTextures() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after
1237 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, 1237 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync,
1238 texture_mailbox_sync_token.GetData()); 1238 texture_mailbox_sync_token.GetData());
1239 if (texture_mailbox_sync_token.namespace_id() == 1239 if (texture_mailbox_sync_token.namespace_id() ==
1240 gpu::CommandBufferNamespace::IN_PROCESS) { 1240 gpu::CommandBufferNamespace::IN_PROCESS) {
1241 // TODO(boliu): Remove this once Android WebView switches to IPC-based 1241 // TODO(boliu): Remove this once Android WebView switches to IPC-based
1242 // command buffer for video. 1242 // command buffer for video.
1243 GLbyte* sync_tokens[] = {texture_mailbox_sync_token.GetData()}; 1243 GLbyte* sync_tokens[] = {texture_mailbox_sync_token.GetData()};
1244 gl->VerifySyncTokensCHROMIUM(sync_tokens, arraysize(sync_tokens)); 1244 gl->VerifySyncTokensCHROMIUM(sync_tokens, arraysize(sync_tokens));
1245 } 1245 }
1246 1246
1247 scoped_refptr<VideoFrame> new_frame = VideoFrame::WrapNativeTexture( 1247 gpu::MailboxHolder holders[media::VideoFrame::kMaxPlanes] = {
1248 media::PIXEL_FORMAT_ARGB,
1249 gpu::MailboxHolder(texture_mailbox_, texture_mailbox_sync_token, 1248 gpu::MailboxHolder(texture_mailbox_, texture_mailbox_sync_token,
1250 texture_target), 1249 texture_target)};
1250 scoped_refptr<VideoFrame> new_frame = VideoFrame::WrapNativeTextures(
1251 media::PIXEL_FORMAT_ARGB, holders,
1251 media::BindToCurrentLoop(base::Bind( 1252 media::BindToCurrentLoop(base::Bind(
1252 &OnReleaseTexture, stream_texture_factory_, texture_id_ref)), 1253 &OnReleaseTexture, stream_texture_factory_, texture_id_ref)),
1253 natural_size_, gfx::Rect(natural_size_), natural_size_, 1254 natural_size_, gfx::Rect(natural_size_), natural_size_,
1254 base::TimeDelta()); 1255 base::TimeDelta());
1255 if (new_frame.get()) { 1256 if (new_frame.get()) {
1256 new_frame->metadata()->SetBoolean( 1257 new_frame->metadata()->SetBoolean(
1257 media::VideoFrameMetadata::COPY_REQUIRED, enable_texture_copy_); 1258 media::VideoFrameMetadata::COPY_REQUIRED, enable_texture_copy_);
1258 } 1259 }
1259 SetCurrentFrameInternal(new_frame); 1260 SetCurrentFrameInternal(new_frame);
1260 } 1261 }
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
1677 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER; 1678 result = PREDICTION_RESULT_PATH_BASED_WAS_BETTER;
1678 } else if (is_hls_url == is_hls) { 1679 } else if (is_hls_url == is_hls) {
1679 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER; 1680 result = PREDICTION_RESULT_URL_BASED_WAS_BETTER;
1680 } 1681 }
1681 UMA_HISTOGRAM_ENUMERATION( 1682 UMA_HISTOGRAM_ENUMERATION(
1682 "Media.Android.IsHttpLiveStreamingMediaPredictionResult", 1683 "Media.Android.IsHttpLiveStreamingMediaPredictionResult",
1683 result, PREDICTION_RESULT_MAX); 1684 result, PREDICTION_RESULT_MAX);
1684 } 1685 }
1685 1686
1686 } // namespace content 1687 } // namespace content
OLDNEW
« no previous file with comments | « chromecast/renderer/media/hole_frame_factory.cc ('k') | content/renderer/media/rtc_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698