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

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

Issue 2045273005: Have VDA clients inform decoder of supported picture buffer formats (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
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 14 matching lines...) Expand all
25 #include "base/callback.h" 25 #include "base/callback.h"
26 #include "base/debug/alias.h" 26 #include "base/debug/alias.h"
27 #include "base/file_version_info.h" 27 #include "base/file_version_info.h"
28 #include "base/files/file_path.h" 28 #include "base/files/file_path.h"
29 #include "base/location.h" 29 #include "base/location.h"
30 #include "base/logging.h" 30 #include "base/logging.h"
31 #include "base/macros.h" 31 #include "base/macros.h"
32 #include "base/memory/shared_memory.h" 32 #include "base/memory/shared_memory.h"
33 #include "base/path_service.h" 33 #include "base/path_service.h"
34 #include "base/single_thread_task_runner.h" 34 #include "base/single_thread_task_runner.h"
35 #include "base/stl_util.h"
35 #include "base/threading/thread_task_runner_handle.h" 36 #include "base/threading/thread_task_runner_handle.h"
36 #include "base/trace_event/trace_event.h" 37 #include "base/trace_event/trace_event.h"
37 #include "base/win/windows_version.h" 38 #include "base/win/windows_version.h"
38 #include "build/build_config.h" 39 #include "build/build_config.h"
39 #include "gpu/command_buffer/service/gpu_preferences.h" 40 #include "gpu/command_buffer/service/gpu_preferences.h"
40 #include "media/base/win/mf_initializer.h" 41 #include "media/base/win/mf_initializer.h"
41 #include "media/gpu/dxva_picture_buffer_win.h" 42 #include "media/gpu/dxva_picture_buffer_win.h"
42 #include "media/video/video_decode_accelerator.h" 43 #include "media/video/video_decode_accelerator.h"
43 #include "third_party/angle/include/EGL/egl.h" 44 #include "third_party/angle/include/EGL/egl.h"
44 #include "third_party/angle/include/EGL/eglext.h" 45 #include "third_party/angle/include/EGL/eglext.h"
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 617
617 if (config.output_mode != Config::OutputMode::ALLOCATE) { 618 if (config.output_mode != Config::OutputMode::ALLOCATE) {
618 NOTREACHED() << "Only ALLOCATE OutputMode is supported by this VDA"; 619 NOTREACHED() << "Only ALLOCATE OutputMode is supported by this VDA";
619 return false; 620 return false;
620 } 621 }
621 622
622 client_ = client; 623 client_ = client;
623 624
624 main_thread_task_runner_ = base::ThreadTaskRunnerHandle::Get(); 625 main_thread_task_runner_ = base::ThreadTaskRunnerHandle::Get();
625 626
627 if (!ContainsValue(config.supported_output_formats, PIXEL_FORMAT_NV12))
628 share_nv12_textures_ = false;
629
626 bool profile_supported = false; 630 bool profile_supported = false;
627 for (const auto& supported_profile : kSupportedProfiles) { 631 for (const auto& supported_profile : kSupportedProfiles) {
628 if (config.profile == supported_profile) { 632 if (config.profile == supported_profile) {
629 profile_supported = true; 633 profile_supported = true;
630 break; 634 break;
631 } 635 }
632 } 636 }
633 if (!profile_supported) { 637 if (!profile_supported) {
634 RETURN_AND_NOTIFY_ON_FAILURE(false, 638 RETURN_AND_NOTIFY_ON_FAILURE(false,
635 "Unsupported h.264, vp8, or vp9 profile", 639 "Unsupported h.264, vp8, or vp9 profile",
(...skipping 2022 matching lines...) Expand 10 before | Expand all | Expand 10 after
2658 SetState(kConfigChange); 2662 SetState(kConfigChange);
2659 Invalidate(); 2663 Invalidate();
2660 Initialize(config_, client_); 2664 Initialize(config_, client_);
2661 decoder_thread_task_runner_->PostTask( 2665 decoder_thread_task_runner_->PostTask(
2662 FROM_HERE, 2666 FROM_HERE,
2663 base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers, 2667 base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers,
2664 base::Unretained(this))); 2668 base::Unretained(this)));
2665 } 2669 }
2666 2670
2667 } // namespace media 2671 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698