Chromium Code Reviews| Index: media/gpu/android_video_surface_chooser_impl.cc |
| diff --git a/media/gpu/android_video_surface_chooser_impl.cc b/media/gpu/android_video_surface_chooser_impl.cc |
| index d1df41371d873bc61f3bcdcb43c305794080e37d..d6dcf6bceaa19b13e8747e2c6422d3b3082c9ae4 100644 |
| --- a/media/gpu/android_video_surface_chooser_impl.cc |
| +++ b/media/gpu/android_video_surface_chooser_impl.cc |
| @@ -15,12 +15,12 @@ void AndroidVideoSurfaceChooserImpl::Initialize( |
| UseOverlayCB use_overlay_cb, |
| UseSurfaceTextureCB use_surface_texture_cb, |
| StopUsingOverlayImmediatelyCB stop_immediately_cb, |
| - std::unique_ptr<AndroidOverlayFactory> initial_factory) { |
| + AndroidOverlayFactoryCB initial_factory) { |
| use_overlay_cb_ = std::move(use_overlay_cb); |
| use_surface_texture_cb_ = std::move(use_surface_texture_cb); |
| stop_immediately_cb_ = std::move(stop_immediately_cb); |
| - if (initial_factory) { |
| + if (!initial_factory.is_null()) { |
|
tguilbert
2017/05/04 21:52:05
NIT: Same "is_null() can be ommitted" comment.
liberato (no reviews please)
2017/05/05 16:50:23
Done.
|
| // We requested an overlay. Wait to see if it succeeds or fails, since |
| // hopefully this will be fast. On M+, we could ask it to start with a |
| // SurfaceTexture either way. Before M, we can't switch surfaces. In that |
| @@ -39,7 +39,7 @@ void AndroidVideoSurfaceChooserImpl::Initialize( |
| } |
| void AndroidVideoSurfaceChooserImpl::ReplaceOverlayFactory( |
| - std::unique_ptr<AndroidOverlayFactory> factory) { |
| + AndroidOverlayFactoryCB factory) { |
| // If we have an overlay, then we should transition away from it. It |
| // doesn't matter if we have a new factory or no factory; the old overlay goes |
| // with the old factory. |
| @@ -59,7 +59,7 @@ void AndroidVideoSurfaceChooserImpl::ReplaceOverlayFactory( |
| overlay_factory_ = std::move(factory); |
| // If we don't have a new factory, then just stop here. |
| - if (!overlay_factory_) |
| + if (overlay_factory_.is_null()) |
| return; |
| // We just got an overlay factory. Get an overlay immediately. This is |
| @@ -69,7 +69,7 @@ void AndroidVideoSurfaceChooserImpl::ReplaceOverlayFactory( |
| // a SurfaceTexture then be unable to switch. Perhaps there should be a |
| // pre-M implementation of this class that guarantees that it won't change |
| // between the two. |
| - AndroidOverlay::Config config; |
| + AndroidOverlayConfig config; |
| // We bind all of our callbacks with weak ptrs, since we don't know how long |
| // the client will hold on to overlays. They could, in principle, show up |
| // long after the client is destroyed too, if codec destruction hangs. |
| @@ -85,7 +85,7 @@ void AndroidVideoSurfaceChooserImpl::ReplaceOverlayFactory( |
| // set via the natural size, and this is ignored anyway. The client should |
| // provide this. |
| config.rect = gfx::Rect(0, 0, 1, 1); |
| - overlay_ = overlay_factory_->CreateOverlay(config); |
| + overlay_ = overlay_factory_.Run(std::move(config)); |
| } |
| void AndroidVideoSurfaceChooserImpl::OnOverlayReady(AndroidOverlay* overlay) { |