Project import generated by Copybara.

GitOrigin-RevId: 17113e259b160929c49262e7aa78ac22d228f9fc
This commit is contained in:
MediaPipe Team 2022-03-22 17:24:21 -07:00 committed by jqtang
parent cc6a2f7af6
commit c6c80c3745
4 changed files with 6 additions and 2 deletions

View File

@ -15,4 +15,4 @@
# A list of assignees
assignees:
- sgowroji
- sureshdagooglecom

View File

@ -61,7 +61,7 @@ constexpr auto tag_build(S) {
#define MPP_TAG(s) \
([] { \
struct S { \
const const_str tag{s}; \
const ::mediapipe::api2::const_str tag{s}; \
}; \
return ::mediapipe::api2::internal::tag_build(S()); \
}())

View File

@ -74,6 +74,7 @@ class GpuBuffer {
storages_.push_back(std::move(storage));
}
#if !MEDIAPIPE_DISABLE_GPU && MEDIAPIPE_GPU_BUFFER_USE_CV_PIXEL_BUFFER
// This is used to support backward-compatible construction of GpuBuffer from
// some platform-specific types without having to make those types visible in
// this header.
@ -81,6 +82,7 @@ class GpuBuffer {
std::declval<T>()))>>
explicit GpuBuffer(T&& storage_convertible)
: GpuBuffer(internal::AsGpuBufferStorage(storage_convertible)) {}
#endif // !MEDIAPIPE_DISABLE_GPU && MEDIAPIPE_GPU_BUFFER_USE_CV_PIXEL_BUFFER
int width() const { return current_storage().width(); }
int height() const { return current_storage().height(); }

View File

@ -189,11 +189,13 @@ class GpuBufferStorageImpl : public GpuBufferStorage, public U... {
using RequireStatics = ForceStaticInstantiation<&registration>;
};
#if !MEDIAPIPE_DISABLE_GPU && MEDIAPIPE_GPU_BUFFER_USE_CV_PIXEL_BUFFER
// This function can be overridden to enable construction of a GpuBuffer from
// platform-specific types without having to expose that type in the GpuBuffer
// definition. It is only needed for backward compatibility reasons; do not add
// overrides for new types.
std::shared_ptr<internal::GpuBufferStorage> AsGpuBufferStorage();
#endif // !MEDIAPIPE_DISABLE_GPU && MEDIAPIPE_GPU_BUFFER_USE_CV_PIXEL_BUFFER
} // namespace internal
} // namespace mediapipe