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

Unified Diff: chrome/gpu/arc_gpu_video_decode_accelerator.h

Issue 2036723002: Limit the number of ARC codec (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address dcheng's comments: static_assert 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/gpu/arc_gpu_video_decode_accelerator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/gpu/arc_gpu_video_decode_accelerator.h
diff --git a/chrome/gpu/arc_gpu_video_decode_accelerator.h b/chrome/gpu/arc_gpu_video_decode_accelerator.h
index 5685f56e57136381ba1d81dd38b568a7b78f13d8..df1458d9dc53454bf71ba3ca0833c1e094f9e7a7 100644
--- a/chrome/gpu/arc_gpu_video_decode_accelerator.h
+++ b/chrome/gpu/arc_gpu_video_decode_accelerator.h
@@ -32,8 +32,9 @@ class ArcGpuVideoDecodeAccelerator
~ArcGpuVideoDecodeAccelerator() override;
// Implementation of the ArcVideoAccelerator interface.
- bool Initialize(const Config& config,
- ArcVideoAccelerator::Client* client) override;
+ ArcVideoAccelerator::Result Initialize(
+ const Config& config,
+ ArcVideoAccelerator::Client* client) override;
void SetNumberOfOutputBuffers(size_t number) override;
void BindSharedMemory(PortType port,
uint32_t index,
@@ -119,6 +120,12 @@ class ArcGpuVideoDecodeAccelerator
// Returns |nullptr| if it cannot be found.
InputRecord* FindInputRecord(int32_t bitstream_buffer_id);
+ // Global counter that keeps track the number of active clients (i.e., how
+ // many VDAs in use by this class).
+ // Since this class only works on the same thread, it's safe to access
+ // |client_count_| without lock.
+ static int client_count_;
+
std::unique_ptr<media::VideoDecodeAccelerator> vda_;
// It's safe to use the pointer here, the life cycle of the |arc_client_|
« no previous file with comments | « no previous file | chrome/gpu/arc_gpu_video_decode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698