Project import generated by Copybara.

GitOrigin-RevId: 852dfb05d450167899c0dd5ef7c45622a12e865b
This commit is contained in:
MediaPipe Team
2020-02-10 14:13:25 -08:00
committed by Hadon Nash
parent d144e564d8
commit de4fbc10e6
100 changed files with 1664 additions and 628 deletions
+1
View File
@@ -920,6 +920,7 @@ objc_library(
ios_unit_test(
name = "gl_ios_test",
minimum_os_version = MIN_IOS_VERSION,
runner = "//googlemac/iPhone/Shared/Testing/EarlGrey/Runner:IOS_LATEST",
tags = [
"ios",
],
+2 -2
View File
@@ -29,9 +29,9 @@ struct EglSurfaceHolder {
// GlCalculatorHelper::RunInGlContext while holding this mutex, but instead
// grab this inside the callable passed to them.
absl::Mutex mutex;
EGLSurface surface GUARDED_BY(mutex) = EGL_NO_SURFACE;
EGLSurface surface ABSL_GUARDED_BY(mutex) = EGL_NO_SURFACE;
// True if MediaPipe created the surface and is responsible for destroying it.
bool owned GUARDED_BY(mutex) = false;
bool owned ABSL_GUARDED_BY(mutex) = false;
// Vertical flip of the surface, useful for conversion between coordinate
// systems with top-left v.s. bottom-left origins.
bool flip_y = false;
+1 -1
View File
@@ -346,7 +346,7 @@ std::weak_ptr<GlContext>& GlContext::CurrentContext() {
::mediapipe::Status GlContext::SwitchContext(ContextBinding* saved_context,
const ContextBinding& new_context)
NO_THREAD_SAFETY_ANALYSIS {
ABSL_NO_THREAD_SAFETY_ANALYSIS {
std::shared_ptr<GlContext> old_context_obj = CurrentContext().lock();
std::shared_ptr<GlContext> new_context_obj =
new_context.context_object.lock();
+1 -1
View File
@@ -379,7 +379,7 @@ class GlContext : public std::enable_shared_from_this<GlContext> {
// This mutex is used to guard a few different members and condition
// variables. It should only be held for a short time.
absl::Mutex mutex_;
absl::CondVar wait_for_gl_finish_cv_ GUARDED_BY(mutex_);
absl::CondVar wait_for_gl_finish_cv_ ABSL_GUARDED_BY(mutex_);
std::unique_ptr<mediapipe::GlProfilingHelper> profiling_helper_ = nullptr;
};
+3 -3
View File
@@ -52,11 +52,11 @@ class GlContext::DedicatedThread {
absl::Mutex mutex_;
// Used to wait for a job's completion.
absl::CondVar gl_job_done_cv_ GUARDED_BY(mutex_);
absl::CondVar gl_job_done_cv_ ABSL_GUARDED_BY(mutex_);
pthread_t gl_thread_id_;
std::deque<Job> jobs_ GUARDED_BY(mutex_);
absl::CondVar has_jobs_cv_ GUARDED_BY(mutex_);
std::deque<Job> jobs_ ABSL_GUARDED_BY(mutex_);
absl::CondVar has_jobs_cv_ ABSL_GUARDED_BY(mutex_);
bool self_destruct_ = false;
};
+4 -3
View File
@@ -60,7 +60,7 @@ class GlTextureBufferPool
// If the total number of buffers is greater than keep_count, destroys any
// surplus buffers that are no longer in use.
void TrimAvailable() EXCLUSIVE_LOCKS_REQUIRED(mutex_);
void TrimAvailable() ABSL_EXCLUSIVE_LOCKS_REQUIRED(mutex_);
const int width_;
const int height_;
@@ -68,8 +68,9 @@ class GlTextureBufferPool
const int keep_count_;
absl::Mutex mutex_;
int in_use_count_ GUARDED_BY(mutex_) = 0;
std::vector<std::unique_ptr<GlTextureBuffer>> available_ GUARDED_BY(mutex_);
int in_use_count_ ABSL_GUARDED_BY(mutex_) = 0;
std::vector<std::unique_ptr<GlTextureBuffer>> available_
ABSL_GUARDED_BY(mutex_);
};
} // namespace mediapipe
+1 -1
View File
@@ -61,7 +61,7 @@ class GlThreadCollector {
}
absl::Mutex mutex_;
int active_threads_ GUARDED_BY(mutex_) = 0;
int active_threads_ ABSL_GUARDED_BY(mutex_) = 0;
friend NoDestructor<GlThreadCollector>;
};
#else
+1 -1
View File
@@ -107,7 +107,7 @@ class GpuBufferMultiPool {
absl::Mutex mutex_;
std::unordered_map<BufferSpec, SimplePool, BufferSpecHash> pools_
GUARDED_BY(mutex_);
ABSL_GUARDED_BY(mutex_);
// A queue of BufferSpecs to keep track of the age of each BufferSpec added to
// the pool.
std::queue<BufferSpec> buffer_specs_;