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

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

Issue 881893002: Revert of Plumb allow_overlay flag for video path into cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 <limits> 7 #include <limits>
8 8
9 #include "base/android/build_info.h" 9 #include "base/android/build_info.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 bitmap.getPixels()); 1175 bitmap.getPixels());
1176 } 1176 }
1177 1177
1178 gpu::Mailbox texture_mailbox; 1178 gpu::Mailbox texture_mailbox;
1179 gl->GenMailboxCHROMIUM(texture_mailbox.name); 1179 gl->GenMailboxCHROMIUM(texture_mailbox.name);
1180 gl->ProduceTextureCHROMIUM(texture_target, texture_mailbox.name); 1180 gl->ProduceTextureCHROMIUM(texture_target, texture_mailbox.name);
1181 gl->Flush(); 1181 gl->Flush();
1182 GLuint texture_mailbox_sync_point = gl->InsertSyncPointCHROMIUM(); 1182 GLuint texture_mailbox_sync_point = gl->InsertSyncPointCHROMIUM();
1183 1183
1184 scoped_refptr<VideoFrame> new_frame = VideoFrame::WrapNativeTexture( 1184 scoped_refptr<VideoFrame> new_frame = VideoFrame::WrapNativeTexture(
1185 make_scoped_ptr(new gpu::MailboxHolder(texture_mailbox, texture_target, 1185 make_scoped_ptr(new gpu::MailboxHolder(
1186 texture_mailbox_sync_point)), 1186 texture_mailbox, texture_target, texture_mailbox_sync_point)),
1187 media::BindToCurrentLoop(base::Bind(&OnReleaseTexture, 1187 media::BindToCurrentLoop(base::Bind(&OnReleaseTexture,
1188 stream_texture_factory_, 1188 stream_texture_factory_,
1189 remote_playback_texture_id)), 1189 remote_playback_texture_id)),
1190 canvas_size /* coded_size */, gfx::Rect(canvas_size) /* visible_rect */, 1190 canvas_size /* coded_size */,
1191 canvas_size /* natural_size */, base::TimeDelta() /* timestamp */, 1191 gfx::Rect(canvas_size) /* visible_rect */,
1192 VideoFrame::ReadPixelsCB(), false /* allow overlay */); 1192 canvas_size /* natural_size */,
1193 base::TimeDelta() /* timestamp */,
1194 VideoFrame::ReadPixelsCB());
1193 SetCurrentFrameInternal(new_frame); 1195 SetCurrentFrameInternal(new_frame);
1194 } 1196 }
1195 1197
1196 void WebMediaPlayerAndroid::ReallocateVideoFrame() { 1198 void WebMediaPlayerAndroid::ReallocateVideoFrame() {
1197 DCHECK(main_thread_checker_.CalledOnValidThread()); 1199 DCHECK(main_thread_checker_.CalledOnValidThread());
1198 if (needs_external_surface_) { 1200 if (needs_external_surface_) {
1199 // VideoFrame::CreateHoleFrame is only defined under VIDEO_HOLE. 1201 // VideoFrame::CreateHoleFrame is only defined under VIDEO_HOLE.
1200 #if defined(VIDEO_HOLE) 1202 #if defined(VIDEO_HOLE)
1201 if (!natural_size_.isEmpty()) { 1203 if (!natural_size_.isEmpty()) {
1202 // Now we finally know that "stream texture" and "video frame" won't 1204 // Now we finally know that "stream texture" and "video frame" won't
(...skipping 10 matching lines...) Expand all
1213 #endif // defined(VIDEO_HOLE) 1215 #endif // defined(VIDEO_HOLE)
1214 } else if (!is_remote_ && texture_id_) { 1216 } else if (!is_remote_ && texture_id_) {
1215 GLES2Interface* gl = stream_texture_factory_->ContextGL(); 1217 GLES2Interface* gl = stream_texture_factory_->ContextGL();
1216 GLuint texture_target = kGLTextureExternalOES; 1218 GLuint texture_target = kGLTextureExternalOES;
1217 GLuint texture_id_ref = gl->CreateAndConsumeTextureCHROMIUM( 1219 GLuint texture_id_ref = gl->CreateAndConsumeTextureCHROMIUM(
1218 texture_target, texture_mailbox_.name); 1220 texture_target, texture_mailbox_.name);
1219 gl->Flush(); 1221 gl->Flush();
1220 GLuint texture_mailbox_sync_point = gl->InsertSyncPointCHROMIUM(); 1222 GLuint texture_mailbox_sync_point = gl->InsertSyncPointCHROMIUM();
1221 1223
1222 scoped_refptr<VideoFrame> new_frame = VideoFrame::WrapNativeTexture( 1224 scoped_refptr<VideoFrame> new_frame = VideoFrame::WrapNativeTexture(
1223 make_scoped_ptr(new gpu::MailboxHolder(texture_mailbox_, texture_target, 1225 make_scoped_ptr(new gpu::MailboxHolder(
1224 texture_mailbox_sync_point)), 1226 texture_mailbox_, texture_target, texture_mailbox_sync_point)),
1225 media::BindToCurrentLoop(base::Bind( 1227 media::BindToCurrentLoop(base::Bind(
1226 &OnReleaseTexture, stream_texture_factory_, texture_id_ref)), 1228 &OnReleaseTexture, stream_texture_factory_, texture_id_ref)),
1227 natural_size_, gfx::Rect(natural_size_), natural_size_, 1229 natural_size_,
1228 base::TimeDelta(), VideoFrame::ReadPixelsCB(), false); 1230 gfx::Rect(natural_size_),
1231 natural_size_,
1232 base::TimeDelta(),
1233 VideoFrame::ReadPixelsCB());
1229 SetCurrentFrameInternal(new_frame); 1234 SetCurrentFrameInternal(new_frame);
1230 } 1235 }
1231 } 1236 }
1232 1237
1233 void WebMediaPlayerAndroid::SetVideoFrameProviderClient( 1238 void WebMediaPlayerAndroid::SetVideoFrameProviderClient(
1234 cc::VideoFrameProvider::Client* client) { 1239 cc::VideoFrameProvider::Client* client) {
1235 // This is called from both the main renderer thread and the compositor 1240 // This is called from both the main renderer thread and the compositor
1236 // thread (when the main thread is blocked). 1241 // thread (when the main thread is blocked).
1237 1242
1238 // Set the callback target when a frame is produced. Need to do this before 1243 // Set the callback target when a frame is produced. Need to do this before
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
1794 1799
1795 bool WebMediaPlayerAndroid::IsHLSStream() const { 1800 bool WebMediaPlayerAndroid::IsHLSStream() const {
1796 std::string mime; 1801 std::string mime;
1797 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_; 1802 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_;
1798 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime)) 1803 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime))
1799 return false; 1804 return false;
1800 return !mime.compare("application/x-mpegurl"); 1805 return !mime.compare("application/x-mpegurl");
1801 } 1806 }
1802 1807
1803 } // namespace content 1808 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/media/vt_video_decode_accelerator.cc ('k') | content/renderer/media/rtc_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698