Allow conversion of GlTextureBuffer to CVPixelBufferRef

This means that, if an iOS application sends in a GlTextureBuffer but expects a CVPixelBufferRef as output, everything will work even if the graph just forwards the same input. Also, access by Metal calculators will also work transparently.

PiperOrigin-RevId: 488812748
This commit is contained in:
Camillo Lugaresi
2022-11-15 18:36:45 -08:00
committed by Copybara-Service
parent fe66de3714
commit 4c874fe4cd
2 changed files with 55 additions and 1 deletions
+26 -1
View File
@@ -226,7 +226,13 @@ cc_library(
# depend on having an indirect image_frame dependency, need to be
# fixed first.
"//mediapipe/framework/formats:image_frame",
],
] + select({
"//conditions:default": [],
":platform_ios_with_gpu": [
":gl_texture_util",
":gpu_buffer_storage_cv_pixel_buffer",
],
}),
)
cc_library(
@@ -344,6 +350,25 @@ cc_library(
],
)
mediapipe_cc_test(
name = "gpu_buffer_storage_cv_pixel_buffer_test",
size = "small",
timeout = "moderate",
srcs = ["gpu_buffer_storage_cv_pixel_buffer_test.cc"],
platforms = ["ios"],
deps = [
":gl_texture_buffer",
":gl_texture_util",
":gpu_buffer",
":gpu_buffer_storage_cv_pixel_buffer",
":gpu_test_base",
"//mediapipe/framework/port:gtest_main",
"//mediapipe/framework/tool:test_util",
"//mediapipe/objc:util",
"@com_google_absl//absl/strings",
],
)
cc_library(
name = "cv_texture_cache_manager",
srcs = ["cv_texture_cache_manager.cc"],