Chromium Code Reviews| Index: media/gpu/avda_overlay_helper_impl.h |
| diff --git a/media/gpu/avda_overlay_helper_impl.h b/media/gpu/avda_overlay_helper_impl.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..29bdd7f8a08977a1bbb9bdfa79a8d2a3b25fa377 |
| --- /dev/null |
| +++ b/media/gpu/avda_overlay_helper_impl.h |
| @@ -0,0 +1,59 @@ |
| +// Copyright 2017 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. |
| + |
| +#ifndef MEDIA_GPU_AVDA_OVERLAY_HELPER_IMPL_H_ |
| +#define MEDIA_GPU_AVDA_OVERLAY_HELPER_IMPL_H_ |
| + |
| +#include "base/bind.h" |
| +#include "base/macros.h" |
| +#include "base/memory/weak_ptr.h" |
| +#include "media/base/android/android_overlay.h" |
| +#include "media/base/android/android_overlay_factory.h" |
| +#include "media/gpu/avda_overlay_helper.h" |
| +#include "media/gpu/media_gpu_export.h" |
| + |
| +namespace media { |
| + |
| +// Implementation of AVDAOverlayHelper. |
| +class MEDIA_GPU_EXPORT AVDAOverlayHelperImpl : public AVDAOverlayHelper { |
| + public: |
| + AVDAOverlayHelperImpl(); |
| + ~AVDAOverlayHelperImpl() override; |
| + |
| + // AVDAOverlayHelper |
| + void Startup(const UseOverlayCB& use_overlay_cb, |
| + const UseSurfaceTextureCB& use_surface_texture_cb, |
| + const StopUsingOverlayImmediatelyCB& stop_immediately_cb, |
| + std::unique_ptr<AndroidOverlayFactory> initial_factory) override; |
| + void OnOverlayFactory( |
| + std::unique_ptr<AndroidOverlayFactory> factory) override; |
| + |
| + private: |
| + // AndroidOverlay callbacks. |
| + void OnOverlayReady(AndroidOverlay*); |
| + void OnOverlayFailed(AndroidOverlay*); |
| + void OnSurfaceDestroyed(AndroidOverlay*); |
| + |
| + // Client callbacks. |
| + UseOverlayCB use_overlay_cb_; |
| + UseSurfaceTextureCB use_surface_texture_cb_; |
| + StopUsingOverlayImmediatelyCB stop_immediately_cb_; |
| + |
| + // Current overlay that we've consructed but haven't received ready / failed |
| + // callbacks yet. Will be nullptr if we haven't constructed one, or if we |
| + // sent it to the client already once it became ready to use. |
| + std::unique_ptr<AndroidOverlay> overlay_; |
| + |
| + // If true, we owe the client notification about whether to use an overlay |
| + // or a surface texture. |
| + bool client_notification_pending_ = false; |
| + |
| + std::unique_ptr<AndroidOverlayFactory> overlay_factory_; |
| + |
| + base::WeakPtrFactory<AVDAOverlayHelperImpl> weak_factory_; |
| +}; |
|
DaleCurtis
2017/04/20 19:10:43
DISALLOW...
liberato (no reviews please)
2017/04/20 22:01:39
Done. i didn't think i needed it if the base clas
|
| + |
| +} // namespace media |
| + |
| +#endif // MEDIA_GPU_AVDA_OVERLAY_HELPER_IMPL_H_ |