| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_COMMON_GPU_MEDIA_GLES2_TEXTURE_TO_EGL_IMAGE_TRANSLATOR_H_ | 5 #ifndef CONTENT_COMMON_GPU_MEDIA_GLES2_TEXTURE_TO_EGL_IMAGE_TRANSLATOR_H_ |
| 6 #define CONTENT_COMMON_GPU_MEDIA_GLES2_TEXTURE_TO_EGL_IMAGE_TRANSLATOR_H_ | 6 #define CONTENT_COMMON_GPU_MEDIA_GLES2_TEXTURE_TO_EGL_IMAGE_TRANSLATOR_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "media/video/picture.h" | 11 #include "media/video/picture.h" |
| 12 #include "third_party/angle/include/EGL/egl.h" | 12 #include "third_party/angle/include/EGL/egl.h" |
| 13 #include "third_party/angle/include/EGL/eglext.h" | 13 #include "third_party/angle/include/EGL/eglext.h" |
| 14 #include "third_party/angle/include/GLES2/gl2.h" | 14 #include "third_party/angle/include/GLES2/gl2.h" |
| 15 #include "third_party/angle/include/GLES2/gl2ext.h" | 15 #include "third_party/angle/include/GLES2/gl2ext.h" |
| 16 | 16 |
| 17 namespace content { |
| 18 |
| 17 // Class to wrap egl-opengles related operations. | 19 // Class to wrap egl-opengles related operations. |
| 18 // PPAPI will give the textures to OmxVideoDecodeAccelerator. | 20 // PPAPI will give the textures to OmxVideoDecodeAccelerator. |
| 19 // OmxVideoDecodeAccelerator will use this class to convert | 21 // OmxVideoDecodeAccelerator will use this class to convert |
| 20 // these texture into EGLImage and back. | 22 // these texture into EGLImage and back. |
| 21 class Gles2TextureToEglImageTranslator { | 23 class Gles2TextureToEglImageTranslator { |
| 22 public: | 24 public: |
| 23 Gles2TextureToEglImageTranslator(bool use_backing_pixmaps); | 25 Gles2TextureToEglImageTranslator(bool use_backing_pixmaps); |
| 24 ~Gles2TextureToEglImageTranslator(); | 26 ~Gles2TextureToEglImageTranslator(); |
| 25 | 27 |
| 26 // Translates texture into EGLImage and back. | 28 // Translates texture into EGLImage and back. |
| 27 EGLImageKHR TranslateToEglImage(EGLDisplay egl_display, | 29 EGLImageKHR TranslateToEglImage(EGLDisplay egl_display, |
| 28 EGLContext egl_context, | 30 EGLContext egl_context, |
| 29 uint32 texture, | 31 uint32 texture, |
| 30 const gfx::Size& dimensions); | 32 const gfx::Size& dimensions); |
| 31 uint32 TranslateToTexture(EGLImageKHR egl_image); | 33 uint32 TranslateToTexture(EGLImageKHR egl_image); |
| 32 void DestroyEglImage(EGLDisplay egl_display, EGLImageKHR egl_image); | 34 void DestroyEglImage(EGLDisplay egl_display, EGLImageKHR egl_image); |
| 33 | 35 |
| 34 private: | 36 private: |
| 35 bool use_backing_pixmaps_; | 37 bool use_backing_pixmaps_; |
| 36 typedef std::map<EGLImageKHR, Pixmap> ImagePixmap; | 38 typedef std::map<EGLImageKHR, Pixmap> ImagePixmap; |
| 37 ImagePixmap eglimage_pixmap_; | 39 ImagePixmap eglimage_pixmap_; |
| 38 DISALLOW_COPY_AND_ASSIGN(Gles2TextureToEglImageTranslator); | 40 DISALLOW_COPY_AND_ASSIGN(Gles2TextureToEglImageTranslator); |
| 39 }; | 41 }; |
| 40 | 42 |
| 43 } // namespace content |
| 44 |
| 41 #endif // CONTENT_COMMON_GPU_MEDIA_GLES2_TEXTURE_TO_EGL_IMAGE_TRANSLATOR_H_ | 45 #endif // CONTENT_COMMON_GPU_MEDIA_GLES2_TEXTURE_TO_EGL_IMAGE_TRANSLATOR_H_ |
| OLD | NEW |