Ejemplo n.º 1
0
 @Override
 public final synchronized void recycle() {
   if (!recycled) {
     frameGrabber.recycleVideoBuffer(this);
     recycled = true;
     notifyAll();
   }
 }
Ejemplo n.º 2
0
  /**
   * Sublclasses can override this method to either return a {@link BufferedImage} for this video
   * frame, or throw a {@link UnsupportedMethod} exception if this video frame cannot generate a
   * {@link BufferedImage}.
   *
   * @return a {@link BufferedImage}.
   * @throws UnsupportedMethod exception if a buffered image cannot be generated for this video
   *     frame (because of its image format for instance)
   */
  protected BufferedImage refreshBufferedImage() {
    if (bufferedImage == null)
      throw new UnsupportedMethod(
          "A Bufferedimage can not be generated for this "
              + "image format ("
              + frameGrabber.getImageFormat().toString()
              + ")");

    return bufferedImage;
  }
Ejemplo n.º 3
0
  /**
   * Sublclasses can override this method to either return a {@link WritableRaster} for this video
   * frame, or throw a {@link UnsupportedMethod} exception if this video frame cannot generate a
   * {@link WritableRaster}.
   *
   * @return a {@link WritableRaster}.
   * @throws UnsupportedMethod exception if a raster cannot be generated for this video frame
   *     (because of its image format for instance)
   */
  protected WritableRaster refreshRaster() {
    if (raster == null)
      throw new UnsupportedMethod(
          "A raster can not be generated for this "
              + "image format ("
              + frameGrabber.getImageFormat().toString()
              + ")");

    return raster;
  }