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

Side by Side Diff: content/common/gpu/media/vaapi_picture.cc

Issue 490233002: VaapiVideoAccelerator: make Vaapi accelerator work with ozone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update after Pawel's review Created 6 years 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
OLDNEW
(Empty)
1 // Copyright 2014 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/common/gpu/media/vaapi_picture.h"
6 #include "content/common/gpu/media/vaapi_wrapper.h"
7 #include "ui/gl/gl_bindings.h"
8
9 #if defined(USE_X11)
10 #include "content/common/gpu/media/vaapi_tfp_picture.h"
11 #else
12 #include "content/common/gpu/media/vaapi_drm_picture.h"
13 #endif
14
15 namespace content {
16
17 // static
18 linked_ptr<VaapiPicture> VaapiPicture::CreatePicture(
19 scoped_refptr<VaapiWrapper> vaapi_wrapper,
Pawel Osciak 2014/12/09 01:19:25 const scoped_refptr<>& please
llandwerlin-old 2014/12/09 11:19:48 Done.
20 gfx::GLContext* gl_context,
21 const base::Callback<bool(void)> make_context_current,
22 int32 picture_buffer_id,
23 uint32 texture_id,
24 const gfx::Size& size) {
25 linked_ptr<VaapiPicture> picture;
26 #if defined(USE_X11)
27 picture.reset(
28 new VaapiTFPPicture(vaapi_wrapper,
29 reinterpret_cast<gfx::GLContextGLX*>(gl_context),
30 make_context_current,
31 picture_buffer_id,
32 texture_id,
33 size));
34 #else
35 picture.reset(new VaapiDrmPicture(
36 vaapi_wrapper, make_context_current, picture_buffer_id,
37 texture_id, size));
38 #endif // USE_X11
39
40 if (!picture->Initialize())
41 picture.reset();
42
43 return picture;
44 }
45
46 // static
47 uint32 VaapiPicture::GetGLTextureTarget() {
48 #if defined(USE_OZONE)
49 return GL_TEXTURE_EXTERNAL_OES;
50 #else
51 return GL_TEXTURE_2D;
52 #endif
53 }
54
55 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698