1 //
2 // Copyright (c) 2016 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 
7 // StreamProducerNV12.h: Interface for a NV12 texture stream producer
8 
9 #ifndef LIBANGLE_RENDERER_D3D_D3D11_STREAM11_H_
10 #define LIBANGLE_RENDERER_D3D_D3D11_STREAM11_H_
11 
12 #include "libANGLE/renderer/StreamProducerImpl.h"
13 
14 namespace rx
15 {
16 class Renderer11;
17 
18 class StreamProducerNV12 : public StreamProducerImpl
19 {
20   public:
21     StreamProducerNV12(Renderer11 *renderer);
22     ~StreamProducerNV12() override;
23 
24     egl::Error validateD3DNV12Texture(void *pointer) const override;
25     void postD3DNV12Texture(void *pointer, const egl::AttributeMap &attributes) override;
26     egl::Stream::GLTextureDescription getGLFrameDescription(int planeIndex) override;
27 
28     // Gets a pointer to the internal D3D texture
29     ID3D11Texture2D *getD3DTexture();
30 
31     // Gets the slice index for the D3D texture that the frame is in
32     UINT getArraySlice();
33 
34   private:
35     Renderer11 *mRenderer;
36 
37     ID3D11Texture2D *mTexture;
38     UINT mArraySlice;
39     UINT mTextureWidth;
40     UINT mTextureHeight;
41 };
42 }  // namespace rx
43 
44 #endif  // LIBANGLE_RENDERER_D3D_D3D11_STREAM11_H_
45