Commit Graph
92 Commits
Author SHA1 Message Date
MediaPipe TeamandCopybara-Service a7bd725e65 Internal change
PiperOrigin-RevId: 489331826
2022-11-17 16:09:15 -08:00
Camillo LugaresiandCopybara-Service 6fc277ee1c Internal change
PiperOrigin-RevId: 489091534
2022-11-16 18:38:03 -08:00
Camillo LugaresiandCopybara-Service febfc2029b Annotate plane argument
PiperOrigin-RevId: 488813363
2022-11-15 18:53:09 -08:00
Camillo LugaresiandCopybara-Service 63e2089639 Deprecate a bunch of old stuff in GlCalculatorHelper
PiperOrigin-RevId: 488813296
2022-11-15 18:51:56 -08:00
Camillo LugaresiandCopybara-Service 1979801a92 Remove GlCalculatorHelperImpl; merge with GlCalculatorHelper
Originally, there were multiple implementations of GlCalculatorHelperImpl, depending on the platform and underlying GL APIs. These have all been refactored into other components, and the remaining code in this class is unified and much reduced in size. We can get rid of this implementation detail now.

PiperOrigin-RevId: 488813220
2022-11-15 18:50:45 -08:00
Camillo LugaresiandCopybara-Service 8b319e963a Add comment explaining ViewProvider
This was only documented via examples (e.g. ViewProvider<GlTextureView>), but it's better to explain it properly in the header where the base case is defined.

PiperOrigin-RevId: 488813144
2022-11-15 18:48:54 -08:00
Camillo LugaresiandCopybara-Service a28ccb0964 Remove unnecessary forward declarations
PiperOrigin-RevId: 488813066
2022-11-15 18:43:36 -08:00
Camillo LugaresiandCopybara-Service 13b4b825d7 Remove std::shared_ptr<GpuBuffer> argument from GetRead/WriteView
PiperOrigin-RevId: 488813004
2022-11-15 18:41:53 -08:00
Camillo LugaresiandCopybara-Service 1c0a1d0aab Remove shared_ptr<GpuBuffer> member from GlTextureView
This only exists to support GlTexture's GetFrame API. It can be moved into GlTexture.

PiperOrigin-RevId: 488812896
2022-11-15 18:40:15 -08:00
Camillo LugaresiandCopybara-Service 767cc2ee3c More comments on gpu_buffer_storage
This gives a basic explanation of the role of storages and views, and provides some details on how to implement a new storage type.

PiperOrigin-RevId: 488812807
2022-11-15 18:38:29 -08:00
Camillo LugaresiandCopybara-Service 4c874fe4cd 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
2022-11-15 18:36:45 -08:00
Camillo LugaresiandCopybara-Service fe66de3714 Internal change
PiperOrigin-RevId: 488812677
2022-11-15 18:32:54 -08:00
Camillo LugaresiandCopybara-Service b308c0dd5e Implement CVPixelBufferRef access as a view.
PiperOrigin-RevId: 488798216
2022-11-15 17:18:07 -08:00
Camillo LugaresiandCopybara-Service 4bda012bba Factor out gl_texture_util
PiperOrigin-RevId: 488797985
2022-11-15 17:13:22 -08:00
Camillo LugaresiandCopybara-Service 77b3edbb67 Internal change
PiperOrigin-RevId: 488797407
2022-11-15 17:09:43 -08:00
Camillo LugaresiandCopybara-Service 7e19bbe35c Internal change
PiperOrigin-RevId: 488795920
2022-11-15 17:01:33 -08:00
Camillo LugaresiandCopybara-Service 1beca61650 Register GlTextureBuffer pool with GpuBuffer
First crack at hooking up pools with the GpuBufferStorage system. Will most likely be superseded later, but for now this works with minimal code impact: just overwrite the factory for a storage type with one that uses the pool.

