Ejemplo n.º 1
0
  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;
  }