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

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

Issue 1745903002: Introduce GpuVideoDecodeAcceleratorFactory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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_factory.h
diff --git a/content/public/common/gpu_video_decode_accelerator_factory.h b/content/public/common/gpu_video_decode_accelerator_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..5aed22b259512345f3510a64c623ef6cb7e47397
--- /dev/null
+++ b/content/public/common/gpu_video_decode_accelerator_factory.h
@@ -0,0 +1,71 @@
+// 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_FACTORY_H_
+#define CONTENT_PUBLIC_COMMON_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_
+
+#include "base/threading/thread_checker.h"
+#include "content/common/content_export.h"
+#include "content/public/common/gpu_video_decode_accelerator_helpers.h"
+#include "gpu/config/gpu_info.h"
+#include "media/video/video_decode_accelerator.h"
+
+namespace content {
+
+// This factory allows creation of VideoDecodeAccelerator implementations,
+// providing the most applicable VDA for current platform and given
+// configuration. To be used in GPU process only.
jam 2016/03/14 15:58:29 then this should be in content/public/gpu
+class CONTENT_EXPORT GpuVideoDecodeAcceleratorFactory {
+ public:
+ ~GpuVideoDecodeAcceleratorFactory();
+
+ // Create a factory capable of producing VDA instances for current platform.
+ static scoped_ptr<GpuVideoDecodeAcceleratorFactory> Create(
+ const gpu_vda::GetGLContextCallback& get_gl_context_cb,
+ const gpu_vda::MakeGLContextCurrentCallback& make_context_current_cb,
+ const gpu_vda::BindGLImageCallback& bind_image_cb);
+
+ static scoped_ptr<GpuVideoDecodeAcceleratorFactory> CreateWithGLES2Decoder(
+ const gpu_vda::GetGLContextCallback& get_gl_context_cb,
+ const gpu_vda::MakeGLContextCurrentCallback& make_context_current_cb,
+ const gpu_vda::BindGLImageCallback& bind_image_cb,
+ const gpu_vda::GetGLES2DecoderCallback& get_gles2_decoder_cb);
+
+ // Return decoder capabilities supported on the current platform.
+ static gpu::VideoDecodeAcceleratorCapabilities GetDecoderCapabilities();
+
+ // Create a VDA for the current platform for |client| with the given |config|.
+ // Return nullptr on failure.
+ scoped_ptr<media::VideoDecodeAccelerator> CreateVDA(
+ media::VideoDecodeAccelerator::Client* client,
+ const media::VideoDecodeAccelerator::Config& config);
+
+ private:
+ GpuVideoDecodeAcceleratorFactory(
jam 2016/03/14 15:58:29 this section in private is against the content api
jam 2016/03/16 20:56:43 this comment is still not addressed. why is there
Pawel Osciak 2016/03/17 11:15:16 Sorry somehow missed this. Created a GpuVideoDecod
jam 2016/03/17 15:43:26 I'm not sure I understand the point of having both
jam 2016/03/18 01:18:56 ignore this comment, and thanks for the explanatio
+ const gpu_vda::GetGLContextCallback& get_gl_context_cb,
+ const gpu_vda::MakeGLContextCurrentCallback& make_context_current_cb,
+ const gpu_vda::BindGLImageCallback& bind_image_cb,
+ const gpu_vda::GetGLES2DecoderCallback& get_gles2_decoder_cb);
+
+ scoped_ptr<media::VideoDecodeAccelerator> CreateDXVAVDA() const;
+ scoped_ptr<media::VideoDecodeAccelerator> CreateV4L2VDA() const;
+ scoped_ptr<media::VideoDecodeAccelerator> CreateV4L2SVDA() const;
+ scoped_ptr<media::VideoDecodeAccelerator> CreateVaapiVDA() const;
+ scoped_ptr<media::VideoDecodeAccelerator> CreateVTVDA() const;
+ scoped_ptr<media::VideoDecodeAccelerator> CreateOzoneVDA() const;
+ scoped_ptr<media::VideoDecodeAccelerator> CreateAndroidVDA() const;
+
+ const gpu_vda::GetGLContextCallback get_gl_context_cb_;
+ const gpu_vda::MakeGLContextCurrentCallback make_context_current_cb_;
+ const gpu_vda::BindGLImageCallback bind_image_cb_;
+ const gpu_vda::GetGLES2DecoderCallback& get_gles2_decoder_cb_;
+
+ base::ThreadChecker thread_checker_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(GpuVideoDecodeAcceleratorFactory);
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_COMMON_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698