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