Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_video_decode_accelerator_win.h" | 5 #include "media/gpu/dxva_video_decode_accelerator_win.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #if !defined(OS_WIN) | 9 #if !defined(OS_WIN) |
| 10 #error This file should only be built on Windows. | 10 #error This file should only be built on Windows. |
| (...skipping 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1746 } | 1746 } |
| 1747 | 1747 |
| 1748 if (width != index->second->size().width() || | 1748 if (width != index->second->size().width() || |
| 1749 height != index->second->size().height()) { | 1749 height != index->second->size().height()) { |
| 1750 HandleResolutionChanged(width, height); | 1750 HandleResolutionChanged(width, height); |
| 1751 return; | 1751 return; |
| 1752 } | 1752 } |
| 1753 | 1753 |
| 1754 pending_sample->picture_buffer_id = index->second->id(); | 1754 pending_sample->picture_buffer_id = index->second->id(); |
| 1755 index->second->set_bound(); | 1755 index->second->set_bound(); |
| 1756 index->second->set_color_space(pending_sample->color_space); | 1756 if (share_nv12_textures_ || copy_nv12_textures_) { |
|
sandersd (OOO until July 31)
2016/11/03 23:31:58
Would it be possible to have the color conversion
hubbe
2016/11/04 03:49:31
Possible: Yes, Pretty: No
The copy happens on ano
sandersd (OOO until July 31)
2016/11/04 17:51:34
This really needs a comment if it's not changing.
| |
| 1757 index->second->set_color_space(pending_sample->color_space); | |
| 1758 } | |
| 1759 | |
| 1757 if (share_nv12_textures_) { | 1760 if (share_nv12_textures_) { |
| 1758 main_thread_task_runner_->PostTask( | 1761 main_thread_task_runner_->PostTask( |
| 1759 FROM_HERE, | 1762 FROM_HERE, |
| 1760 base::Bind(&DXVAVideoDecodeAccelerator::BindPictureBufferToSample, | 1763 base::Bind(&DXVAVideoDecodeAccelerator::BindPictureBufferToSample, |
| 1761 weak_ptr_, pending_sample->output_sample, | 1764 weak_ptr_, pending_sample->output_sample, |
| 1762 pending_sample->picture_buffer_id, | 1765 pending_sample->picture_buffer_id, |
| 1763 pending_sample->input_buffer_id)); | 1766 pending_sample->input_buffer_id)); |
| 1764 continue; | 1767 continue; |
| 1765 } | 1768 } |
| 1766 | 1769 |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2269 RETURN_AND_NOTIFY_ON_FAILURE(make_context_current_cb_.Run(), | 2272 RETURN_AND_NOTIFY_ON_FAILURE(make_context_current_cb_.Run(), |
| 2270 "Failed to make context current", | 2273 "Failed to make context current", |
| 2271 PLATFORM_FAILURE, ); | 2274 PLATFORM_FAILURE, ); |
| 2272 | 2275 |
| 2273 DCHECK(!output_picture_buffers_.empty()); | 2276 DCHECK(!output_picture_buffers_.empty()); |
| 2274 | 2277 |
| 2275 bool result = picture_buffer->CopySurfaceComplete(src_surface, dest_surface); | 2278 bool result = picture_buffer->CopySurfaceComplete(src_surface, dest_surface); |
| 2276 RETURN_AND_NOTIFY_ON_FAILURE(result, "Failed to complete copying surface", | 2279 RETURN_AND_NOTIFY_ON_FAILURE(result, "Failed to complete copying surface", |
| 2277 PLATFORM_FAILURE, ); | 2280 PLATFORM_FAILURE, ); |
| 2278 | 2281 |
| 2279 NotifyPictureReady(picture_buffer->id(), input_buffer_id, gfx::ColorSpace()); | 2282 NotifyPictureReady(picture_buffer->id(), input_buffer_id, |
| 2283 picture_buffer->color_space()); | |
| 2280 | 2284 |
| 2281 { | 2285 { |
| 2282 base::AutoLock lock(decoder_lock_); | 2286 base::AutoLock lock(decoder_lock_); |
| 2283 if (!pending_output_samples_.empty()) | 2287 if (!pending_output_samples_.empty()) |
| 2284 pending_output_samples_.pop_front(); | 2288 pending_output_samples_.pop_front(); |
| 2285 } | 2289 } |
| 2286 | 2290 |
| 2287 if (pending_flush_ || processing_config_changed_) { | 2291 if (pending_flush_ || processing_config_changed_) { |
| 2288 decoder_thread_task_runner_->PostTask( | 2292 decoder_thread_task_runner_->PostTask( |
| 2289 FROM_HERE, base::Bind(&DXVAVideoDecodeAccelerator::FlushInternal, | 2293 FROM_HERE, base::Bind(&DXVAVideoDecodeAccelerator::FlushInternal, |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2709 SetState(kConfigChange); | 2713 SetState(kConfigChange); |
| 2710 Invalidate(); | 2714 Invalidate(); |
| 2711 Initialize(config_, client_); | 2715 Initialize(config_, client_); |
| 2712 decoder_thread_task_runner_->PostTask( | 2716 decoder_thread_task_runner_->PostTask( |
| 2713 FROM_HERE, | 2717 FROM_HERE, |
| 2714 base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers, | 2718 base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers, |
| 2715 base::Unretained(this))); | 2719 base::Unretained(this))); |
| 2716 } | 2720 } |
| 2717 | 2721 |
| 2718 } // namespace media | 2722 } // namespace media |
| OLD | NEW |