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/d3d11_h264_accelerator.h" | 5 #include "media/gpu/d3d11_h264_accelerator.h" |
6 | 6 |
7 #include <d3d11.h> | 7 #include <d3d11.h> |
8 #include <dxva.h> | 8 #include <dxva.h> |
9 #include <windows.h> | 9 #include <windows.h> |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 base::win::ScopedComPtr<ID3D11VideoDevice> video_device, | 41 base::win::ScopedComPtr<ID3D11VideoDevice> video_device, |
42 base::win::ScopedComPtr<ID3D11Texture2D> texture, | 42 base::win::ScopedComPtr<ID3D11Texture2D> texture, |
43 const GUID& decoder_guid) { | 43 const GUID& decoder_guid) { |
44 texture_ = texture; | 44 texture_ = texture; |
45 D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC view_desc = {}; | 45 D3D11_VIDEO_DECODER_OUTPUT_VIEW_DESC view_desc = {}; |
46 view_desc.DecodeProfile = decoder_guid; | 46 view_desc.DecodeProfile = decoder_guid; |
47 view_desc.ViewDimension = D3D11_VDOV_DIMENSION_TEXTURE2D; | 47 view_desc.ViewDimension = D3D11_VDOV_DIMENSION_TEXTURE2D; |
48 view_desc.Texture2D.ArraySlice = (UINT)level_; | 48 view_desc.Texture2D.ArraySlice = (UINT)level_; |
49 | 49 |
50 HRESULT hr = video_device->CreateVideoDecoderOutputView( | 50 HRESULT hr = video_device->CreateVideoDecoderOutputView( |
51 texture.Get(), &view_desc, output_view_.Receive()); | 51 texture.Get(), &view_desc, output_view_.GetAddressOf()); |
52 | 52 |
53 CHECK(SUCCEEDED(hr)); | 53 CHECK(SUCCEEDED(hr)); |
54 EGLDisplay egl_display = gl::GLSurfaceEGL::GetHardwareDisplay(); | 54 EGLDisplay egl_display = gl::GLSurfaceEGL::GetHardwareDisplay(); |
55 const EGLint stream_attributes[] = { | 55 const EGLint stream_attributes[] = { |
56 EGL_CONSUMER_LATENCY_USEC_KHR, | 56 EGL_CONSUMER_LATENCY_USEC_KHR, |
57 0, | 57 0, |
58 EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR, | 58 EGL_CONSUMER_ACQUIRE_TIMEOUT_USEC_KHR, |
59 0, | 59 0, |
60 EGL_NONE, | 60 EGL_NONE, |
61 }; | 61 }; |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 static_cast<D3D11H264Picture*>(pic.get())); | 446 static_cast<D3D11H264Picture*>(pic.get())); |
447 client_->OutputResult(our_pic->picture, our_pic->input_buffer_id_); | 447 client_->OutputResult(our_pic->picture, our_pic->input_buffer_id_); |
448 return true; | 448 return true; |
449 } | 449 } |
450 | 450 |
451 D3D11H264Picture::~D3D11H264Picture() { | 451 D3D11H264Picture::~D3D11H264Picture() { |
452 picture->set_in_picture_use(false); | 452 picture->set_in_picture_use(false); |
453 } | 453 } |
454 | 454 |
455 } // namespace media | 455 } // namespace media |
OLD | NEW |