PiperOrigin-RevId: 488783854
2022-11-15 16:19:48 -08:00
Camillo LugaresiandCopybara-Service 583d27636b Factor out ReusablePool
PiperOrigin-RevId: 488783477
2022-11-15 16:18:20 -08:00
Camillo LugaresiandCopybara-Service 53d015af08 Generic MultiPool template
PiperOrigin-RevId: 488783176
2022-11-15 16:15:42 -08:00
Camillo LugaresiandCopybara-Service b9fa2e3496 Make it possible to override the SimplePool factory used by MultiPool
This means MultiPool no longer needs a SetFlushPlatformCaches method, which was too specific to the CVPixelBufferPool.

PiperOrigin-RevId: 488783003
2022-11-15 16:14:27 -08:00
Camillo LugaresiandCopybara-Service 267476657d MultiPool options header refactoring
Passing MultiPool options to the base pool factories means that we don't have to specialize which options we pass to them.

PiperOrigin-RevId: 488782861
2022-11-15 16:13:05 -08:00
Camillo LugaresiandCopybara-Service 7ef3185ecb Allow customizing MultiPool options
These don't need to be constants.

PiperOrigin-RevId: 488782713
2022-11-15 16:11:54 -08:00
Camillo LugaresiandCopybara-Service f13903b7c5 Call SimplePool methods directly
This removes redundant helper functions in GpuBufferMultiPool.

PiperOrigin-RevId: 488782516
2022-11-15 16:10:34 -08:00
Camillo LugaresiandCopybara-Service 0c4522cb9f Move flush hook to CvPixelBufferPoolWrapper constructor
This unifies the implementation of GpuBufferMultiPool::GetBufferFromSimplePool.

PiperOrigin-RevId: 488782173
2022-11-15 16:07:17 -08:00
Camillo LugaresiandCopybara-Service a4fe3eb094 Add CreateBufferWithoutPool method to base pools
This may not fit exactly in a pool class, but it makes it easy for the multi-pool to find the appropriate method by depending only on the type of the base pool. For the CVPixelBuffer case, the buffer type is CFHolder<CVPixelBufferRef>, and it seems even less appropriate to specialize that template to add such a method there. An alternative would be to allow defining a creation function separately.

PiperOrigin-RevId: 488782054
2022-11-15 16:05:53 -08:00
Camillo LugaresiandCopybara-Service 0d273dd11a Factor out CvPixelBufferPoolWrapper
This is platform-specific and does not need to live in the main multi_pool sources.

PiperOrigin-RevId: 488781934
2022-11-15 16:04:27 -08:00
Camillo LugaresiandCopybara-Service ab2dd779e7 Factor out CvTextureCacheManager
This is a platform-specific component that is only used with CVPixelBufferPool.

PiperOrigin-RevId: 488781757
2022-11-15 16:02:53 -08:00
Camillo LugaresiandCopybara-Service a520d6cc38 Remove FORCE_CONTIGUOUS_PIXEL_BUFFER_ON_IPHONE_SIMULATOR
This workaround code is no longer necessary, as per the comment.

PiperOrigin-RevId: 488777606
2022-11-15 15:41:53 -08:00
Camillo LugaresiandCopybara-Service 3c71c64be1 Remove shared_ptr from SimplePool definition
This makes the types more explicit and will help with factoring out platform-specific code.

PiperOrigin-RevId: 488775470
2022-11-15 15:32:57 -08:00
MediaPipe TeamandCopybara-Service ec327cedcb Internal Changes
PiperOrigin-RevId: 487673720
2022-11-10 16:48:13 -08:00
Camillo LugaresiandCopybara-Service 1a151d9ffb Internal change
PiperOrigin-RevId: 486792117
2022-11-07 16:21:15 -08:00
MediaPipe TeamandCopybara-Service 6b0a7fb281 Reverting back to special handling for Egl Thread Exit on Android
PiperOrigin-RevId: 483505151
2022-10-24 15:45:35 -07:00
MediaPipe TeamandCopybara-Service e86cd39521 Use unused pixel format attribute variable as intended
Based on the comments and the context, we should be trying to use the specified attributes in orders to initialize the pixel_format_ variable.

