| 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 #elif defined(USE_OZONE) | |
| 13 #include "content/common/gpu/media/vaapi_drm_picture.h" | |
| 14 #endif | |
| 15 | |
| 16 namespace content { | |
| 17 | |
| 18 // static | |
| 19 linked_ptr<VaapiPicture> VaapiPicture::CreatePicture( | |
| 20 const scoped_refptr<VaapiWrapper>& vaapi_wrapper, | |
| 21 const MakeGLContextCurrentCallback& make_context_current_cb, | |
| 22 int32_t picture_buffer_id, | |
| 23 uint32_t texture_id, | |
| 24 const gfx::Size& size) { | |
| 25 linked_ptr<VaapiPicture> picture; | |
| 26 #if defined(USE_X11) | |
| 27 picture.reset(new VaapiTFPPicture(vaapi_wrapper, make_context_current_cb, | |
| 28 picture_buffer_id, texture_id, size)); | |
| 29 #elif defined(USE_OZONE) | |
| 30 picture.reset(new VaapiDrmPicture(vaapi_wrapper, make_context_current_cb, | |
| 31 picture_buffer_id, texture_id, size)); | |
| 32 #endif // USE_X11 | |
| 33 | |
| 34 if (picture.get() && !picture->Initialize()) | |
| 35 picture.reset(); | |
| 36 | |
| 37 return picture; | |
| 38 } | |
| 39 | |
| 40 bool VaapiPicture::AllowOverlay() const { | |
| 41 return false; | |
| 42 } | |
| 43 | |
| 44 // static | |
| 45 uint32_t VaapiPicture::GetGLTextureTarget() { | |
| 46 #if defined(USE_OZONE) | |
| 47 return GL_TEXTURE_EXTERNAL_OES; | |
| 48 #else | |
| 49 return GL_TEXTURE_2D; | |
| 50 #endif | |
| 51 } | |
| 52 | |
| 53 } // namespace content | |
| OLD | NEW |