Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b550929b authored by Mathias Agopian's avatar Mathias Agopian
Browse files

always pass the BufferQueue explicitely to consumers

Change-Id: I32e380979a3f4c6b1dfb440cc5b5c3d30d7607db
parent 414e2041
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -200,7 +200,8 @@ static void SurfaceTexture_classInit(JNIEnv* env, jclass clazz)
static void SurfaceTexture_init(JNIEnv* env, jobject thiz, jint texName,
        jobject weakThiz, jboolean allowSynchronous)
{
    sp<GLConsumer> surfaceTexture(new GLConsumer(texName, allowSynchronous));
    sp<BufferQueue> bq = new BufferQueue(allowSynchronous);
    sp<GLConsumer> surfaceTexture(new GLConsumer(bq, texName));
    if (surfaceTexture == 0) {
        jniThrowException(env, OutOfResourcesException,
                "Unable to create native SurfaceTexture");
+2 −1
Original line number Diff line number Diff line
@@ -541,7 +541,8 @@ static void ImageReader_init(JNIEnv* env, jobject thiz, jobject weakThiz,

    nativeFormat = Image_getPixelFormat(env, format);

    sp<CpuConsumer> consumer = new CpuConsumer(maxImages);
    sp<BufferQueue> bq = new BufferQueue();
    sp<CpuConsumer> consumer = new CpuConsumer(bq, maxImages);
    // TODO: throw dvm exOutOfMemoryError?
    if (consumer == NULL) {
        jniThrowRuntimeException(env, "Failed to allocate native CpuConsumer");
+2 −1
Original line number Diff line number Diff line
@@ -160,7 +160,8 @@ bool GLEnv::InitWithNewContext() {
  }

  // Create dummy surface using a GLConsumer
  surfaceTexture_ = new GLConsumer(0);
  sp<BufferQueue> bq = new BufferQueue();
  surfaceTexture_ = new GLConsumer(bq, 0);
  window_ = new Surface(static_cast<sp<IGraphicBufferProducer> >(
          surfaceTexture_->getBufferQueue()));