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

Unified Diff: content/public/renderer/video_encode_accelerator.cc

Issue 568413002: Add VEA supported profiles to GPUInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: content/public/renderer/video_encode_accelerator.cc
diff --git a/content/public/renderer/video_encode_accelerator.cc b/content/public/renderer/video_encode_accelerator.cc
index f1859c3cc59b421d1c3d0e14bceca3341d056a06..a3573e3fa8e3f8d8e169f51029dba1e21b3cb5f5 100644
--- a/content/public/renderer/video_encode_accelerator.cc
+++ b/content/public/renderer/video_encode_accelerator.cc
@@ -11,6 +11,17 @@
namespace content {
+static void GetSupportedVideoEncodeAcceleratorProfilesInternal(
+ scoped_refptr<media::GpuVideoAcceleratorFactories> gpu_factories,
+ base::WaitableEvent* waiter,
+ std::vector<media::VideoEncodeAccelerator::SupportedProfile>* profiles) {
+ scoped_ptr<media::VideoEncodeAccelerator> video_encoder =
+ gpu_factories->CreateVideoEncodeAccelerator();
+ if (video_encoder)
+ *profiles = video_encoder->GetSupportedProfiles();
+ waiter->Signal();
+}
+
void CreateVideoEncodeAccelerator(
const OnCreateVideoEncodeAcceleratorCallback& callback) {
DCHECK(!callback.is_null());
@@ -35,7 +46,18 @@ void CreateVideoEncodeAccelerator(
std::vector<media::VideoEncodeAccelerator::SupportedProfile>
GetSupportedVideoEncodeAcceleratorProfiles() {
- return GpuVideoEncodeAcceleratorHost::GetSupportedProfiles();
+ scoped_refptr<media::GpuVideoAcceleratorFactories> gpu_factories =
+ RenderThreadImpl::current()->GetGpuFactories();
+ base::WaitableEvent waiter(true, false);
+ std::vector<media::VideoEncodeAccelerator::SupportedProfile> profiles;
+ gpu_factories->GetTaskRunner()->PostTask(
+ FROM_HERE,
+ base::Bind(&GetSupportedVideoEncodeAcceleratorProfilesInternal,
+ gpu_factories,
+ &waiter,
+ &profiles));
+ waiter.Wait();
+ return profiles;
piman 2014/09/18 18:11:51 I think you want to cache this. This function is c
wuchengli 2014/09/19 14:27:24 Done.
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698