summaryrefslogtreecommitdiffstats
path: root/content/public/gpu/gpu_video_decode_accelerator_factory.h
diff options
context:
space:
mode:
authorbrettw <brettw@chromium.org>2016-03-25 10:55:15 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-25 17:56:51 +0000
commitaffa906687c76c929545f8073fffaa53ff3a1a4a (patch)
tree3755b1452b8fc4e4c722dd200a59d0998c0e162d /content/public/gpu/gpu_video_decode_accelerator_factory.h
parent36bf097458296e86dd3054632826dc78f658856f (diff)
downloadchromium_src-lkcr.zip
chromium_src-lkcr.tar.gz
chromium_src-lkcr.tar.bz2
Revert of Introduce GpuVideoDecodeAcceleratorFactory. (patchset #22 id:600001 of https://codereview.chromium.org/1745903002/ )lkcr
Reason for revert: Too many problems: Android, Win64 linking, component linking (duplicate code die to incorrect visibility) Original issue's description: > Introduce GpuVideoDecodeAcceleratorFactory. > > - Move platform-specific code from GpuVideoDecodeAccelerator to > GpuVideoDecodeAcceleratorFactory. > > - Make GVDAFactory a content/public interface, to provide the ability to > instantiate VDAs from outside content/. > > - Unify how we obtain access to various GL functionality/classes from VDAs > by introducing a set of callbacks provided by the client. > > - Replace VDA::CanDecodeOnIOThread() with > VDA::TryInitializeDecodeOnSeparateThread(). This allows us to remove > additional client/taskrunner arguments from VDA constructors, and give client > the option to use a separate thread to decode, instead of having to make this > decision in the factory, and enforcing these arguments in the constructors. > > - Deduplicate VDA creation code across users (currently GVDA and vdaunittest). > > BUG=b/27687678 > TEST=compile/run various VDA impls > CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_optional_gpu_tests_rel > > Committed: https://crrev.com/6977e5243786901a766a38c2c291464875dffbd6 > Cr-Commit-Position: refs/heads/master@{#383256} TBR=jochen@chromium.org,ananta@chromium.org,fsamuel@chromium.org,kcwu@chromium.org,liberato@chromium.org,owenlin@chromium.org,sandersd@chromium.org,jam@chromium.org,boliu@chromium.org,posciak@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=b/27687678 Review URL: https://codereview.chromium.org/1832123002 Cr-Commit-Position: refs/heads/master@{#383300}
Diffstat (limited to 'content/public/gpu/gpu_video_decode_accelerator_factory.h')
-rw-r--r--content/public/gpu/gpu_video_decode_accelerator_factory.h96
1 files changed, 0 insertions, 96 deletions
diff --git a/content/public/gpu/gpu_video_decode_accelerator_factory.h b/content/public/gpu/gpu_video_decode_accelerator_factory.h
deleted file mode 100644
index b02ceea..0000000
--- a/content/public/gpu/gpu_video_decode_accelerator_factory.h
+++ /dev/null
@@ -1,96 +0,0 @@
-// 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_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_
-#define CONTENT_PUBLIC_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_
-
-#include "base/callback.h"
-#include "base/memory/weak_ptr.h"
-#include "content/common/content_export.h"
-#include "gpu/command_buffer/service/gpu_preferences.h"
-#include "gpu/config/gpu_info.h"
-#include "media/video/video_decode_accelerator.h"
-
-namespace gfx {
-class GLContext;
-}
-
-namespace gl {
-class GLImage;
-}
-
-namespace gpu {
-namespace gles2 {
-class GLES2Decoder;
-}
-}
-
-namespace content {
-
-class GpuVideoDecodeAcceleratorFactoryImpl;
-
-// 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.
-class CONTENT_EXPORT GpuVideoDecodeAcceleratorFactory {
- public:
- virtual ~GpuVideoDecodeAcceleratorFactory();
-
- // Return current GLContext.
- using GetGLContextCallback = base::Callback<gfx::GLContext*(void)>;
-
- // Make the applicable GL context current. To be called by VDAs before
- // executing any GL calls. Return true on success, false otherwise.
- using MakeGLContextCurrentCallback = base::Callback<bool(void)>;
-
- // Bind |image| to |client_texture_id| given |texture_target|. If
- // |can_bind_to_sampler| is true, then the image may be used as a sampler
- // directly, otherwise a copy to a staging buffer is required.
- // Return true on success, false otherwise.
- using BindGLImageCallback =
- base::Callback<bool(uint32_t client_texture_id,
- uint32_t texture_target,
- const scoped_refptr<gl::GLImage>& image,
- bool can_bind_to_sampler)>;
-
- // Return a WeakPtr to a GLES2Decoder, if one is available.
- using GetGLES2DecoderCallback =
- base::Callback<base::WeakPtr<gpu::gles2::GLES2Decoder>(void)>;
-
- // Create a factory capable of producing VDA instances for current platform.
- static scoped_ptr<GpuVideoDecodeAcceleratorFactory> Create(
- const GetGLContextCallback& get_gl_context_cb,
- const MakeGLContextCurrentCallback& make_context_current_cb,
- const BindGLImageCallback& bind_image_cb);
-
- static scoped_ptr<GpuVideoDecodeAcceleratorFactory> CreateWithGLES2Decoder(
- const GetGLContextCallback& get_gl_context_cb,
- const MakeGLContextCurrentCallback& make_context_current_cb,
- const BindGLImageCallback& bind_image_cb,
- const GetGLES2DecoderCallback& get_gles2_decoder_cb);
-
- // Return decoder capabilities supported on the current platform.
- static gpu::VideoDecodeAcceleratorCapabilities GetDecoderCapabilities(
- const gpu::GpuPreferences& gpu_preferences);
-
- // Create a VDA for the current platform for |client| with the given |config|
- // and for given |gpu_preferences|. Return nullptr on failure.
- virtual scoped_ptr<media::VideoDecodeAccelerator> CreateVDA(
- media::VideoDecodeAccelerator::Client* client,
- const media::VideoDecodeAccelerator::Config& config,
- const gpu::GpuPreferences& gpu_preferences);
-
- private:
- // TODO(posciak): This is temporary and will not be needed once
- // GpuVideoDecodeAcceleratorFactoryImpl implements
- // GpuVideoDecodeAcceleratorFactory, see crbug.com/597150 and related.
- GpuVideoDecodeAcceleratorFactory(
- scoped_ptr<GpuVideoDecodeAcceleratorFactoryImpl> gvdafactory_impl);
-
- scoped_ptr<GpuVideoDecodeAcceleratorFactoryImpl> gvdafactory_impl_;
-};
-
-} // namespace content
-
-#endif // CONTENT_PUBLIC_GPU_GPU_VIDEO_DECODE_ACCELERATOR_FACTORY_H_