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

Unified Diff: content/renderer/media/android/webmediaplayer_android.cc

Issue 132233041: Add gpu::MailboxHolder to hold state for a gpu::Mailbox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ff7262fa Rebase. Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/media/android/webmediaplayer_android.h ('k') | content/renderer/media/rtc_video_decoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/android/webmediaplayer_android.cc
diff --git a/content/renderer/media/android/webmediaplayer_android.cc b/content/renderer/media/android/webmediaplayer_android.cc
index b0cbd715a4b2c3f41b8511b036cdd9038cb6b61b..5fae87902cad03dfbe1b2d585b987f1a36ccf7f7 100644
--- a/content/renderer/media/android/webmediaplayer_android.cc
+++ b/content/renderer/media/android/webmediaplayer_android.cc
@@ -27,6 +27,7 @@
#include "content/renderer/render_thread_impl.h"
#include "gpu/GLES2/gl2extchromium.h"
#include "gpu/command_buffer/client/gles2_interface.h"
+#include "gpu/command_buffer/common/mailbox_holder.h"
#include "grit/content_resources.h"
#include "media/base/android/media_player_android.h"
#include "media/base/bind_to_current_loop.h"
@@ -67,12 +68,12 @@ namespace content {
void WebMediaPlayerAndroid::OnReleaseRemotePlaybackTexture(
const scoped_refptr<base::MessageLoopProxy>& main_loop,
const base::WeakPtr<WebMediaPlayerAndroid>& player,
- uint32 sync_point) {
+ scoped_ptr<gpu::MailboxHolder> mailbox_holder) {
main_loop->PostTask(
FROM_HERE,
base::Bind(&WebMediaPlayerAndroid::DoReleaseRemotePlaybackTexture,
player,
- sync_point));
+ mailbox_holder->sync_point));
}
WebMediaPlayerAndroid::WebMediaPlayerAndroid(
@@ -916,19 +917,16 @@ void WebMediaPlayerAndroid::DrawRemotePlaybackIcon() {
GLuint texture_mailbox_sync_point = gl->InsertSyncPointCHROMIUM();
scoped_refptr<VideoFrame> new_frame = VideoFrame::WrapNativeTexture(
- make_scoped_ptr(new VideoFrame::MailboxHolder(
- texture_mailbox,
- texture_mailbox_sync_point,
- base::Bind(&WebMediaPlayerAndroid::OnReleaseRemotePlaybackTexture,
- main_loop_,
- weak_factory_.GetWeakPtr()))),
- texture_target,
+ make_scoped_ptr(new gpu::MailboxHolder(
+ texture_mailbox, texture_target, texture_mailbox_sync_point)),
+ base::Bind(&WebMediaPlayerAndroid::OnReleaseRemotePlaybackTexture,
+ main_loop_,
+ weak_factory_.GetWeakPtr()),
canvas_size /* coded_size */,
gfx::Rect(canvas_size) /* visible_rect */,
canvas_size /* natural_size */,
base::TimeDelta() /* timestamp */,
- VideoFrame::ReadPixelsCB(),
- base::Closure() /* no_longer_needed_cb */);
+ VideoFrame::ReadPixelsCB());
SetCurrentFrameInternal(new_frame);
}
@@ -948,17 +946,15 @@ void WebMediaPlayerAndroid::ReallocateVideoFrame() {
#endif // defined(VIDEO_HOLE)
} else if (!is_remote_ && texture_id_) {
scoped_refptr<VideoFrame> new_frame = VideoFrame::WrapNativeTexture(
- make_scoped_ptr(new VideoFrame::MailboxHolder(
- texture_mailbox_,
- texture_mailbox_sync_point_,
- VideoFrame::MailboxHolder::TextureNoLongerNeededCallback())),
- kGLTextureExternalOES,
+ make_scoped_ptr(new gpu::MailboxHolder(texture_mailbox_,
+ kGLTextureExternalOES,
+ texture_mailbox_sync_point_)),
+ media::VideoFrame::ReleaseMailboxCB(),
natural_size_,
gfx::Rect(natural_size_),
natural_size_,
base::TimeDelta(),
- VideoFrame::ReadPixelsCB(),
- base::Closure());
+ VideoFrame::ReadPixelsCB());
SetCurrentFrameInternal(new_frame);
}
}
« no previous file with comments | « content/renderer/media/android/webmediaplayer_android.h ('k') | content/renderer/media/rtc_video_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698