| 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 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 EGL_D3D_TEXTURE_SUBRESOURCE_ID_ANGLE, subresource, EGL_NONE, | 523 EGL_D3D_TEXTURE_SUBRESOURCE_ID_ANGLE, subresource, EGL_NONE, |
| 524 }; | 524 }; |
| 525 | 525 |
| 526 EGLBoolean result = eglStreamPostD3DTextureNV12ANGLE( | 526 EGLBoolean result = eglStreamPostD3DTextureNV12ANGLE( |
| 527 egl_display, stream_, static_cast<void*>(dx11_decoding_texture_.Get()), | 527 egl_display, stream_, static_cast<void*>(dx11_decoding_texture_.Get()), |
| 528 frame_attributes); | 528 frame_attributes); |
| 529 RETURN_ON_FAILURE(result, "Could not post texture", false); | 529 RETURN_ON_FAILURE(result, "Could not post texture", false); |
| 530 result = eglStreamConsumerAcquireKHR(egl_display, stream_); | 530 result = eglStreamConsumerAcquireKHR(egl_display, stream_); |
| 531 RETURN_ON_FAILURE(result, "Could not post acquire stream", false); | 531 RETURN_ON_FAILURE(result, "Could not post acquire stream", false); |
| 532 gl::GLImageDXGI* gl_image_dxgi = | 532 gl::GLImageDXGI* gl_image_dxgi = |
| 533 gl::GLImageDXGI::FromGLImage(gl_image_.get()); | 533 static_cast<gl::GLImageDXGI*>(gl_image_.get()); |
| 534 DCHECK(gl_image_dxgi); | 534 DCHECK(gl_image_dxgi); |
| 535 | 535 |
| 536 gl_image_dxgi->SetTexture(dx11_decoding_texture_, subresource); | 536 gl_image_dxgi->SetTexture(dx11_decoding_texture_, subresource); |
| 537 return true; | 537 return true; |
| 538 } | 538 } |
| 539 | 539 |
| 540 bool EGLStreamPictureBuffer::AllowOverlay() const { | 540 bool EGLStreamPictureBuffer::AllowOverlay() const { |
| 541 return true; | 541 return true; |
| 542 } | 542 } |
| 543 | 543 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 RETURN_ON_HR_FAILURE(hr, "Failed to get texture from output sample", false); | 639 RETURN_ON_HR_FAILURE(hr, "Failed to get texture from output sample", false); |
| 640 UINT subresource; | 640 UINT subresource; |
| 641 dxgi_buffer->GetSubresourceIndex(&subresource); | 641 dxgi_buffer->GetSubresourceIndex(&subresource); |
| 642 if (!decoder->InitializeID3D11VideoProcessor(size().width(), size().height(), | 642 if (!decoder->InitializeID3D11VideoProcessor(size().width(), size().height(), |
| 643 color_space_)) | 643 color_space_)) |
| 644 return false; | 644 return false; |
| 645 | 645 |
| 646 DCHECK(decoder->d3d11_processor_); | 646 DCHECK(decoder->d3d11_processor_); |
| 647 DCHECK(decoder->enumerator_); | 647 DCHECK(decoder->enumerator_); |
| 648 | 648 |
| 649 gl::GLImageDXGI* gl_image_dxgi = | 649 gl::CopyingGLImageDXGI* gl_image_dxgi = |
| 650 gl::GLImageDXGI::FromGLImage(gl_image_.get()); | 650 static_cast<gl::CopyingGLImageDXGI*>(gl_image_.get()); |
| 651 DCHECK(gl_image_dxgi); | 651 DCHECK(gl_image_dxgi); |
| 652 | 652 |
| 653 gl_image_dxgi->SetTexture(dx11_decoding_texture_, subresource); | 653 gl_image_dxgi->SetTexture(dx11_decoding_texture_, subresource); |
| 654 return static_cast<gl::CopyingGLImageDXGI*>(gl_image_dxgi) | 654 return gl_image_dxgi->InitializeVideoProcessor(decoder->d3d11_processor_, |
| 655 ->InitializeVideoProcessor(decoder->d3d11_processor_, | 655 decoder->enumerator_); |
| 656 decoder->enumerator_); | |
| 657 } | 656 } |
| 658 | 657 |
| 659 bool EGLStreamDelayedCopyPictureBuffer::AllowOverlay() const { | 658 bool EGLStreamDelayedCopyPictureBuffer::AllowOverlay() const { |
| 660 return true; | 659 return true; |
| 661 } | 660 } |
| 662 | 661 |
| 663 bool EGLStreamDelayedCopyPictureBuffer::CanBindSamples() const { | 662 bool EGLStreamDelayedCopyPictureBuffer::CanBindSamples() const { |
| 664 return true; | 663 return true; |
| 665 } | 664 } |
| 666 | 665 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 | 794 |
| 796 EGLDisplay egl_display = gl::GLSurfaceEGL::GetHardwareDisplay(); | 795 EGLDisplay egl_display = gl::GLSurfaceEGL::GetHardwareDisplay(); |
| 797 | 796 |
| 798 EGLBoolean result = eglStreamPostD3DTextureNV12ANGLE( | 797 EGLBoolean result = eglStreamPostD3DTextureNV12ANGLE( |
| 799 egl_display, stream_, static_cast<void*>(angle_copy_texture_.Get()), | 798 egl_display, stream_, static_cast<void*>(angle_copy_texture_.Get()), |
| 800 frame_attributes); | 799 frame_attributes); |
| 801 RETURN_ON_FAILURE(result, "Could not post stream", false); | 800 RETURN_ON_FAILURE(result, "Could not post stream", false); |
| 802 result = eglStreamConsumerAcquireKHR(egl_display, stream_); | 801 result = eglStreamConsumerAcquireKHR(egl_display, stream_); |
| 803 RETURN_ON_FAILURE(result, "Could not post acquire stream", false); | 802 RETURN_ON_FAILURE(result, "Could not post acquire stream", false); |
| 804 gl::GLImageDXGI* gl_image_dxgi = | 803 gl::GLImageDXGI* gl_image_dxgi = |
| 805 gl::GLImageDXGI::FromGLImage(gl_image_.get()); | 804 static_cast<gl::GLImageDXGI*>(gl_image_.get()); |
| 806 DCHECK(gl_image_dxgi); | 805 DCHECK(gl_image_dxgi); |
| 807 | 806 |
| 808 gl_image_dxgi->SetTexture(angle_copy_texture_, 0); | 807 gl_image_dxgi->SetTexture(angle_copy_texture_, 0); |
| 809 | 808 |
| 810 return true; | 809 return true; |
| 811 } | 810 } |
| 812 | 811 |
| 813 bool EGLStreamCopyPictureBuffer::ReusePictureBuffer() { | 812 bool EGLStreamCopyPictureBuffer::ReusePictureBuffer() { |
| 814 DCHECK_NE(UNUSED, state_); | 813 DCHECK_NE(UNUSED, state_); |
| 815 EGLDisplay egl_display = gl::GLSurfaceEGL::GetHardwareDisplay(); | 814 EGLDisplay egl_display = gl::GLSurfaceEGL::GetHardwareDisplay(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 829 | 828 |
| 830 bool EGLStreamCopyPictureBuffer::AllowOverlay() const { | 829 bool EGLStreamCopyPictureBuffer::AllowOverlay() const { |
| 831 return true; | 830 return true; |
| 832 } | 831 } |
| 833 | 832 |
| 834 bool EGLStreamCopyPictureBuffer::CanBindSamples() const { | 833 bool EGLStreamCopyPictureBuffer::CanBindSamples() const { |
| 835 return false; | 834 return false; |
| 836 } | 835 } |
| 837 | 836 |
| 838 } // namespace media | 837 } // namespace media |
| OLD | NEW |