Chromium Code Reviews| Index: media/mojo/services/video_overlay_factory.cc |
| diff --git a/chromecast/renderer/media/hole_frame_factory.cc b/media/mojo/services/video_overlay_factory.cc |
| similarity index 76% |
| copy from chromecast/renderer/media/hole_frame_factory.cc |
| copy to media/mojo/services/video_overlay_factory.cc |
| index 284e2c0ab2d419d696bf9d16dd72fb8bb6e573dc..815a1b3f9a9d9f096bc4993e5bd2ea416490b4ea 100644 |
| --- a/chromecast/renderer/media/hole_frame_factory.cc |
| +++ b/media/mojo/services/video_overlay_factory.cc |
| @@ -1,8 +1,8 @@ |
| -// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "chromecast/renderer/media/hole_frame_factory.h" |
| +#include "media/mojo/services/video_overlay_factory.h" |
| #include "base/bind.h" |
| #include "base/location.h" |
| @@ -11,15 +11,14 @@ |
| #include "media/base/video_frame.h" |
| #include "media/renderers/gpu_video_accelerator_factories.h" |
| -namespace chromecast { |
| namespace media { |
| -HoleFrameFactory::HoleFrameFactory( |
| +VideoOverlayFactory::VideoOverlayFactory( |
|
xhwang
2016/04/12 19:40:37
Newbie question. Does this class work in all proce
alokp
2016/04/19 00:16:07
So far it has only been used in the renderer proce
|
| ::media::GpuVideoAcceleratorFactories* gpu_factories) |
| : gpu_factories_(gpu_factories), texture_(0), image_id_(0) { |
| if (gpu_factories_) { |
| - std::unique_ptr<::media::GpuVideoAcceleratorFactories::ScopedGLContextLock> |
| - lock(gpu_factories_->GetGLContextLock()); |
| + scoped_ptr<::media::GpuVideoAcceleratorFactories::ScopedGLContextLock> lock( |
|
xhwang
2016/04/12 19:40:37
We should keep using unique_ptr
alokp
2016/04/19 00:16:07
Done.
|
| + gpu_factories_->GetGLContextLock()); |
| CHECK(lock); |
| gpu::gles2::GLES2Interface* gl = lock->ContextGL(); |
| @@ -39,10 +38,10 @@ HoleFrameFactory::HoleFrameFactory( |
| } |
| } |
| -HoleFrameFactory::~HoleFrameFactory() { |
| +VideoOverlayFactory::~VideoOverlayFactory() { |
| if (texture_) { |
| - std::unique_ptr<::media::GpuVideoAcceleratorFactories::ScopedGLContextLock> |
| - lock(gpu_factories_->GetGLContextLock()); |
| + scoped_ptr<::media::GpuVideoAcceleratorFactories::ScopedGLContextLock> lock( |
| + gpu_factories_->GetGLContextLock()); |
| CHECK(lock); |
| gpu::gles2::GLES2Interface* gl = lock->ContextGL(); |
| gl->BindTexture(GL_TEXTURE_2D, texture_); |
| @@ -52,17 +51,17 @@ HoleFrameFactory::~HoleFrameFactory() { |
| } |
| } |
| -scoped_refptr<::media::VideoFrame> HoleFrameFactory::CreateHoleFrame( |
| +scoped_refptr<::media::VideoFrame> VideoOverlayFactory::CreateFrame( |
| const gfx::Size& size) { |
| // No texture => audio device. size empty => video has one dimension = 0. |
| // Dimension 0 case triggers a DCHECK later on in TextureMailbox if we push |
| // through the overlay path. |
| if (!texture_ || size.IsEmpty()) { |
| - LOG(INFO) << "Create black frame " << size.width() << "x" << size.height(); |
| + DVLOG(1) << "Create black frame " << size.width() << "x" << size.height(); |
| return ::media::VideoFrame::CreateBlackFrame(gfx::Size(1, 1)); |
| } |
| - LOG(INFO) << "Create hole frame " << size.width() << "x" << size.height(); |
| + DVLOG(1) << "Create overlay frame " << size.width() << "x" << size.height(); |
| scoped_refptr<::media::VideoFrame> frame = |
| ::media::VideoFrame::WrapNativeTexture( |
| ::media::PIXEL_FORMAT_XRGB, |
| @@ -79,4 +78,3 @@ scoped_refptr<::media::VideoFrame> HoleFrameFactory::CreateHoleFrame( |
| } |
| } // namespace media |
| -} // namespace chromecast |