Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: media/gpu/dxva_picture_buffer_win.cc

Issue 2968503003: Allow presenting DXGI share handles as overlays. (Closed)
Patch Set: add comment Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gpu/ipc/service/direct_composition_surface_win_unittest.cc ('k') | ui/gl/gl_image_dxgi.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
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::GLImageDXGI* gl_image_dxgi =
650 gl::GLImageDXGI::FromGLImage(gl_image_.get()); 650 static_cast<gl::GLImageDXGI*>(gl_image_.get());
sandersd (OOO until July 31) 2017/07/11 17:47:02 Cast directly to CopyingGLImageDXGI here?
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 static_cast<gl::CopyingGLImageDXGI*>(gl_image_dxgi)
655 ->InitializeVideoProcessor(decoder->d3d11_processor_, 655 ->InitializeVideoProcessor(decoder->d3d11_processor_,
656 decoder->enumerator_); 656 decoder->enumerator_);
657 } 657 }
658 658
659 bool EGLStreamDelayedCopyPictureBuffer::AllowOverlay() const { 659 bool EGLStreamDelayedCopyPictureBuffer::AllowOverlay() const {
660 return true; 660 return true;
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 795
796 EGLDisplay egl_display = gl::GLSurfaceEGL::GetHardwareDisplay(); 796 EGLDisplay egl_display = gl::GLSurfaceEGL::GetHardwareDisplay();
797 797
798 EGLBoolean result = eglStreamPostD3DTextureNV12ANGLE( 798 EGLBoolean result = eglStreamPostD3DTextureNV12ANGLE(
799 egl_display, stream_, static_cast<void*>(angle_copy_texture_.Get()), 799 egl_display, stream_, static_cast<void*>(angle_copy_texture_.Get()),
800 frame_attributes); 800 frame_attributes);
801 RETURN_ON_FAILURE(result, "Could not post stream", false); 801 RETURN_ON_FAILURE(result, "Could not post stream", false);
802 result = eglStreamConsumerAcquireKHR(egl_display, stream_); 802 result = eglStreamConsumerAcquireKHR(egl_display, stream_);
803 RETURN_ON_FAILURE(result, "Could not post acquire stream", false); 803 RETURN_ON_FAILURE(result, "Could not post acquire stream", false);
804 gl::GLImageDXGI* gl_image_dxgi = 804 gl::GLImageDXGI* gl_image_dxgi =
805 gl::GLImageDXGI::FromGLImage(gl_image_.get()); 805 static_cast<gl::GLImageDXGI*>(gl_image_.get());
806 DCHECK(gl_image_dxgi); 806 DCHECK(gl_image_dxgi);
807 807
808 gl_image_dxgi->SetTexture(angle_copy_texture_, 0); 808 gl_image_dxgi->SetTexture(angle_copy_texture_, 0);
809 809
810 return true; 810 return true;
811 } 811 }
812 812
813 bool EGLStreamCopyPictureBuffer::ReusePictureBuffer() { 813 bool EGLStreamCopyPictureBuffer::ReusePictureBuffer() {
814 DCHECK_NE(UNUSED, state_); 814 DCHECK_NE(UNUSED, state_);
815 EGLDisplay egl_display = gl::GLSurfaceEGL::GetHardwareDisplay(); 815 EGLDisplay egl_display = gl::GLSurfaceEGL::GetHardwareDisplay();
(...skipping 13 matching lines...) Expand all
829 829
830 bool EGLStreamCopyPictureBuffer::AllowOverlay() const { 830 bool EGLStreamCopyPictureBuffer::AllowOverlay() const {
831 return true; 831 return true;
832 } 832 }
833 833
834 bool EGLStreamCopyPictureBuffer::CanBindSamples() const { 834 bool EGLStreamCopyPictureBuffer::CanBindSamples() const {
835 return false; 835 return false;
836 } 836 }
837 837
838 } // namespace media 838 } // namespace media
OLDNEW
« no previous file with comments | « gpu/ipc/service/direct_composition_surface_win_unittest.cc ('k') | ui/gl/gl_image_dxgi.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698