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

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

Issue 2752143002: [dxvavda] Mark NV12 textures as allowing overlays. (Closed)
Patch Set: Created 3 years, 9 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 | « media/gpu/dxva_video_decode_accelerator_win.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2071 matching lines...) Expand 10 before | Expand all | Expand 10 after
2082 kNumPictureBuffers, 2082 kNumPictureBuffers,
2083 provide_nv12_textures ? PIXEL_FORMAT_NV12 : PIXEL_FORMAT_UNKNOWN, 2083 provide_nv12_textures ? PIXEL_FORMAT_NV12 : PIXEL_FORMAT_UNKNOWN,
2084 provide_nv12_textures ? 2 : 1, gfx::Size(width, height), 2084 provide_nv12_textures ? 2 : 1, gfx::Size(width, height),
2085 GetTextureTarget()); 2085 GetTextureTarget());
2086 } 2086 }
2087 } 2087 }
2088 2088
2089 void DXVAVideoDecodeAccelerator::NotifyPictureReady( 2089 void DXVAVideoDecodeAccelerator::NotifyPictureReady(
2090 int picture_buffer_id, 2090 int picture_buffer_id,
2091 int input_buffer_id, 2091 int input_buffer_id,
2092 const gfx::ColorSpace& color_space) { 2092 const gfx::ColorSpace& color_space,
2093 bool allow_overlay) {
2093 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); 2094 DCHECK(main_thread_task_runner_->BelongsToCurrentThread());
2094 // This task could execute after the decoder has been torn down. 2095 // This task could execute after the decoder has been torn down.
2095 if (GetState() != kUninitialized && client_) { 2096 if (GetState() != kUninitialized && client_) {
2096 // TODO(henryhsu): Use correct visible size instead of (0, 0). We can't use 2097 // TODO(henryhsu): Use correct visible size instead of (0, 0). We can't use
2097 // coded size here so use (0, 0) intentionally to have the client choose. 2098 // coded size here so use (0, 0) intentionally to have the client choose.
2098 Picture picture(picture_buffer_id, input_buffer_id, gfx::Rect(0, 0), 2099 Picture picture(picture_buffer_id, input_buffer_id, gfx::Rect(0, 0),
2099 color_space, false); 2100 color_space, allow_overlay);
2100 client_->PictureReady(picture); 2101 client_->PictureReady(picture);
2101 } 2102 }
2102 } 2103 }
2103 2104
2104 void DXVAVideoDecodeAccelerator::NotifyInputBuffersDropped( 2105 void DXVAVideoDecodeAccelerator::NotifyInputBuffersDropped(
2105 const PendingInputs& pending_buffers) { 2106 const PendingInputs& pending_buffers) {
2106 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); 2107 DCHECK(main_thread_task_runner_->BelongsToCurrentThread());
2107 if (!client_) 2108 if (!client_)
2108 return; 2109 return;
2109 2110
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
2500 "Failed to make context current", 2501 "Failed to make context current",
2501 PLATFORM_FAILURE, ); 2502 PLATFORM_FAILURE, );
2502 2503
2503 DCHECK(!output_picture_buffers_.empty()); 2504 DCHECK(!output_picture_buffers_.empty());
2504 2505
2505 bool result = picture_buffer->CopySurfaceComplete(src_surface, dest_surface); 2506 bool result = picture_buffer->CopySurfaceComplete(src_surface, dest_surface);
2506 RETURN_AND_NOTIFY_ON_FAILURE(result, "Failed to complete copying surface", 2507 RETURN_AND_NOTIFY_ON_FAILURE(result, "Failed to complete copying surface",
2507 PLATFORM_FAILURE, ); 2508 PLATFORM_FAILURE, );
2508 2509
2509 NotifyPictureReady(picture_buffer->id(), input_buffer_id, 2510 NotifyPictureReady(picture_buffer->id(), input_buffer_id,
2510 picture_buffer->color_space()); 2511 picture_buffer->color_space(),
2512 picture_buffer->AllowOverlay());
2511 2513
2512 { 2514 {
2513 base::AutoLock lock(decoder_lock_); 2515 base::AutoLock lock(decoder_lock_);
2514 if (!pending_output_samples_.empty()) 2516 if (!pending_output_samples_.empty())
2515 pending_output_samples_.pop_front(); 2517 pending_output_samples_.pop_front();
2516 } 2518 }
2517 2519
2518 if (pending_flush_ || processing_config_changed_) { 2520 if (pending_flush_ || processing_config_changed_) {
2519 decoder_thread_task_runner_->PostTask( 2521 decoder_thread_task_runner_->PostTask(
2520 FROM_HERE, base::Bind(&DXVAVideoDecodeAccelerator::FlushInternal, 2522 FROM_HERE, base::Bind(&DXVAVideoDecodeAccelerator::FlushInternal,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
2553 "Failed to make context current", 2555 "Failed to make context current",
2554 PLATFORM_FAILURE, ); 2556 PLATFORM_FAILURE, );
2555 2557
2556 DCHECK(!output_picture_buffers_.empty()); 2558 DCHECK(!output_picture_buffers_.empty());
2557 2559
2558 bool result = picture_buffer->BindSampleToTexture(sample); 2560 bool result = picture_buffer->BindSampleToTexture(sample);
2559 RETURN_AND_NOTIFY_ON_FAILURE(result, "Failed to complete copying surface", 2561 RETURN_AND_NOTIFY_ON_FAILURE(result, "Failed to complete copying surface",
2560 PLATFORM_FAILURE, ); 2562 PLATFORM_FAILURE, );
2561 2563
2562 NotifyPictureReady(picture_buffer->id(), input_buffer_id, 2564 NotifyPictureReady(picture_buffer->id(), input_buffer_id,
2563 picture_buffer->color_space()); 2565 picture_buffer->color_space(),
2566 picture_buffer->AllowOverlay());
2564 2567
2565 { 2568 {
2566 base::AutoLock lock(decoder_lock_); 2569 base::AutoLock lock(decoder_lock_);
2567 if (!pending_output_samples_.empty()) 2570 if (!pending_output_samples_.empty())
2568 pending_output_samples_.pop_front(); 2571 pending_output_samples_.pop_front();
2569 } 2572 }
2570 2573
2571 if (pending_flush_ || processing_config_changed_) { 2574 if (pending_flush_ || processing_config_changed_) {
2572 decoder_thread_task_runner_->PostTask( 2575 decoder_thread_task_runner_->PostTask(
2573 FROM_HERE, base::Bind(&DXVAVideoDecodeAccelerator::FlushInternal, 2576 FROM_HERE, base::Bind(&DXVAVideoDecodeAccelerator::FlushInternal,
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
2954 base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers, 2957 base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers,
2955 base::Unretained(this))); 2958 base::Unretained(this)));
2956 } 2959 }
2957 2960
2958 uint32_t DXVAVideoDecodeAccelerator::GetTextureTarget() const { 2961 uint32_t DXVAVideoDecodeAccelerator::GetTextureTarget() const {
2959 bool provide_nv12_textures = share_nv12_textures_ || copy_nv12_textures_; 2962 bool provide_nv12_textures = share_nv12_textures_ || copy_nv12_textures_;
2960 return provide_nv12_textures ? GL_TEXTURE_EXTERNAL_OES : GL_TEXTURE_2D; 2963 return provide_nv12_textures ? GL_TEXTURE_EXTERNAL_OES : GL_TEXTURE_2D;
2961 } 2964 }
2962 2965
2963 } // namespace media 2966 } // namespace media
OLDNEW
« no previous file with comments | « media/gpu/dxva_video_decode_accelerator_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698