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 #include "media/gpu/dxva_picture_buffer_win.h" | 5 #include "media/gpu/dxva_picture_buffer_win.h" |
6 | 6 |
7 #include "media/gpu/dxva_video_decode_accelerator_win.h" | 7 #include "media/gpu/dxva_video_decode_accelerator_win.h" |
8 #include "third_party/angle/include/EGL/egl.h" | 8 #include "third_party/angle/include/EGL/egl.h" |
9 #include "third_party/angle/include/EGL/eglext.h" | 9 #include "third_party/angle/include/EGL/eglext.h" |
10 #include "ui/gl/gl_bindings.h" | 10 #include "ui/gl/gl_bindings.h" |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 // Grab a reference on the decoder surface and the target surface. These | 253 // Grab a reference on the decoder surface and the target surface. These |
254 // references will be released when we receive a notification that the | 254 // references will be released when we receive a notification that the |
255 // copy was completed or when the DXVAPictureBuffer instance is destroyed. | 255 // copy was completed or when the DXVAPictureBuffer instance is destroyed. |
256 // We hold references here as it is easier to manage their lifetimes. | 256 // We hold references here as it is easier to manage their lifetimes. |
257 hr = decoding_texture_->GetSurfaceLevel(0, target_surface_.Receive()); | 257 hr = decoding_texture_->GetSurfaceLevel(0, target_surface_.Receive()); |
258 RETURN_ON_HR_FAILURE(hr, "Failed to get surface from texture", false); | 258 RETURN_ON_HR_FAILURE(hr, "Failed to get surface from texture", false); |
259 | 259 |
260 decoder_surface_ = dest_surface; | 260 decoder_surface_ = dest_surface; |
261 | 261 |
262 decoder->CopySurface(decoder_surface_.get(), target_surface_.get(), id(), | 262 decoder->CopySurface(decoder_surface_.get(), target_surface_.get(), id(), |
263 input_buffer_id); | 263 input_buffer_id, color_space_); |
| 264 color_space_ = gfx::ColorSpace(); |
264 return true; | 265 return true; |
265 } | 266 } |
266 | 267 |
267 gl::GLFence* PbufferPictureBuffer::reuse_fence() { | 268 gl::GLFence* PbufferPictureBuffer::reuse_fence() { |
268 return reuse_fence_.get(); | 269 return reuse_fence_.get(); |
269 } | 270 } |
270 | 271 |
271 bool PbufferPictureBuffer::CopySurfaceComplete( | 272 bool PbufferPictureBuffer::CopySurfaceComplete( |
272 IDirect3DSurface9* src_surface, | 273 IDirect3DSurface9* src_surface, |
273 IDirect3DSurface9* dest_surface) { | 274 IDirect3DSurface9* dest_surface) { |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 state_ = UNUSED; | 604 state_ = UNUSED; |
604 | 605 |
605 if (stream_) { | 606 if (stream_) { |
606 EGLBoolean result = eglStreamConsumerReleaseKHR(egl_display, stream_); | 607 EGLBoolean result = eglStreamConsumerReleaseKHR(egl_display, stream_); |
607 RETURN_ON_FAILURE(result, "Could not release stream", false); | 608 RETURN_ON_FAILURE(result, "Could not release stream", false); |
608 } | 609 } |
609 return true; | 610 return true; |
610 } | 611 } |
611 | 612 |
612 } // namespace media | 613 } // namespace media |
OLD | NEW |