Add ImageFrame and GlTexture view providers to Ahwb GpuBuffer storage

- ImageFrame views are backed by CPU locks of the AHWB.
- GlTextureViews are managed through a GlTextureBuffer connected to the AHWB allocation.

This improves the latency of heterogeneous access sequences, but makes `ImageFrame > ImageFrame` sequences slower due to CPU locking.

PiperOrigin-RevId: 481982546
This commit is contained in:
MediaPipe Team 2022-10-18 11:55:19 -07:00 committed by Copybara-Service
parent f2821d840d
commit 43345160c5
3 changed files with 5 additions and 0 deletions

View File

@ -378,8 +378,11 @@ cc_library(
],
}),
deps = [
":gl_texture_buffer",
":gpu_buffer_format",
":gpu_buffer_storage",
":image_frame_view",
"//mediapipe/framework/formats:image_frame",
"@com_google_absl//absl/strings:str_format",
],
)

View File

@ -65,6 +65,7 @@ class GlTextureView {
friend class GpuBuffer;
friend class GlTextureBuffer;
friend class GpuBufferStorageCvPixelBuffer;
friend class GpuBufferStorageAhwb;
GlTextureView(GlContext* context, GLenum target, GLuint name, int width,
int height, std::shared_ptr<GpuBuffer> gpu_buffer, int plane,
DetachFn detach, DoneWritingFn done_writing)

View File

@ -18,6 +18,7 @@
#include "mediapipe/framework/port/gmock.h"
#include "mediapipe/framework/port/gtest.h"
#include "mediapipe/framework/tool/test_util.h"
#include "mediapipe/gpu/gpu_buffer_storage_ahwb.h"
#include "mediapipe/gpu/gpu_buffer_storage_image_frame.h"
#include "mediapipe/gpu/gpu_test_base.h"
#include "stb_image.h"