Index: ui/gl/gl_image_dxgi.h |
diff --git a/ui/gl/gl_image_dxgi.h b/ui/gl/gl_image_dxgi.h |
index 10d5b2405ff2a4eadaa339543d75f1b18b58ac52..c61946100ee47b893d1061959b7e3275733e3fd3 100644 |
--- a/ui/gl/gl_image_dxgi.h |
+++ b/ui/gl/gl_image_dxgi.h |
@@ -5,11 +5,11 @@ |
#include <d3d11.h> |
#include "base/win/scoped_comptr.h" |
-#include "third_party/khronos/EGL/egl.h" |
-#include "third_party/khronos/EGL/eglext.h" |
#include "ui/gl/gl_export.h" |
#include "ui/gl/gl_image.h" |
+typedef void* EGLStreamKHR; |
+ |
namespace gl { |
class GL_EXPORT GLImageDXGI : public GLImage { |
@@ -48,7 +48,6 @@ class GL_EXPORT GLImageDXGI : public GLImage { |
protected: |
~GLImageDXGI() override; |
- private: |
gfx::Size size_; |
EGLStreamKHR stream_; |
@@ -56,4 +55,35 @@ class GL_EXPORT GLImageDXGI : public GLImage { |
base::win::ScopedComPtr<ID3D11Texture2D> texture_; |
size_t level_ = 0; |
}; |
+ |
+// This copies to a new texture on bind. |
+class GL_EXPORT CopyingGLImageDXGI : public GLImageDXGI { |
+ public: |
+ CopyingGLImageDXGI(const base::win::ScopedComPtr<ID3D11Device>& d3d11_device, |
+ const gfx::Size& size, |
+ EGLStreamKHR stream); |
+ |
+ bool Initialize(); |
+ bool InitializeVideoProcessor( |
+ const base::win::ScopedComPtr<ID3D11VideoProcessor>& video_processor, |
+ const base::win::ScopedComPtr<ID3D11VideoProcessorEnumerator>& |
+ enumerator); |
+ void UnbindFromTexture(); |
+ |
+ // GLImage implementation. |
+ bool BindTexImage(unsigned target) override; |
+ |
+ private: |
+ ~CopyingGLImageDXGI() override; |
+ |
+ bool copied_ = false; |
+ |
+ base::win::ScopedComPtr<ID3D11VideoDevice> video_device_; |
+ base::win::ScopedComPtr<ID3D11VideoContext> video_context_; |
+ base::win::ScopedComPtr<ID3D11VideoProcessor> d3d11_processor_; |
+ base::win::ScopedComPtr<ID3D11VideoProcessorEnumerator> enumerator_; |
+ base::win::ScopedComPtr<ID3D11Device> d3d11_device_; |
+ base::win::ScopedComPtr<ID3D11Texture2D> decoder_copy_texture_; |
+ base::win::ScopedComPtr<ID3D11VideoProcessorOutputView> output_view_; |
+}; |
} |