| 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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 } | 363 } |
| 364 | 364 |
| 365 EGLDisplay egl_display = gl::GLSurfaceEGL::GetHardwareDisplay(); | 365 EGLDisplay egl_display = gl::GLSurfaceEGL::GetHardwareDisplay(); |
| 366 eglBindTexImage(egl_display, decoding_surface_, EGL_BACK_BUFFER); | 366 eglBindTexImage(egl_display, decoding_surface_, EGL_BACK_BUFFER); |
| 367 | 367 |
| 368 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); | 368 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); |
| 369 glBindTexture(GL_TEXTURE_2D, current_texture); | 369 glBindTexture(GL_TEXTURE_2D, current_texture); |
| 370 return true; | 370 return true; |
| 371 } | 371 } |
| 372 | 372 |
| 373 bool PbufferPictureBuffer::AllowOverlay() const { |
| 374 return false; |
| 375 } |
| 376 |
| 373 PbufferPictureBuffer::PbufferPictureBuffer(const PictureBuffer& buffer) | 377 PbufferPictureBuffer::PbufferPictureBuffer(const PictureBuffer& buffer) |
| 374 : DXVAPictureBuffer(buffer), | 378 : DXVAPictureBuffer(buffer), |
| 375 decoding_surface_(NULL), | 379 decoding_surface_(NULL), |
| 376 texture_share_handle_(nullptr), | 380 texture_share_handle_(nullptr), |
| 377 keyed_mutex_value_(0), | 381 keyed_mutex_value_(0), |
| 378 use_rgb_(true) {} | 382 use_rgb_(true) {} |
| 379 | 383 |
| 380 PbufferPictureBuffer::~PbufferPictureBuffer() { | 384 PbufferPictureBuffer::~PbufferPictureBuffer() { |
| 381 // decoding_surface_ will be deleted by gl_image_. | 385 // decoding_surface_ will be deleted by gl_image_. |
| 382 } | 386 } |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 result = eglStreamConsumerAcquireKHR(egl_display, stream_); | 505 result = eglStreamConsumerAcquireKHR(egl_display, stream_); |
| 502 RETURN_ON_FAILURE(result, "Could not post acquire stream", false); | 506 RETURN_ON_FAILURE(result, "Could not post acquire stream", false); |
| 503 gl::GLImageDXGI* gl_image_dxgi = | 507 gl::GLImageDXGI* gl_image_dxgi = |
| 504 gl::GLImageDXGI::FromGLImage(gl_image_.get()); | 508 gl::GLImageDXGI::FromGLImage(gl_image_.get()); |
| 505 DCHECK(gl_image_dxgi); | 509 DCHECK(gl_image_dxgi); |
| 506 | 510 |
| 507 gl_image_dxgi->SetTexture(dx11_decoding_texture_, subresource); | 511 gl_image_dxgi->SetTexture(dx11_decoding_texture_, subresource); |
| 508 return true; | 512 return true; |
| 509 } | 513 } |
| 510 | 514 |
| 515 bool EGLStreamPictureBuffer::AllowOverlay() const { |
| 516 return true; |
| 517 } |
| 518 |
| 511 EGLStreamCopyPictureBuffer::EGLStreamCopyPictureBuffer( | 519 EGLStreamCopyPictureBuffer::EGLStreamCopyPictureBuffer( |
| 512 const PictureBuffer& buffer) | 520 const PictureBuffer& buffer) |
| 513 : DXVAPictureBuffer(buffer), stream_(nullptr) {} | 521 : DXVAPictureBuffer(buffer), stream_(nullptr) {} |
| 514 | 522 |
| 515 EGLStreamCopyPictureBuffer::~EGLStreamCopyPictureBuffer() { | 523 EGLStreamCopyPictureBuffer::~EGLStreamCopyPictureBuffer() { |
| 516 // stream_ will be deleted by gl_image_. | 524 // stream_ will be deleted by gl_image_. |
| 517 } | 525 } |
| 518 | 526 |
| 519 bool EGLStreamCopyPictureBuffer::Initialize( | 527 bool EGLStreamCopyPictureBuffer::Initialize( |
| 520 const DXVAVideoDecodeAccelerator& decoder) { | 528 const DXVAVideoDecodeAccelerator& decoder) { |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 } | 672 } |
| 665 state_ = UNUSED; | 673 state_ = UNUSED; |
| 666 | 674 |
| 667 if (stream_) { | 675 if (stream_) { |
| 668 EGLBoolean result = eglStreamConsumerReleaseKHR(egl_display, stream_); | 676 EGLBoolean result = eglStreamConsumerReleaseKHR(egl_display, stream_); |
| 669 RETURN_ON_FAILURE(result, "Could not release stream", false); | 677 RETURN_ON_FAILURE(result, "Could not release stream", false); |
| 670 } | 678 } |
| 671 return true; | 679 return true; |
| 672 } | 680 } |
| 673 | 681 |
| 682 bool EGLStreamCopyPictureBuffer::AllowOverlay() const { |
| 683 return true; |
| 684 } |
| 685 |
| 674 } // namespace media | 686 } // namespace media |
| OLD | NEW |