summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/browser/compositor/owned_mailbox.cc11
-rw-r--r--content/browser/compositor/owned_mailbox.h11
-rw-r--r--content/browser/renderer_host/media/desktop_capture_device_aura.cc12
-rw-r--r--content/browser/renderer_host/render_widget_host_view_android.cc2
-rw-r--r--content/browser/renderer_host/render_widget_host_view_aura.cc20
-rw-r--r--content/browser/renderer_host/software_frame_manager.cc2
-rw-r--r--content/common/cc_messages.h4
-rw-r--r--content/common/cc_messages_unittest.cc22
-rw-r--r--content/common/gpu/client/gl_helper.cc14
-rw-r--r--content/common/gpu/client/gl_helper.h9
-rw-r--r--content/renderer/browser_plugin/browser_plugin_compositing_helper.cc17
-rw-r--r--content/renderer/media/android/webmediaplayer_android.cc32
-rw-r--r--content/renderer/media/android/webmediaplayer_android.h14
-rw-r--r--content/renderer/media/rtc_video_decoder.cc24
-rw-r--r--content/renderer/media/rtc_video_decoder.h7
-rw-r--r--content/renderer/media/webmediaplayer_impl.cc12
-rw-r--r--content/renderer/pepper/pepper_graphics_2d_host.cc2
-rw-r--r--content/renderer/pepper/pepper_plugin_instance_impl.cc5
18 files changed, 115 insertions, 105 deletions
diff --git a/content/browser/compositor/owned_mailbox.cc b/content/browser/compositor/owned_mailbox.cc
index 06a60e4..9c7b378 100644
--- a/content/browser/compositor/owned_mailbox.cc
+++ b/content/browser/compositor/owned_mailbox.cc
@@ -11,9 +11,9 @@
namespace content {
OwnedMailbox::OwnedMailbox(GLHelper* gl_helper)
- : texture_id_(0), sync_point_(0), gl_helper_(gl_helper) {
+ : texture_id_(0), gl_helper_(gl_helper) {
texture_id_ = gl_helper_->CreateTexture();
- mailbox_ = gl_helper_->ProduceMailboxFromTexture(texture_id_, &sync_point_);
+ mailbox_holder_ = gl_helper_->ProduceMailboxHolderFromTexture(texture_id_);
ImageTransportFactory::GetInstance()->AddObserver(this);
}
@@ -24,16 +24,15 @@ OwnedMailbox::~OwnedMailbox() {
void OwnedMailbox::UpdateSyncPoint(uint32 sync_point) {
if (sync_point)
- sync_point_ = sync_point;
+ mailbox_holder_.sync_point = sync_point;
}
void OwnedMailbox::Destroy() {
ImageTransportFactory::GetInstance()->RemoveObserver(this);
- gl_helper_->WaitSyncPoint(sync_point_);
+ gl_helper_->WaitSyncPoint(mailbox_holder_.sync_point);
gl_helper_->DeleteTexture(texture_id_);
texture_id_ = 0;
- mailbox_ = gpu::Mailbox();
- sync_point_ = 0;
+ mailbox_holder_ = gpu::MailboxHolder();
gl_helper_ = NULL;
}
diff --git a/content/browser/compositor/owned_mailbox.h b/content/browser/compositor/owned_mailbox.h
index a574ae4..e3adcbd 100644
--- a/content/browser/compositor/owned_mailbox.h
+++ b/content/browser/compositor/owned_mailbox.h
@@ -4,7 +4,7 @@
#include "base/memory/ref_counted.h"
#include "content/browser/compositor/image_transport_factory.h"
-#include "gpu/command_buffer/common/mailbox.h"
+#include "gpu/command_buffer/common/mailbox_holder.h"
namespace content {
@@ -18,10 +18,10 @@ class OwnedMailbox : public base::RefCounted<OwnedMailbox>,
public:
explicit OwnedMailbox(GLHelper* gl_helper);
+ const gpu::Mailbox& mailbox() const { return mailbox_holder_.mailbox; }
uint32 texture_id() const { return texture_id_; }
- uint32 sync_point() const { return sync_point_; }
- const gpu::Mailbox& mailbox() const { return mailbox_; }
-
+ uint32 target() const { return mailbox_holder_.texture_target; }
+ uint32 sync_point() const { return mailbox_holder_.sync_point; }
void UpdateSyncPoint(uint32 sync_point);
void Destroy();
@@ -35,8 +35,7 @@ class OwnedMailbox : public base::RefCounted<OwnedMailbox>,
friend class base::RefCounted<OwnedMailbox>;
uint32 texture_id_;
- gpu::Mailbox mailbox_;
- uint32 sync_point_;
+ gpu::MailboxHolder mailbox_holder_;
GLHelper* gl_helper_;
};
diff --git a/content/browser/renderer_host/media/desktop_capture_device_aura.cc b/content/browser/renderer_host/media/desktop_capture_device_aura.cc
index 03e9c89..f16d564 100644
--- a/content/browser/renderer_host/media/desktop_capture_device_aura.cc
+++ b/content/browser/renderer_host/media/desktop_capture_device_aura.cc
@@ -343,9 +343,15 @@ void DesktopVideoCaptureMachine::DidCopyOutput(
gfx::Point cursor_position_in_frame = UpdateCursorState(region_in_frame);
yuv_readback_pipeline_->ReadbackYUV(
- texture_mailbox.name(), texture_mailbox.sync_point(), video_frame.get(),
- base::Bind(&CopyOutputFinishedForVideo, start_time, capture_frame_cb,
- video_frame, scaled_cursor_bitmap_, cursor_position_in_frame,
+ texture_mailbox.mailbox(),
+ texture_mailbox.sync_point(),
+ video_frame.get(),
+ base::Bind(&CopyOutputFinishedForVideo,
+ start_time,
+ capture_frame_cb,
+ video_frame,
+ scaled_cursor_bitmap_,
+ cursor_position_in_frame,
base::Passed(&release_callback)));
}
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index e90ab1c..2b78167 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -1406,7 +1406,7 @@ void RenderWidgetHostViewAndroid::PrepareTextureCopyOutputResult(
ignore_result(scoped_callback_runner.Release());
gl_helper->CropScaleReadbackAndCleanMailbox(
- texture_mailbox.name(),
+ texture_mailbox.mailbox(),
texture_mailbox.sync_point(),
result->size(),
gfx::Rect(result->size()),
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index f0fe263..27f54ec 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -100,7 +100,8 @@ namespace content {
namespace {
void MailboxReleaseCallback(scoped_ptr<base::SharedMemory> shared_memory,
- unsigned sync_point, bool lost_resource) {
+ uint32 sync_point,
+ bool lost_resource) {
// NOTE: shared_memory will get released when we go out of scope.
}
@@ -1110,8 +1111,10 @@ void RenderWidgetHostViewAura::CopyFromCompositingSurfaceToVideoFrame(
ConvertRectToPixel(current_device_scale_factor_, src_subrect);
request->set_area(src_subrect_in_pixel);
if (subscriber_texture.get()) {
- request->SetTextureMailbox(cc::TextureMailbox(
- subscriber_texture->mailbox(), subscriber_texture->sync_point()));
+ request->SetTextureMailbox(
+ cc::TextureMailbox(subscriber_texture->mailbox(),
+ subscriber_texture->target(),
+ subscriber_texture->sync_point()));
}
RequestCopyOfOutput(request.Pass());
}
@@ -1865,7 +1868,7 @@ void RenderWidgetHostViewAura::PrepareTextureCopyOutputResult(
ignore_result(scoped_callback_runner.Release());
gl_helper->CropScaleReadbackAndCleanMailbox(
- texture_mailbox.name(),
+ texture_mailbox.mailbox(),
texture_mailbox.sync_point(),
result->size(),
gfx::Rect(result->size()),
@@ -2065,11 +2068,10 @@ void RenderWidgetHostViewAura::CopyFromCompositingSurfaceHasResultForVideo(
callback,
subscriber_texture,
base::Passed(&release_callback));
- yuv_readback_pipeline->ReadbackYUV(
- texture_mailbox.name(),
- texture_mailbox.sync_point(),
- video_frame.get(),
- finished_callback);
+ yuv_readback_pipeline->ReadbackYUV(texture_mailbox.mailbox(),
+ texture_mailbox.sync_point(),
+ video_frame.get(),
+ finished_callback);
}
void RenderWidgetHostViewAura::GetScreenInfo(WebScreenInfo* results) {
diff --git a/content/browser/renderer_host/software_frame_manager.cc b/content/browser/renderer_host/software_frame_manager.cc
index cff9434..cb4efb6 100644
--- a/content/browser/renderer_host/software_frame_manager.cc
+++ b/content/browser/renderer_host/software_frame_manager.cc
@@ -13,7 +13,7 @@
namespace {
void ReleaseMailbox(scoped_refptr<content::SoftwareFrame> frame,
- unsigned sync_point,
+ uint32 sync_point,
bool lost_resource) {}
} // namespace
diff --git a/content/common/cc_messages.h b/content/common/cc_messages.h
index d1a9129..6b58465 100644
--- a/content/common/cc_messages.h
+++ b/content/common/cc_messages.h
@@ -224,12 +224,10 @@ IPC_STRUCT_TRAITS_END()
IPC_STRUCT_TRAITS_BEGIN(cc::TransferableResource)
IPC_STRUCT_TRAITS_MEMBER(id)
- IPC_STRUCT_TRAITS_MEMBER(sync_point)
IPC_STRUCT_TRAITS_MEMBER(format)
- IPC_STRUCT_TRAITS_MEMBER(target)
IPC_STRUCT_TRAITS_MEMBER(filter)
IPC_STRUCT_TRAITS_MEMBER(size)
- IPC_STRUCT_TRAITS_MEMBER(mailbox)
+ IPC_STRUCT_TRAITS_MEMBER(mailbox_holder)
IPC_STRUCT_TRAITS_MEMBER(is_software)
IPC_STRUCT_TRAITS_END()
diff --git a/content/common/cc_messages_unittest.cc b/content/common/cc_messages_unittest.cc
index eaa5a58..11b9ea2 100644
--- a/content/common/cc_messages_unittest.cc
+++ b/content/common/cc_messages_unittest.cc
@@ -198,13 +198,15 @@ class CCMessagesTest : public testing::Test {
void Compare(const TransferableResource& a, const TransferableResource& b) {
EXPECT_EQ(a.id, b.id);
- EXPECT_EQ(a.sync_point, b.sync_point);
EXPECT_EQ(a.format, b.format);
- EXPECT_EQ(a.target, b.target);
EXPECT_EQ(a.filter, b.filter);
EXPECT_EQ(a.size.ToString(), b.size.ToString());
- for (size_t i = 0; i < arraysize(a.mailbox.name); ++i)
- EXPECT_EQ(a.mailbox.name[i], b.mailbox.name[i]);
+ for (size_t i = 0; i < arraysize(a.mailbox_holder.mailbox.name); ++i) {
+ EXPECT_EQ(a.mailbox_holder.mailbox.name[i],
+ b.mailbox_holder.mailbox.name[i]);
+ }
+ EXPECT_EQ(a.mailbox_holder.texture_target, b.mailbox_holder.texture_target);
+ EXPECT_EQ(a.mailbox_holder.sync_point, b.mailbox_holder.sync_point);
}
};
@@ -655,21 +657,21 @@ TEST_F(CCMessagesTest, Resources) {
TransferableResource arbitrary_resource1;
arbitrary_resource1.id = 2178312;
- arbitrary_resource1.sync_point = arbitrary_uint1;
arbitrary_resource1.format = cc::RGBA_8888;
- arbitrary_resource1.target = GL_TEXTURE_2D;
arbitrary_resource1.filter = 53;
arbitrary_resource1.size = gfx::Size(37189, 123123);
- arbitrary_resource1.mailbox.SetName(arbitrary_mailbox1);
+ arbitrary_resource1.mailbox_holder.mailbox.SetName(arbitrary_mailbox1);
+ arbitrary_resource1.mailbox_holder.texture_target = GL_TEXTURE_2D;
+ arbitrary_resource1.mailbox_holder.sync_point = arbitrary_uint1;
TransferableResource arbitrary_resource2;
arbitrary_resource2.id = 789132;
- arbitrary_resource2.sync_point = arbitrary_uint2;
arbitrary_resource2.format = cc::RGBA_4444;
- arbitrary_resource2.target = GL_TEXTURE_EXTERNAL_OES;
arbitrary_resource2.filter = 47;
arbitrary_resource2.size = gfx::Size(89123, 23789);
- arbitrary_resource2.mailbox.SetName(arbitrary_mailbox2);
+ arbitrary_resource2.mailbox_holder.mailbox.SetName(arbitrary_mailbox2);
+ arbitrary_resource2.mailbox_holder.texture_target = GL_TEXTURE_EXTERNAL_OES;
+ arbitrary_resource2.mailbox_holder.sync_point = arbitrary_uint2;
scoped_ptr<RenderPass> renderpass_in = RenderPass::Create();
renderpass_in->SetNew(
diff --git a/content/common/gpu/client/gl_helper.cc b/content/common/gpu/client/gl_helper.cc
index 3b7e23a..13d2913 100644
--- a/content/common/gpu/client/gl_helper.cc
+++ b/content/common/gpu/client/gl_helper.cc
@@ -19,6 +19,7 @@
#include "gpu/GLES2/gl2extchromium.h"
#include "gpu/command_buffer/client/context_support.h"
#include "gpu/command_buffer/common/mailbox.h"
+#include "gpu/command_buffer/common/mailbox_holder.h"
#include "media/base/video_frame.h"
#include "media/base/video_util.h"
#include "third_party/skia/include/core/SkRegion.h"
@@ -670,18 +671,15 @@ void GLHelper::WaitSyncPoint(uint32 sync_point) {
gl_->WaitSyncPointCHROMIUM(sync_point);
}
-gpu::Mailbox GLHelper::ProduceMailboxFromTexture(GLuint texture_id,
- uint32* sync_point) {
+gpu::MailboxHolder GLHelper::ProduceMailboxHolderFromTexture(
+ GLuint texture_id) {
gpu::Mailbox mailbox;
gl_->GenMailboxCHROMIUM(mailbox.name);
- if (mailbox.IsZero()) {
- *sync_point = 0;
- return mailbox;
- }
+ if (mailbox.IsZero())
+ return gpu::MailboxHolder();
content::ScopedTextureBinder<GL_TEXTURE_2D> texture_binder(gl_, texture_id);
gl_->ProduceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name);
- *sync_point = InsertSyncPoint();
- return mailbox;
+ return gpu::MailboxHolder(mailbox, GL_TEXTURE_2D, InsertSyncPoint());
}
GLuint GLHelper::ConsumeMailboxToTexture(const gpu::Mailbox& mailbox,
diff --git a/content/common/gpu/client/gl_helper.h b/content/common/gpu/client/gl_helper.h
index 90e9b71..7b53268 100644
--- a/content/common/gpu/client/gl_helper.h
+++ b/content/common/gpu/client/gl_helper.h
@@ -11,6 +11,7 @@
#include "base/memory/scoped_ptr.h"
#include "content/common/content_export.h"
#include "gpu/command_buffer/client/gles2_interface.h"
+#include "gpu/command_buffer/common/mailbox_holder.h"
namespace gfx {
class Rect;
@@ -245,11 +246,11 @@ class CONTENT_EXPORT GLHelper {
// Wait for the sync point before executing further GL commands.
void WaitSyncPoint(uint32 sync_point);
- // Creates a mailbox that is attached to the given texture id, and a sync
- // point to wait on before using the mailbox. Returns an empty mailbox on
- // failure.
+ // Creates a mailbox holder that is attached to the given texture id, with a
+ // sync point to wait on before using the mailbox. Returns a holder with an
+ // empty mailbox on failure.
// Note the texture is assumed to be GL_TEXTURE_2D.
- gpu::Mailbox ProduceMailboxFromTexture(GLuint texture_id, uint32* sync_point);
+ gpu::MailboxHolder ProduceMailboxHolderFromTexture(GLuint texture_id);
// Creates a texture and consumes a mailbox into it. Returns 0 on failure.
// Note the mailbox is assumed to be GL_TEXTURE_2D.
diff --git a/content/renderer/browser_plugin/browser_plugin_compositing_helper.cc b/content/renderer/browser_plugin/browser_plugin_compositing_helper.cc
index 89916e2..20d89d9 100644
--- a/content/renderer/browser_plugin/browser_plugin_compositing_helper.cc
+++ b/content/renderer/browser_plugin/browser_plugin_compositing_helper.cc
@@ -141,10 +141,9 @@ void BrowserPluginCompositingHelper::CheckSizeAndAdjustLayerProperties(
background_layer_->SetIsDrawable(false);
}
-void BrowserPluginCompositingHelper::MailboxReleased(
- SwapBuffersInfo mailbox,
- unsigned sync_point,
- bool lost_resource) {
+void BrowserPluginCompositingHelper::MailboxReleased(SwapBuffersInfo mailbox,
+ uint32 sync_point,
+ bool lost_resource) {
if (mailbox.type == SOFTWARE_COMPOSITOR_FRAME) {
delete mailbox.shared_memory;
mailbox.shared_memory = NULL;
@@ -229,7 +228,7 @@ void BrowserPluginCompositingHelper::OnContainerDestroy() {
void BrowserPluginCompositingHelper::OnBuffersSwappedPrivate(
const SwapBuffersInfo& mailbox,
- unsigned sync_point,
+ uint32 sync_point,
float device_scale_factor) {
DCHECK(!delegated_layer_.get());
// If these mismatch, we are either just starting up, GPU process crashed or
@@ -292,10 +291,12 @@ void BrowserPluginCompositingHelper::OnBuffersSwappedPrivate(
base::Bind(&BrowserPluginCompositingHelper::MailboxReleased,
scoped_refptr<BrowserPluginCompositingHelper>(this),
mailbox)).Pass();
- if (is_software_frame)
+ if (is_software_frame) {
texture_mailbox = cc::TextureMailbox(mailbox.shared_memory, mailbox.size);
- else
- texture_mailbox = cc::TextureMailbox(mailbox.name, sync_point);
+ } else {
+ texture_mailbox =
+ cc::TextureMailbox(mailbox.name, GL_TEXTURE_2D, sync_point);
+ }
}
texture_layer_->SetFlipped(!is_software_frame);
diff --git a/content/renderer/media/android/webmediaplayer_android.cc b/content/renderer/media/android/webmediaplayer_android.cc
index 8cb3982..6134b9a 100644
--- a/content/renderer/media/android/webmediaplayer_android.cc
+++ b/content/renderer/media/android/webmediaplayer_android.cc
@@ -23,6 +23,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"
@@ -63,12 +64,12 @@ namespace content {
void WebMediaPlayerAndroid::OnReleaseRemotePlaybackTexture(
const scoped_refptr<base::MessageLoopProxy>& main_loop,
const base::WeakPtr<WebMediaPlayerAndroid>& player,
- uint32 sync_point) {
+ const gpu::MailboxHolder* mailbox_holder) {
main_loop->PostTask(
FROM_HERE,
base::Bind(&WebMediaPlayerAndroid::DoReleaseRemotePlaybackTexture,
player,
- sync_point));
+ mailbox_holder->sync_point));
}
WebMediaPlayerAndroid::WebMediaPlayerAndroid(
@@ -934,19 +935,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);
}
@@ -966,17 +964,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);
}
}
diff --git a/content/renderer/media/android/webmediaplayer_android.h b/content/renderer/media/android/webmediaplayer_android.h
index 3cdc6ac..5e13683 100644
--- a/content/renderer/media/android/webmediaplayer_android.h
+++ b/content/renderer/media/android/webmediaplayer_android.h
@@ -31,14 +31,18 @@
#include "third_party/WebKit/public/platform/WebURL.h"
#include "ui/gfx/rect_f.h"
-namespace media {
-class MediaLog;
-}
-
namespace blink {
class WebFrame;
}
+namespace gpu {
+struct MailboxHolder;
+}
+
+namespace media {
+class MediaLog;
+}
+
namespace webkit {
class WebLayerImpl;
}
@@ -223,7 +227,7 @@ class WebMediaPlayerAndroid
static void OnReleaseRemotePlaybackTexture(
const scoped_refptr<base::MessageLoopProxy>& main_loop,
const base::WeakPtr<WebMediaPlayerAndroid>& player,
- uint32 sync_point);
+ const gpu::MailboxHolder* mailbox_holder);
protected:
// Helper method to update the playing state.
diff --git a/content/renderer/media/rtc_video_decoder.cc b/content/renderer/media/rtc_video_decoder.cc
index dd043c2..e4a4237 100644
--- a/content/renderer/media/rtc_video_decoder.cc
+++ b/content/renderer/media/rtc_video_decoder.cc
@@ -14,6 +14,7 @@
#include "base/task_runner_util.h"
#include "content/child/child_thread.h"
#include "content/renderer/media/native_handle_impl.h"
+#include "gpu/command_buffer/common/mailbox_holder.h"
#include "media/base/bind_to_current_loop.h"
#include "media/filters/gpu_video_accelerator_factories.h"
#include "third_party/webrtc/common_video/interface/texture_video_frame.h"
@@ -420,14 +421,11 @@ scoped_refptr<media::VideoFrame> RTCVideoDecoder::CreateVideoFrame(
base::TimeDelta timestamp_ms = base::TimeDelta::FromInternalValue(
base::checked_cast<uint64_t>(timestamp) * 1000 / 90);
return media::VideoFrame::WrapNativeTexture(
- make_scoped_ptr(new media::VideoFrame::MailboxHolder(
- pb.texture_mailbox(),
- 0, // sync_point
- media::BindToCurrentLoop(
- base::Bind(&RTCVideoDecoder::ReusePictureBuffer,
- weak_this_,
- picture.picture_buffer_id())))),
- decoder_texture_target_,
+ make_scoped_ptr(new gpu::MailboxHolder(
+ pb.texture_mailbox(), decoder_texture_target_, 0)),
+ media::BindToCurrentLoop(base::Bind(&RTCVideoDecoder::ReusePictureBuffer,
+ weak_this_,
+ picture.picture_buffer_id())),
pb.size(),
visible_rect,
natural_size,
@@ -435,8 +433,7 @@ scoped_refptr<media::VideoFrame> RTCVideoDecoder::CreateVideoFrame(
base::Bind(&media::GpuVideoAcceleratorFactories::ReadPixels,
factories_,
pb.texture_id(),
- natural_size),
- base::Closure());
+ natural_size));
}
void RTCVideoDecoder::NotifyEndOfBitstreamBuffer(int32 id) {
@@ -640,8 +637,9 @@ void RTCVideoDecoder::ResetInternal() {
vda_->Reset();
}
-void RTCVideoDecoder::ReusePictureBuffer(int64 picture_buffer_id,
- uint32 sync_point) {
+void RTCVideoDecoder::ReusePictureBuffer(
+ int64 picture_buffer_id,
+ const gpu::MailboxHolder* mailbox_holder) {
DCHECK(vda_task_runner_->BelongsToCurrentThread());
DVLOG(3) << "ReusePictureBuffer. id=" << picture_buffer_id;
@@ -665,7 +663,7 @@ void RTCVideoDecoder::ReusePictureBuffer(int64 picture_buffer_id,
return;
}
- factories_->WaitSyncPoint(sync_point);
+ factories_->WaitSyncPoint(mailbox_holder->sync_point);
vda_->ReusePictureBuffer(picture_buffer_id);
}
diff --git a/content/renderer/media/rtc_video_decoder.h b/content/renderer/media/rtc_video_decoder.h
index 0d99a4c..2db49a4 100644
--- a/content/renderer/media/rtc_video_decoder.h
+++ b/content/renderer/media/rtc_video_decoder.h
@@ -28,6 +28,10 @@ namespace base {
class MessageLoopProxy;
};
+namespace gpu {
+struct MailboxHolder;
+}
+
namespace media {
class DecoderBuffer;
class GpuVideoAcceleratorFactories;
@@ -156,7 +160,8 @@ class CONTENT_EXPORT RTCVideoDecoder
void ResetInternal();
// Tells VDA that a picture buffer can be recycled.
- void ReusePictureBuffer(int64 picture_buffer_id, uint32 sync_point);
+ void ReusePictureBuffer(int64 picture_buffer_id,
+ const gpu::MailboxHolder* mailbox_holder);
void DestroyTextures();
void DestroyVDA();
diff --git a/content/renderer/media/webmediaplayer_impl.cc b/content/renderer/media/webmediaplayer_impl.cc
index d5c3a2a..a1fc51e 100644
--- a/content/renderer/media/webmediaplayer_impl.cc
+++ b/content/renderer/media/webmediaplayer_impl.cc
@@ -34,6 +34,7 @@
#include "content/renderer/pepper/pepper_webplugin_impl.h"
#include "content/renderer/render_thread_impl.h"
#include "gpu/GLES2/gl2extchromium.h"
+#include "gpu/command_buffer/common/mailbox_holder.h"
#include "media/audio/null_audio_sink.h"
#include "media/base/bind_to_current_loop.h"
#include "media/base/filter_collection.h"
@@ -629,7 +630,9 @@ bool WebMediaPlayerImpl::copyVideoTextureToPlatformTexture(
return false;
if (video_frame->format() != media::VideoFrame::NATIVE_TEXTURE)
return false;
- if (video_frame->texture_target() != GL_TEXTURE_2D)
+
+ gpu::MailboxHolder* mailbox_holder = video_frame->mailbox_holder();
+ if (mailbox_holder->texture_target != GL_TEXTURE_2D)
return false;
// Since this method changes which texture is bound to the TEXTURE_2D target,
@@ -644,15 +647,12 @@ bool WebMediaPlayerImpl::copyVideoTextureToPlatformTexture(
DCHECK_EQ(static_cast<GLuint>(bound_texture), texture);
}
- media::VideoFrame::MailboxHolder* mailbox_holder =
- video_frame->texture_mailbox();
-
uint32 source_texture = web_graphics_context->createTexture();
- web_graphics_context->waitSyncPoint(mailbox_holder->sync_point());
+ web_graphics_context->waitSyncPoint(mailbox_holder->sync_point);
web_graphics_context->bindTexture(GL_TEXTURE_2D, source_texture);
web_graphics_context->consumeTextureCHROMIUM(GL_TEXTURE_2D,
- mailbox_holder->mailbox().name);
+ mailbox_holder->mailbox.name);
// The video is stored in a unmultiplied format, so premultiply
// if necessary.
diff --git a/content/renderer/pepper/pepper_graphics_2d_host.cc b/content/renderer/pepper/pepper_graphics_2d_host.cc
index e2003e8..5bed73c 100644
--- a/content/renderer/pepper/pepper_graphics_2d_host.cc
+++ b/content/renderer/pepper/pepper_graphics_2d_host.cc
@@ -620,7 +620,7 @@ int32_t PepperGraphics2DHost::OnHostMsgReadImageData(
}
void ReleaseCallback(scoped_ptr<base::SharedMemory> memory,
- unsigned sync_point,
+ uint32 sync_point,
bool lost_resource) {}
bool PepperGraphics2DHost::PrepareTextureMailbox(
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc
index 3ef54aa..b86efc4 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -109,6 +109,7 @@
#include "third_party/WebKit/public/web/WebSecurityOrigin.h"
#include "third_party/WebKit/public/web/WebUserGestureIndicator.h"
#include "third_party/WebKit/public/web/WebView.h"
+#include "third_party/khronos/GLES2/gl2.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkRect.h"
#include "ui/gfx/image/image_skia.h"
@@ -1869,7 +1870,7 @@ bool PepperPluginInstanceImpl::PrintPDFOutput(PP_Resource print_output,
#endif
}
-static void IgnoreCallback(unsigned, bool) {}
+static void IgnoreCallback(uint32, bool) {}
void PepperPluginInstanceImpl::UpdateLayer() {
if (!container_)
@@ -1907,7 +1908,7 @@ void PepperPluginInstanceImpl::UpdateLayer() {
texture_layer_ = cc::TextureLayer::CreateForMailbox(NULL);
opaque = bound_graphics_3d_->IsOpaque();
texture_layer_->SetTextureMailbox(
- cc::TextureMailbox(mailbox, 0),
+ cc::TextureMailbox(mailbox, GL_TEXTURE_2D, 0),
cc::SingleReleaseCallback::Create(base::Bind(&IgnoreCallback)));
plugin_layer = texture_layer_;
} else {