| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 MEDIA_GPU_DXVA_PICTURE_BUFFER_WIN_H_ | 5 #ifndef MEDIA_GPU_DXVA_PICTURE_BUFFER_WIN_H_ |
| 6 #define MEDIA_GPU_DXVA_PICTURE_BUFFER_WIN_H_ | 6 #define MEDIA_GPU_DXVA_PICTURE_BUFFER_WIN_H_ |
| 7 | 7 |
| 8 #include <d3d11.h> | 8 #include <d3d11.h> |
| 9 #include <d3d9.h> | 9 #include <d3d9.h> |
| 10 #include <mfidl.h> | 10 #include <mfidl.h> |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 bool available() const { return available_; } | 47 bool available() const { return available_; } |
| 48 | 48 |
| 49 void set_available(bool available) { available_ = available; } | 49 void set_available(bool available) { available_ = available; } |
| 50 | 50 |
| 51 int id() const { return picture_buffer_.id(); } | 51 int id() const { return picture_buffer_.id(); } |
| 52 | 52 |
| 53 gfx::Size size() const { return picture_buffer_.size(); } | 53 gfx::Size size() const { return picture_buffer_.size(); } |
| 54 | 54 |
| 55 virtual bool waiting_to_reuse() const; | 55 virtual bool waiting_to_reuse() const; |
| 56 virtual gfx::GLFence* reuse_fence(); | 56 virtual gl::GLFence* reuse_fence(); |
| 57 | 57 |
| 58 // Called when the source surface |src_surface| is copied to the destination | 58 // Called when the source surface |src_surface| is copied to the destination |
| 59 // |dest_surface| | 59 // |dest_surface| |
| 60 virtual bool CopySurfaceComplete(IDirect3DSurface9* src_surface, | 60 virtual bool CopySurfaceComplete(IDirect3DSurface9* src_surface, |
| 61 IDirect3DSurface9* dest_surface); | 61 IDirect3DSurface9* dest_surface); |
| 62 virtual bool BindSampleToTexture(base::win::ScopedComPtr<IMFSample> sample); | 62 virtual bool BindSampleToTexture(base::win::ScopedComPtr<IMFSample> sample); |
| 63 | 63 |
| 64 protected: | 64 protected: |
| 65 explicit DXVAPictureBuffer(const media::PictureBuffer& buffer); | 65 explicit DXVAPictureBuffer(const media::PictureBuffer& buffer); |
| 66 | 66 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 81 bool InitializeTexture(const DXVAVideoDecodeAccelerator& decoder, | 81 bool InitializeTexture(const DXVAVideoDecodeAccelerator& decoder, |
| 82 bool use_rgb); | 82 bool use_rgb); |
| 83 | 83 |
| 84 bool ReusePictureBuffer() override; | 84 bool ReusePictureBuffer() override; |
| 85 void ResetReuseFence() override; | 85 void ResetReuseFence() override; |
| 86 bool CopyOutputSampleDataToPictureBuffer(DXVAVideoDecodeAccelerator* decoder, | 86 bool CopyOutputSampleDataToPictureBuffer(DXVAVideoDecodeAccelerator* decoder, |
| 87 IDirect3DSurface9* dest_surface, | 87 IDirect3DSurface9* dest_surface, |
| 88 ID3D11Texture2D* dx11_texture, | 88 ID3D11Texture2D* dx11_texture, |
| 89 int input_buffer_id) override; | 89 int input_buffer_id) override; |
| 90 bool waiting_to_reuse() const override; | 90 bool waiting_to_reuse() const override; |
| 91 gfx::GLFence* reuse_fence() override; | 91 gl::GLFence* reuse_fence() override; |
| 92 bool CopySurfaceComplete(IDirect3DSurface9* src_surface, | 92 bool CopySurfaceComplete(IDirect3DSurface9* src_surface, |
| 93 IDirect3DSurface9* dest_surface) override; | 93 IDirect3DSurface9* dest_surface) override; |
| 94 | 94 |
| 95 protected: | 95 protected: |
| 96 // This is true if the decoder is currently waiting on the fence before | 96 // This is true if the decoder is currently waiting on the fence before |
| 97 // reusing the buffer. | 97 // reusing the buffer. |
| 98 bool waiting_to_reuse_; | 98 bool waiting_to_reuse_; |
| 99 EGLSurface decoding_surface_; | 99 EGLSurface decoding_surface_; |
| 100 | 100 |
| 101 std::unique_ptr<gfx::GLFence> reuse_fence_; | 101 std::unique_ptr<gl::GLFence> reuse_fence_; |
| 102 | 102 |
| 103 HANDLE texture_share_handle_; | 103 HANDLE texture_share_handle_; |
| 104 base::win::ScopedComPtr<IDirect3DTexture9> decoding_texture_; | 104 base::win::ScopedComPtr<IDirect3DTexture9> decoding_texture_; |
| 105 base::win::ScopedComPtr<ID3D11Texture2D> dx11_decoding_texture_; | 105 base::win::ScopedComPtr<ID3D11Texture2D> dx11_decoding_texture_; |
| 106 | 106 |
| 107 base::win::ScopedComPtr<IDXGIKeyedMutex> egl_keyed_mutex_; | 107 base::win::ScopedComPtr<IDXGIKeyedMutex> egl_keyed_mutex_; |
| 108 base::win::ScopedComPtr<IDXGIKeyedMutex> dx11_keyed_mutex_; | 108 base::win::ScopedComPtr<IDXGIKeyedMutex> dx11_keyed_mutex_; |
| 109 | 109 |
| 110 // This is the last value that was used to release the keyed mutex. | 110 // This is the last value that was used to release the keyed mutex. |
| 111 uint64_t keyed_mutex_value_; | 111 uint64_t keyed_mutex_value_; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 140 private: | 140 private: |
| 141 EGLStreamKHR stream_; | 141 EGLStreamKHR stream_; |
| 142 | 142 |
| 143 base::win::ScopedComPtr<IMFSample> current_d3d_sample_; | 143 base::win::ScopedComPtr<IMFSample> current_d3d_sample_; |
| 144 base::win::ScopedComPtr<ID3D11Texture2D> dx11_decoding_texture_; | 144 base::win::ScopedComPtr<ID3D11Texture2D> dx11_decoding_texture_; |
| 145 }; | 145 }; |
| 146 | 146 |
| 147 } // namespace media | 147 } // namespace media |
| 148 | 148 |
| 149 #endif // MEDIA_GPU_DXVA_PICTURE_BUFFER_WIN_H_ | 149 #endif // MEDIA_GPU_DXVA_PICTURE_BUFFER_WIN_H_ |
| OLD | NEW |