Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1166)

Unified Diff: content/public/common/gpu_video_decode_accelerator_helpers.h

Issue 1745903002: Introduce GpuVideoDecodeAcceleratorFactory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/public/common/gpu_video_decode_accelerator_helpers.h
diff --git a/content/public/common/gpu_video_decode_accelerator_helpers.h b/content/public/common/gpu_video_decode_accelerator_helpers.h
new file mode 100644
index 0000000000000000000000000000000000000000..02c321f90dfa2a44a3a6e94cfcb30b76a212ea24
--- /dev/null
+++ b/content/public/common/gpu_video_decode_accelerator_helpers.h
@@ -0,0 +1,56 @@
+// 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.
+#ifndef CONTENT_PUBLIC_COMMON_GPU_VIDEO_DECODE_ACCELERATOR_HELPERS_H_
+#define CONTENT_PUBLIC_COMMON_GPU_VIDEO_DECODE_ACCELERATOR_HELPERS_H_
+
+#include "base/callback.h"
+#include "base/memory/weak_ptr.h"
+
+namespace gfx {
+class GLContext;
+}
+
+namespace gl {
+class GLImage;
+}
+
+namespace gpu {
+namespace gles2 {
+class GLES2Decoder;
+}
+}
+
+namespace content {
+
+// Helpers/defines for specific VideoDecodeAccelerator implementations in GPU
+// process. Which callbacks are required depends on the implementation.
+//
+// Note that these callbacks may be called more than once, and so must own/share
+// ownership of any objects bound to them.
+//
+// Unless specified otherwise, these callbacks must be executed on the GPU Child
+// thread (i.e. the thread which the VDAs are initialized on).
+struct gpu_vda_helpers {
jochen (gone - plz use gerrit) 2016/03/04 12:59:56 why is that not just a namespace?
Pawel Osciak 2016/03/07 02:02:02 Done.
+ // Return current GLContext.
+ using GetGLContextCb = base::Callback<gfx::GLContext*(void)>;
jochen (gone - plz use gerrit) 2016/03/04 12:59:56 Callback instead of Cb please
Pawel Osciak 2016/03/07 02:02:02 Done.
+
+ // Make the applicable GL context current. To be called by VDAs before
+ // executing any GL calls. Return true on success, false otherwise.
+ using MakeGLContextCurrentCb = base::Callback<bool(void)>;
+
+ // Bind |image| to |client_texture_id| given |texture_target|.
+ // Return true on success, false otherwise.
+ using BindGLImageCb =
+ base::Callback<bool(uint32_t client_texture_id,
+ uint32_t texture_target,
+ const scoped_refptr<gl::GLImage>& image)>;
+
+ // Return a WeakPtr to a GLES2Decoder, if one is available.
+ using GetGLES2DecoderCb =
+ base::Callback<base::WeakPtr<gpu::gles2::GLES2Decoder>(void)>;
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_COMMON_GPU_VIDEO_DECODE_ACCELERATOR_HELPERS_H_
« no previous file with comments | « content/public/common/gpu_video_decode_accelerator_factory.h ('k') | media/video/mock_video_decode_accelerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698