| 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 int input_buffer_id); | 46 int input_buffer_id); |
| 47 | 47 |
| 48 bool available() const { return state_ == UNUSED; } | 48 bool available() const { return state_ == UNUSED; } |
| 49 State state() const { return state_; } | 49 State state() const { return state_; } |
| 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 void set_bound(); | 54 void set_bound(); |
| 55 | 55 |
| 56 const gfx::ColorSpace& color_space() const { return color_space_; } | |
| 57 void set_color_space(const gfx::ColorSpace& color_space) { | |
| 58 color_space_ = color_space; | |
| 59 } | |
| 60 | |
| 61 bool waiting_to_reuse() const { return state_ == WAITING_TO_REUSE; } | 56 bool waiting_to_reuse() const { return state_ == WAITING_TO_REUSE; } |
| 62 virtual gl::GLFence* reuse_fence(); | 57 virtual gl::GLFence* reuse_fence(); |
| 63 | 58 |
| 64 // Called when the source surface |src_surface| is copied to the destination | 59 // Called when the source surface |src_surface| is copied to the destination |
| 65 // |dest_surface| | 60 // |dest_surface| |
| 66 virtual bool CopySurfaceComplete(IDirect3DSurface9* src_surface, | 61 virtual bool CopySurfaceComplete(IDirect3DSurface9* src_surface, |
| 67 IDirect3DSurface9* dest_surface); | 62 IDirect3DSurface9* dest_surface); |
| 68 virtual bool BindSampleToTexture(base::win::ScopedComPtr<IMFSample> sample); | 63 virtual bool BindSampleToTexture(base::win::ScopedComPtr<IMFSample> sample); |
| 69 | 64 |
| 70 protected: | 65 protected: |
| 71 explicit DXVAPictureBuffer(const PictureBuffer& buffer); | 66 explicit DXVAPictureBuffer(const PictureBuffer& buffer); |
| 72 | 67 |
| 73 State state_ = UNUSED; | 68 State state_ = UNUSED; |
| 74 PictureBuffer picture_buffer_; | 69 PictureBuffer picture_buffer_; |
| 75 gfx::ColorSpace color_space_; | |
| 76 | 70 |
| 77 DISALLOW_COPY_AND_ASSIGN(DXVAPictureBuffer); | 71 DISALLOW_COPY_AND_ASSIGN(DXVAPictureBuffer); |
| 78 }; | 72 }; |
| 79 | 73 |
| 80 // Copies the video result into an RGBA EGL pbuffer. | 74 // Copies the video result into an RGBA EGL pbuffer. |
| 81 class PbufferPictureBuffer : public DXVAPictureBuffer { | 75 class PbufferPictureBuffer : public DXVAPictureBuffer { |
| 82 public: | 76 public: |
| 83 explicit PbufferPictureBuffer(const PictureBuffer& buffer); | 77 explicit PbufferPictureBuffer(const PictureBuffer& buffer); |
| 84 ~PbufferPictureBuffer() override; | 78 ~PbufferPictureBuffer() override; |
| 85 | 79 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 // the decoder. | 176 // the decoder. |
| 183 base::win::ScopedComPtr<ID3D11Texture2D> decoder_copy_texture_; | 177 base::win::ScopedComPtr<ID3D11Texture2D> decoder_copy_texture_; |
| 184 | 178 |
| 185 // This is the last value that was used to release the keyed mutex. | 179 // This is the last value that was used to release the keyed mutex. |
| 186 uint64_t keyed_mutex_value_ = 0; | 180 uint64_t keyed_mutex_value_ = 0; |
| 187 }; | 181 }; |
| 188 | 182 |
| 189 } // namespace media | 183 } // namespace media |
| 190 | 184 |
| 191 #endif // MEDIA_GPU_DXVA_PICTURE_BUFFER_WIN_H_ | 185 #endif // MEDIA_GPU_DXVA_PICTURE_BUFFER_WIN_H_ |
| OLD | NEW |