jarp
Class GLGrabCoordinator

java.lang.Object
  extended by jarp.GLGrabCoordinator

public class GLGrabCoordinator
extends java.lang.Object

Controller and synchronization manager for frame grabbing from a JA View.


Constructor Summary
GLGrabCoordinator(View vw)
          Constructs a new Grab Controller for the given parent view, with no outstanding request.
 
Method Summary
 byte[] getRequestBuffer()
          Returns the target buffer for the currently pending frame-grab request if there is one, or null if there is none.
 int[] getWidthHeight()
          Returns the width and height values for the current video.
 void makeRequest(int f, byte[] pixels)
          Requests that the next frame displayed by this controller's owning View, which has the given frame index, should be copied into the given 3-byte BGR buffer.
 void notifyFrame()
          Registers the the availability of the newly grabbed frame data to satisfy the most recent request
 void reset()
          Stops/resets this controller to its idle, non-grabbing, state.
 void start(boolean dolog, int w, int h)
          Starts a new video grab session, using the given logging flag setting.
 void waitForFrame()
          Waits for the currently requested frame to become available after clearing the request.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GLGrabCoordinator

public GLGrabCoordinator(View vw)
Constructs a new Grab Controller for the given parent view, with no outstanding request.

Method Detail

getWidthHeight

public int[] getWidthHeight()
Returns the width and height values for the current video.


start

public void start(boolean dolog,
                  int w,
                  int h)
Starts a new video grab session, using the given logging flag setting.


reset

public void reset()
Stops/resets this controller to its idle, non-grabbing, state.


makeRequest

public void makeRequest(int f,
                        byte[] pixels)
Requests that the next frame displayed by this controller's owning View, which has the given frame index, should be copied into the given 3-byte BGR buffer.


getRequestBuffer

public byte[] getRequestBuffer()
Returns the target buffer for the currently pending frame-grab request if there is one, or null if there is none.


notifyFrame

public void notifyFrame()
Registers the the availability of the newly grabbed frame data to satisfy the most recent request


waitForFrame

public void waitForFrame()
                  throws java.lang.InterruptedException
Waits for the currently requested frame to become available after clearing the request. It is expected, but not enforced, that external scheduling arrangements will ensure that this method is not called until after the notifyFrame() call announces the availability of the required .frame.

Throws:
java.lang.InterruptedException