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