am cd17a84a: Merge "Add more specific consumer names for common buffer queue endpoints." into mnc-dev
* commit 'cd17a84a860769049806c8a7fe80d274edcd950d': Add more specific consumer names for common buffer queue endpoints.
This commit is contained in:
@@ -49,6 +49,12 @@ struct fields_t {
|
|||||||
};
|
};
|
||||||
static fields_t fields;
|
static fields_t fields;
|
||||||
|
|
||||||
|
// Get an ID that's unique within this process.
|
||||||
|
static int32_t createProcessUniqueId() {
|
||||||
|
static volatile int32_t globalCounter = 0;
|
||||||
|
return android_atomic_inc(&globalCounter);
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
static void SurfaceTexture_setSurfaceTexture(JNIEnv* env, jobject thiz,
|
static void SurfaceTexture_setSurfaceTexture(JNIEnv* env, jobject thiz,
|
||||||
@@ -253,6 +259,11 @@ static void SurfaceTexture_init(JNIEnv* env, jobject thiz, jboolean isDetached,
|
|||||||
"Unable to create native SurfaceTexture");
|
"Unable to create native SurfaceTexture");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
surfaceTexture->setName(String8::format("SurfaceTexture-%d-%d-%d",
|
||||||
|
(isDetached ? 0 : texName),
|
||||||
|
getpid(),
|
||||||
|
createProcessUniqueId()));
|
||||||
|
|
||||||
SurfaceTexture_setSurfaceTexture(env, thiz, surfaceTexture);
|
SurfaceTexture_setSurfaceTexture(env, thiz, surfaceTexture);
|
||||||
SurfaceTexture_setProducer(env, thiz, producer);
|
SurfaceTexture_setProducer(env, thiz, producer);
|
||||||
|
|
||||||
|
|||||||
@@ -72,6 +72,12 @@ static struct {
|
|||||||
jmethodID ctor;
|
jmethodID ctor;
|
||||||
} gSurfacePlaneClassInfo;
|
} gSurfacePlaneClassInfo;
|
||||||
|
|
||||||
|
// Get an ID that's unique within this process.
|
||||||
|
static int32_t createProcessUniqueId() {
|
||||||
|
static volatile int32_t globalCounter = 0;
|
||||||
|
return android_atomic_inc(&globalCounter);
|
||||||
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
class JNIImageReaderContext : public ConsumerBase::FrameAvailableListener
|
class JNIImageReaderContext : public ConsumerBase::FrameAvailableListener
|
||||||
@@ -808,6 +814,9 @@ static void ImageReader_init(JNIEnv* env, jobject thiz, jobject weakThiz,
|
|||||||
sp<ConsumerBase> consumer;
|
sp<ConsumerBase> consumer;
|
||||||
sp<CpuConsumer> cpuConsumer;
|
sp<CpuConsumer> cpuConsumer;
|
||||||
sp<BufferItemConsumer> opaqueConsumer;
|
sp<BufferItemConsumer> opaqueConsumer;
|
||||||
|
String8 consumerName = String8::format("ImageReader-%dx%df%xm%d-%d-%d",
|
||||||
|
width, height, format, maxImages, getpid(),
|
||||||
|
createProcessUniqueId());
|
||||||
if (isFormatOpaque(nativeFormat)) {
|
if (isFormatOpaque(nativeFormat)) {
|
||||||
// Use the SW_READ_NEVER usage to tell producer that this format is not for preview or video
|
// Use the SW_READ_NEVER usage to tell producer that this format is not for preview or video
|
||||||
// encoding. The only possibility will be ZSL output.
|
// encoding. The only possibility will be ZSL output.
|
||||||
@@ -819,6 +828,7 @@ static void ImageReader_init(JNIEnv* env, jobject thiz, jobject weakThiz,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ctx->setOpaqueConsumer(opaqueConsumer);
|
ctx->setOpaqueConsumer(opaqueConsumer);
|
||||||
|
opaqueConsumer->setName(consumerName);
|
||||||
consumer = opaqueConsumer;
|
consumer = opaqueConsumer;
|
||||||
} else {
|
} else {
|
||||||
cpuConsumer = new CpuConsumer(gbConsumer, maxImages, /*controlledByApp*/true);
|
cpuConsumer = new CpuConsumer(gbConsumer, maxImages, /*controlledByApp*/true);
|
||||||
@@ -828,6 +838,7 @@ static void ImageReader_init(JNIEnv* env, jobject thiz, jobject weakThiz,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ctx->setCpuConsumer(cpuConsumer);
|
ctx->setCpuConsumer(cpuConsumer);
|
||||||
|
cpuConsumer->setName(consumerName);
|
||||||
consumer = cpuConsumer;
|
consumer = cpuConsumer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user