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 // This is defined here to ensure the D3D11, D3D9, and DXVA includes through | 5 // This is defined here to ensure the D3D11, D3D9, and DXVA includes through |
6 // this header have their GUIDs intialized. | 6 // this header have their GUIDs intialized. |
7 #define INITGUID | 7 #define INITGUID |
8 #include "media/gpu/d3d11_video_decode_accelerator_win.h" | 8 #include "media/gpu/d3d11_video_decode_accelerator_win.h" |
9 #undef INITGUID | 9 #undef INITGUID |
10 | 10 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 if (FAILED(hr)) | 98 if (FAILED(hr)) |
99 CHECK(false); | 99 CHECK(false); |
100 if (dec_config.ConfigBitstreamRaw == 2) | 100 if (dec_config.ConfigBitstreamRaw == 2) |
101 break; | 101 break; |
102 } | 102 } |
103 memcpy(&decoder_guid_, &decoder_guid, sizeof decoder_guid_); | 103 memcpy(&decoder_guid_, &decoder_guid, sizeof decoder_guid_); |
104 | 104 |
105 base::win::ScopedComPtr<ID3D11VideoDecoder> video_decoder; | 105 base::win::ScopedComPtr<ID3D11VideoDecoder> video_decoder; |
106 hr = video_device_->CreateVideoDecoder(&desc, &dec_config, | 106 hr = video_device_->CreateVideoDecoder(&desc, &dec_config, |
107 video_decoder.Receive()); | 107 video_decoder.Receive()); |
108 CHECK(video_decoder.get()); | 108 CHECK(video_decoder.Get()); |
109 | 109 |
110 h264_accelerator_.reset(new D3D11H264Accelerator( | 110 h264_accelerator_.reset(new D3D11H264Accelerator( |
111 this, video_decoder, video_device_, video_context_)); | 111 this, video_decoder, video_device_, video_context_)); |
112 decoder_.reset(new media::H264Decoder(h264_accelerator_.get())); | 112 decoder_.reset(new media::H264Decoder(h264_accelerator_.get())); |
113 | 113 |
114 return true; | 114 return true; |
115 } | 115 } |
116 | 116 |
117 void D3D11VideoDecodeAccelerator::Decode( | 117 void D3D11VideoDecodeAccelerator::Decode( |
118 const BitstreamBuffer& bitstream_buffer) { | 118 const BitstreamBuffer& bitstream_buffer) { |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 } | 242 } |
243 | 243 |
244 void D3D11VideoDecodeAccelerator::OutputResult(D3D11PictureBuffer* buffer, | 244 void D3D11VideoDecodeAccelerator::OutputResult(D3D11PictureBuffer* buffer, |
245 size_t input_buffer_id) { | 245 size_t input_buffer_id) { |
246 buffer->set_in_client_use(true); | 246 buffer->set_in_client_use(true); |
247 Picture picture(buffer->picture_buffer().id(), input_buffer_id, | 247 Picture picture(buffer->picture_buffer().id(), input_buffer_id, |
248 gfx::Rect(0, 0), gfx::ColorSpace(), false); | 248 gfx::Rect(0, 0), gfx::ColorSpace(), false); |
249 client_->PictureReady(picture); | 249 client_->PictureReady(picture); |
250 } | 250 } |
251 } // namespace media | 251 } // namespace media |
OLD | NEW |