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

Side by Side Diff: media/blink/webmediaplayer_cast_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
« no previous file with comments | « media/base/video_frame_unittest.cc ('k') | media/filters/gpu_video_decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "media/blink/webmediaplayer_cast_android.h" 5 #include "media/blink/webmediaplayer_cast_android.h"
6 6
7 #include "gpu/GLES2/gl2extchromium.h" 7 #include "gpu/GLES2/gl2extchromium.h"
8 #include "gpu/command_buffer/client/gles2_interface.h" 8 #include "gpu/command_buffer/client/gles2_interface.h"
9 #include "gpu/command_buffer/common/sync_token.h" 9 #include "gpu/command_buffer/common/sync_token.h"
10 #include "media/base/android/media_common_android.h" 10 #include "media/base/android/media_common_android.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 gpu::Mailbox texture_mailbox; 137 gpu::Mailbox texture_mailbox;
138 gl->GenMailboxCHROMIUM(texture_mailbox.name); 138 gl->GenMailboxCHROMIUM(texture_mailbox.name);
139 gl->ProduceTextureCHROMIUM(texture_target, texture_mailbox.name); 139 gl->ProduceTextureCHROMIUM(texture_target, texture_mailbox.name);
140 const GLuint64 fence_sync = gl->InsertFenceSyncCHROMIUM(); 140 const GLuint64 fence_sync = gl->InsertFenceSyncCHROMIUM();
141 gl->Flush(); 141 gl->Flush();
142 142
143 gpu::SyncToken texture_mailbox_sync_token; 143 gpu::SyncToken texture_mailbox_sync_token;
144 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, 144 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync,
145 texture_mailbox_sync_token.GetData()); 145 texture_mailbox_sync_token.GetData());
146 146
147 return VideoFrame::WrapNativeTexture( 147 gpu::MailboxHolder holders[media::VideoFrame::kMaxPlanes] = {
148 media::PIXEL_FORMAT_ARGB,
149 gpu::MailboxHolder(texture_mailbox, texture_mailbox_sync_token, 148 gpu::MailboxHolder(texture_mailbox, texture_mailbox_sync_token,
150 texture_target), 149 texture_target)};
150 return VideoFrame::WrapNativeTextures(
151 media::PIXEL_FORMAT_ARGB, holders,
151 media::BindToCurrentLoop(base::Bind(&OnReleaseTexture, context_3d_cb, 152 media::BindToCurrentLoop(base::Bind(&OnReleaseTexture, context_3d_cb,
152 remote_playback_texture_id)), 153 remote_playback_texture_id)),
153 canvas_size /* coded_size */, gfx::Rect(canvas_size) /* visible_rect */, 154 canvas_size /* coded_size */, gfx::Rect(canvas_size) /* visible_rect */,
154 natural_size /* natural_size */, base::TimeDelta() /* timestamp */); 155 natural_size /* natural_size */, base::TimeDelta() /* timestamp */);
155 } 156 }
156 157
157 WebMediaPlayerCast::WebMediaPlayerCast( 158 WebMediaPlayerCast::WebMediaPlayerCast(
158 WebMediaPlayerImpl* impl, 159 WebMediaPlayerImpl* impl,
159 blink::WebMediaPlayerClient* client, 160 blink::WebMediaPlayerClient* client,
160 const WebMediaPlayerParams::Context3DCB& context_3d_cb) 161 const WebMediaPlayerParams::Context3DCB& context_3d_cb)
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 375
375 if (!canvas_size.width()) 376 if (!canvas_size.width())
376 return nullptr; 377 return nullptr;
377 378
378 return MakeTextFrameForCast(remote_playback_message_, canvas_size, 379 return MakeTextFrameForCast(remote_playback_message_, canvas_size,
379 webmediaplayer_->naturalSize(), 380 webmediaplayer_->naturalSize(),
380 base::Bind(&GLCBShim, context_3d_cb_)); 381 base::Bind(&GLCBShim, context_3d_cb_));
381 } 382 }
382 383
383 } // namespace media 384 } // namespace media
OLDNEW
« no previous file with comments | « media/base/video_frame_unittest.cc ('k') | media/filters/gpu_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698