Chromium Code Reviews| Index: media/gpu/content_video_view_overlay.h |
| diff --git a/media/gpu/content_video_view_overlay.h b/media/gpu/content_video_view_overlay.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4d6f3820d7428e2ceb6bce043ebb80a9cddee3df |
| --- /dev/null |
| +++ b/media/gpu/content_video_view_overlay.h |
| @@ -0,0 +1,43 @@ |
| +// Copyright (c) 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
|
watk
2017/02/17 22:40:36
no (c)
liberato (no reviews please)
2017/03/07 21:30:25
never copy old headers :)
|
| +// found in the LICENSE file. |
| + |
| +#ifndef MEDIA_GPU_CONTENT_VIDEO_VIEW_OVERLAY_H_ |
| +#define MEDIA_GPU_CONTENT_VIDEO_VIEW_OVERLAY_H_ |
| + |
| +#include "base/memory/weak_ptr.h" |
| +#include "media/base/android/android_overlay.h" |
| +#include "media/gpu/avda_codec_allocator.h" |
| +#include "ui/gl/android/scoped_java_surface.h" |
| + |
| +namespace media { |
| + |
| +// TODO(liberato): most of Allocate/DeallocateSurface can be moved here, out |
| +// of AVDACodecAllocator. |
| +class ContentVideoViewOverlay : public AndroidOverlay, |
| + public AVDASurfaceAllocatorClient { |
| + public: |
| + // |config| is ignored except for callbacks. |
| + ContentVideoViewOverlay(AVDACodecAllocator* codec_allocator, |
| + int surface_id, |
| + const AndroidOverlay::Config& config); |
| + ~ContentVideoViewOverlay() override; |
| + |
| + // ContentVideoView ignores this, unfortunately. |
| + void ScheduleLayout(const gfx::Rect& rect) override; |
| + |
| + // AVDASurfaceAllocatorClient |
| + void OnSurfaceAvailable(bool success) override; |
| + void OnSurfaceDestroyed() override; |
| + |
| + private: |
| + AVDACodecAllocator* codec_allocator_; |
| + int surface_id_; |
| + AndroidOverlay::Config config_; |
| + |
| + base::WeakPtrFactory<ContentVideoViewOverlay> weak_factory_; |
| +}; |
| + |
| +} // namespace media |
| + |
| +#endif // MEDIA_GPU_ANDROID_CONTENT_VIDEO_VIEW_OVERLAY_H_ |