OLD | NEW |
| (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 #include "ui/gl/gl_implementation.h" | |
9 | |
10 #if defined(USE_X11) | |
11 #include "content/common/gpu/media/vaapi_tfp_picture.h" | |
12 #endif | |
13 | |
14 namespace content { | |
15 | |
16 // static | |
17 linked_ptr<VaapiPicture> VaapiPicture::CreatePicture( | |
18 const scoped_refptr<VaapiWrapper>& vaapi_wrapper, | |
19 const base::Callback<bool(void)> make_context_current, | |
20 int32 picture_buffer_id, | |
21 uint32 texture_id, | |
22 const gfx::Size& size) { | |
23 linked_ptr<VaapiPicture> picture; | |
24 #if defined(USE_X11) | |
25 picture.reset(new VaapiTFPPicture(vaapi_wrapper, make_context_current, | |
26 picture_buffer_id, texture_id, size)); | |
27 #endif // USE_X11 | |
28 | |
29 if (picture.get() && !picture->Initialize()) | |
30 picture.reset(); | |
31 | |
32 return picture; | |
33 } | |
34 | |
35 // static | |
36 uint32 VaapiPicture::GetGLTextureTarget() { | |
37 return GL_TEXTURE_2D; | |
38 } | |
39 | |
40 } // namespace content | |
OLD | NEW |