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

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: Rebase on ToT 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 const scoped_refptr<VaapiWrapper>& vaapi_wrapper,
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(new VaapiTFPPicture(
28 vaapi_wrapper, reinterpret_cast<gfx::GLContextGLX*>(gl_context),
piman 2014/12/16 20:46:43 use static_cast instead of reinterpret_cast. Can
llandwerlin-old 2014/12/17 11:46:37 Removing the gl context, this dcheck won't be need
29 make_context_current, picture_buffer_id, texture_id, size));
30 #else
31 picture.reset(new VaapiDrmPicture(vaapi_wrapper, make_context_current,
32 picture_buffer_id, texture_id, size));
33 #endif // USE_X11
34
35 if (!picture->Initialize())
36 picture.reset();
37
38 return picture;
39 }
40
41 // static
42 uint32 VaapiPicture::GetGLTextureTarget() {
43 #if defined(USE_OZONE)
44 return GL_TEXTURE_EXTERNAL_OES;
45 #else
46 return GL_TEXTURE_2D;
47 #endif
48 }
49
50 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698