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

Unified Diff: ui/gl/gl_image_dxgi.h

Issue 2859723002: Copy NV12 picture buffers on demand on the main thread. (Closed)
Patch Set: change comment Created 3 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/khronos/README.chromium ('k') | ui/gl/gl_image_dxgi.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
+};
}
« no previous file with comments | « third_party/khronos/README.chromium ('k') | ui/gl/gl_image_dxgi.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698