Add notes/warnings for calculators which use dedicated GL contexts.
PiperOrigin-RevId: 563167765
This commit is contained in:
		
							parent
							
								
									e58ec2d039
								
							
						
					
					
						commit
						b40b3973fb
					
				| 
						 | 
				
			
			@ -40,6 +40,10 @@ enum { kAttribVertex, kAttribTexturePosition, kNumberOfAttributes };
 | 
			
		|||
//   SURFACE: unique_ptr to an EglSurfaceHolder to draw to.
 | 
			
		||||
//
 | 
			
		||||
// See GlSurfaceSinkCalculatorOptions for options.
 | 
			
		||||
//
 | 
			
		||||
// NOTE: all GlSurfaceSinkCalculators use a common dedicated shared GL context
 | 
			
		||||
// thread by default, which is different from the main GL context thread used by
 | 
			
		||||
// the graph. (If MediaPipe uses multithreading and multiple OpenGL contexts.)
 | 
			
		||||
class GlSurfaceSinkCalculator : public Node {
 | 
			
		||||
 public:
 | 
			
		||||
  static constexpr Input<
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -27,6 +27,22 @@
 | 
			
		|||
namespace mediapipe {
 | 
			
		||||
 | 
			
		||||
// Convert an input image (GpuBuffer or ImageFrame) to ImageFrame.
 | 
			
		||||
//
 | 
			
		||||
// NOTE: all GpuBufferToImageFrameCalculators use a common dedicated shared GL
 | 
			
		||||
// context thread by default, which is different from the main GL context thread
 | 
			
		||||
// used by the graph. (If MediaPipe uses multithreading and multiple OpenGL
 | 
			
		||||
// contexts.)
 | 
			
		||||
//
 | 
			
		||||
// IMPORTANT: graph writer must make sure input GpuBuffer backed OpenGL texture
 | 
			
		||||
// is not in use before the calculator starts processing and not used by any
 | 
			
		||||
// other code until the calculator returns:
 | 
			
		||||
// - pixel transfer involves attaching GpuBuffer backing texture as a logical
 | 
			
		||||
//   buffer to a particular bound framebuffer.
 | 
			
		||||
// - and if texture is already bound and enabled for texturing, this may lead
 | 
			
		||||
//   to a "feedback loop" and undefined results.
 | 
			
		||||
// See, OpenGL ES 3.0 Spec 4.4.3 "Feedback Loops between Textures and the
 | 
			
		||||
// Framebuffer"
 | 
			
		||||
//
 | 
			
		||||
class GpuBufferToImageFrameCalculator : public CalculatorBase {
 | 
			
		||||
 public:
 | 
			
		||||
  GpuBufferToImageFrameCalculator() {}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -24,6 +24,11 @@
 | 
			
		|||
namespace mediapipe {
 | 
			
		||||
 | 
			
		||||
// Convert ImageFrame to GpuBuffer.
 | 
			
		||||
//
 | 
			
		||||
// NOTE: all ImageFrameToGpuBufferCalculators use a common dedicated shared GL
 | 
			
		||||
// context thread by default, which is different from the main GL context thread
 | 
			
		||||
// used by the graph. (If MediaPipe uses multithreading and multiple OpenGL
 | 
			
		||||
// contexts.)
 | 
			
		||||
class ImageFrameToGpuBufferCalculator : public CalculatorBase {
 | 
			
		||||
 public:
 | 
			
		||||
  ImageFrameToGpuBufferCalculator() {}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user