PiperOrigin-RevId: 482011065
2022-10-18 13:51:24 -07:00
MediaPipe TeamandCopybara-Service 43345160c5 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
2022-10-18 11:59:29 -07:00
Camillo LugaresiandCopybara-Service a5e4219590 Internal change
PiperOrigin-RevId: 481742662
2022-10-17 14:39:17 -07:00
MediaPipe TeamandCopybara-Service f6c2f86086 Fix -Wunused-variable warnings
Remove unused variables. Add __unused attribute to variable used in assert clause. Move variable to inside header guard when only used in header guard.

PiperOrigin-RevId: 481699164
2022-10-17 11:48:17 -07:00
Camillo LugaresiandCopybara-Service 364b8e8106 Internal change
PiperOrigin-RevId: 481210917
2022-10-14 12:47:48 -07:00
MediaPipe TeamandCopybara-Service db524adf0d Internal change
PiperOrigin-RevId: 479450607
2022-10-06 17:22:01 -07:00
Jiuqiang TangandSebastian Schmidt 133c3b3c00 Internal change
PiperOrigin-RevId: 477887963
2022-09-30 15:43:01 +00:00
MediaPipe TeamandSebastian Schmidt f8af41b1eb Internal change
PiperOrigin-RevId: 477538515
2022-09-28 21:32:36 +00:00
MediaPipe TeamandSebastian Schmidt 4dc4b19ddb Project import generated by Copybara.
GitOrigin-RevId: 1e13be30e2c6838d4a2ff768a39c414bc80534bb
2022-09-06 21:46:17 +00:00
MediaPipe TeamandSebastian Schmidt c688862570 Project import generated by Copybara.
GitOrigin-RevId: 6e5aa035cd1f6a9333962df5d3ab97a05bd5744e
2022-06-28 12:11:05 +00:00
MediaPipe Teamandjqtang 4a20e9909d Project import generated by Copybara.
GitOrigin-RevId: b66251317fbebfbb8e1f2ddc64ea5da84bceb7e5
2022-05-06 17:05:30 -07:00
MediaPipe Teamandschmidt-sebastian 7fb37c80e8 Project import generated by Copybara.
GitOrigin-RevId: 19a829ffd755edb43e54d20c0e7b9348512d5108
2022-05-05 19:57:20 +00:00
MediaPipe Teamandjqtang c6c80c3745 Project import generated by Copybara.
GitOrigin-RevId: 17113e259b160929c49262e7aa78ac22d228f9fc
2022-03-22 17:48:17 -07:00
MediaPipe Teamandjqtang cc6a2f7af6 Project import generated by Copybara.
GitOrigin-RevId: 73d686c40057684f8bfaca285368bf1813f9fc26
2022-03-21 12:12:39 -07:00
MediaPipe Teamandjqtang e6c19885c6 Project import generated by Copybara.
GitOrigin-RevId: bb059a0721c92e8154d33ce8057b3915a25b3d7d
2021-12-13 15:56:02 -08:00
MediaPipe Teamandjqtang d4bb35fe5a Project import generated by Copybara.
GitOrigin-RevId: d4a11282d20fe4d2e137f9032cf349750030dcb9
2021-11-03 17:27:30 -07:00
MediaPipe Teamandchuoling 1faeaae7e5 Project import generated by Copybara.
GitOrigin-RevId: bbbbcb4f5174dea33525729ede47c770069157cd
2021-10-18 17:00:29 -04:00
MediaPipe Teamandjqtang 33d683c671 Project import generated by Copybara.
GitOrigin-RevId: 373e3ac1e5839befd95bf7d73ceff3c5f1171969
2021-10-06 14:27:49 -07:00