From 7517b56476415d749f081ee9370fd0839971893a Mon Sep 17 00:00:00 2001 From: MediaPipe Team Date: Tue, 22 Aug 2023 09:22:42 -0700 Subject: [PATCH] No public description PiperOrigin-RevId: 559133490 --- mediapipe/gpu/gl_calculator_helper.cc | 4 ++++ mediapipe/gpu/gl_calculator_helper.h | 3 +++ 2 files changed, 7 insertions(+) diff --git a/mediapipe/gpu/gl_calculator_helper.cc b/mediapipe/gpu/gl_calculator_helper.cc index 974525a91..783f4fc87 100644 --- a/mediapipe/gpu/gl_calculator_helper.cc +++ b/mediapipe/gpu/gl_calculator_helper.cc @@ -219,6 +219,10 @@ GlTexture GlCalculatorHelper::CreateDestinationTexture( return MapGpuBuffer(gpu_buffer, gpu_buffer.GetWriteView(0)); } +GlTexture GlCalculatorHelper::CreateDestinationTexture(GpuBuffer& gpu_buffer) { + return MapGpuBuffer(gpu_buffer, gpu_buffer.GetWriteView(0)); +} + GlTexture GlCalculatorHelper::CreateSourceTexture( const mediapipe::Image& image) { return CreateSourceTexture(image.GetGpuBuffer()); diff --git a/mediapipe/gpu/gl_calculator_helper.h b/mediapipe/gpu/gl_calculator_helper.h index c1b94fa82..b6430860f 100644 --- a/mediapipe/gpu/gl_calculator_helper.h +++ b/mediapipe/gpu/gl_calculator_helper.h @@ -162,6 +162,9 @@ class GlCalculatorHelper { int output_width, int output_height, GpuBufferFormat format = GpuBufferFormat::kBGRA32); + // Allows user provided buffers to be used as rendering destinations. + GlTexture CreateDestinationTexture(GpuBuffer& buffer); + // Creates a destination texture copying and uploading passed image frame. // // WARNING: mind that this functions creates a new texture every time and