OSDN Git Service

always pass the BufferQueue explicitely to consumers
authorMathias Agopian <mathias@google.com>
Sat, 13 Jul 2013 05:06:31 +0000 (22:06 -0700)
committerMathias Agopian <mathias@google.com>
Sat, 13 Jul 2013 05:06:31 +0000 (22:06 -0700)
Change-Id: I32e380979a3f4c6b1dfb440cc5b5c3d30d7607db

core/jni/android/graphics/SurfaceTexture.cpp
media/jni/android_media_ImageReader.cpp
media/mca/filterfw/native/core/gl_env.cpp

index 753f5dc..3600b76 100644 (file)
@@ -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");
index 7866df4..5856057 100644 (file)
@@ -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");
index 73768fe..63fd16e 100644 (file)
@@ -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()));