protected void cleanupBuffers() {
    // Delete the capture buffers
    for (int i = 0; i < m_CaptureBuffers.size(); ++i) {
      FrameBuffer buffer = m_CaptureBuffers.get(i);
      buffer.free();
    }

    m_FreeBufferList.clear();
    m_CaptureBuffers.clear();
  }
  protected boolean allocateBuffers() {
    // Allocate exactly 3 buffers to use as the capture destination while streaming.
    // These buffers are passed to the SDK.
    for (int i = 0; i < s_NumSdkBuffers; ++i) {
      FrameBuffer buffer =
          m_Stream.allocateFrameBuffer(m_VideoParams.outputWidth * m_VideoParams.outputHeight * 4);
      if (!buffer.getIsValid()) {
        reportError(String.format("Error while allocating frame buffer"));
        return false;
      }

      m_CaptureBuffers.add(buffer);
      m_FreeBufferList.add(buffer);
    }

    return true;
  }
Example #3
0
 public void preWarm(FrameBuffer framebuffer) {
   if (!framebuffer.usesRenderer(1)) return;
   for (int i = 0; i < textureCount; i++) {
     Texture texture = textures[i];
     Texture texture1;
     if (texture != null) texture1 = texture.getMipMappedTexture(1);
   }
 }
  public void bufferUnlockCallback(long address) {
    FrameBuffer buffer = FrameBuffer.lookupBuffer(address);

    // Put back on the free list
    m_FreeBufferList.add(buffer);
  }