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

Side by Side Diff: content/public/gpu/gpu_video_decode_accelerator_factory.cc

Issue 2171473003: Remove content::GpuVideoDecodeAcceleratorFactory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gpu_init_order
Patch Set: rebase Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « content/public/gpu/gpu_video_decode_accelerator_factory.h ('k') | media/gpu/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/public/gpu/gpu_video_decode_accelerator_factory.h"
6
7 #include "base/memory/ptr_util.h"
8 #include "content/gpu/gpu_child_thread.h"
9 #include "media/gpu/gpu_video_decode_accelerator_factory_impl.h"
10
11 namespace content {
12
13 GpuVideoDecodeAcceleratorFactory::~GpuVideoDecodeAcceleratorFactory() {}
14
15 // static
16 std::unique_ptr<GpuVideoDecodeAcceleratorFactory>
17 GpuVideoDecodeAcceleratorFactory::Create(
18 const GetGLContextCallback& get_gl_context_cb,
19 const MakeGLContextCurrentCallback& make_context_current_cb,
20 const BindGLImageCallback& bind_image_cb) {
21 auto gvdafactory_impl = media::GpuVideoDecodeAcceleratorFactoryImpl::Create(
22 get_gl_context_cb, make_context_current_cb, bind_image_cb);
23 if (!gvdafactory_impl)
24 return nullptr;
25
26 return base::WrapUnique(
27 new GpuVideoDecodeAcceleratorFactory(std::move(gvdafactory_impl)));
28 }
29
30 // static
31 std::unique_ptr<GpuVideoDecodeAcceleratorFactory>
32 GpuVideoDecodeAcceleratorFactory::CreateWithGLES2Decoder(
33 const GetGLContextCallback& get_gl_context_cb,
34 const MakeGLContextCurrentCallback& make_context_current_cb,
35 const BindGLImageCallback& bind_image_cb,
36 const GetGLES2DecoderCallback& get_gles2_decoder_cb) {
37 auto gvdafactory_impl =
38 media::GpuVideoDecodeAcceleratorFactoryImpl::CreateWithGLES2Decoder(
39 get_gl_context_cb, make_context_current_cb, bind_image_cb,
40 get_gles2_decoder_cb);
41 if (!gvdafactory_impl)
42 return nullptr;
43
44 return base::WrapUnique(
45 new GpuVideoDecodeAcceleratorFactory(std::move(gvdafactory_impl)));
46 }
47
48 // static
49 std::unique_ptr<GpuVideoDecodeAcceleratorFactory>
50 GpuVideoDecodeAcceleratorFactory::CreateWithNoGL() {
51 auto gvdafactory_impl =
52 media::GpuVideoDecodeAcceleratorFactoryImpl::CreateWithNoGL();
53 if (!gvdafactory_impl)
54 return nullptr;
55
56 return base::WrapUnique(
57 new GpuVideoDecodeAcceleratorFactory(std::move(gvdafactory_impl)));
58 }
59
60 // static
61 gpu::VideoDecodeAcceleratorCapabilities
62 GpuVideoDecodeAcceleratorFactory::GetDecoderCapabilities() {
63 const gpu::GpuPreferences gpu_preferences =
64 GpuChildThread::current()->gpu_preferences();
65 return media::GpuVideoDecodeAcceleratorFactoryImpl::GetDecoderCapabilities(
66 gpu_preferences);
67 }
68
69 std::unique_ptr<media::VideoDecodeAccelerator>
70 GpuVideoDecodeAcceleratorFactory::CreateVDA(
71 media::VideoDecodeAccelerator::Client* client,
72 const media::VideoDecodeAccelerator::Config& config) {
73 if (!gvdafactory_impl_)
74 return nullptr;
75
76 const gpu::GpuPreferences gpu_preferences =
77 GpuChildThread::current()->gpu_preferences();
78 return gvdafactory_impl_->CreateVDA(
79 client, config, gpu::GpuDriverBugWorkarounds(), gpu_preferences);
80 }
81
82 GpuVideoDecodeAcceleratorFactory::GpuVideoDecodeAcceleratorFactory(
83 std::unique_ptr<media::GpuVideoDecodeAcceleratorFactoryImpl>
84 gvdafactory_impl) : gvdafactory_impl_(std::move(gvdafactory_impl)) {}
85
86 } // namespace content
OLDNEW
« no previous file with comments | « content/public/gpu/gpu_video_decode_accelerator_factory.h ('k') | media/gpu/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698