summaryrefslogtreecommitdiffstats
path: root/services/camera/libcameraservice/device3
diff options
context:
space:
mode:
Diffstat (limited to 'services/camera/libcameraservice/device3')
-rw-r--r--services/camera/libcameraservice/device3/Camera3Device.cpp2
-rw-r--r--services/camera/libcameraservice/device3/Camera3Device.h2
-rw-r--r--services/camera/libcameraservice/device3/Camera3OutputStream.cpp12
-rw-r--r--services/camera/libcameraservice/device3/Camera3OutputStream.h9
-rw-r--r--services/camera/libcameraservice/device3/Camera3ZslStream.cpp1
5 files changed, 17 insertions, 9 deletions
diff --git a/services/camera/libcameraservice/device3/Camera3Device.cpp b/services/camera/libcameraservice/device3/Camera3Device.cpp
index b16b881..c28a57e 100644
--- a/services/camera/libcameraservice/device3/Camera3Device.cpp
+++ b/services/camera/libcameraservice/device3/Camera3Device.cpp
@@ -817,7 +817,7 @@ status_t Camera3Device::createZslStream(
return OK;
}
-status_t Camera3Device::createStream(sp<ANativeWindow> consumer,
+status_t Camera3Device::createStream(sp<Surface> consumer,
uint32_t width, uint32_t height, int format, android_dataspace dataSpace,
camera3_stream_rotation_t rotation, int *id) {
ATRACE_CALL();
diff --git a/services/camera/libcameraservice/device3/Camera3Device.h b/services/camera/libcameraservice/device3/Camera3Device.h
index 180b1f8..e2fd8d4 100644
--- a/services/camera/libcameraservice/device3/Camera3Device.h
+++ b/services/camera/libcameraservice/device3/Camera3Device.h
@@ -94,7 +94,7 @@ class Camera3Device :
// Actual stream creation/deletion is delayed until first request is submitted
// If adding streams while actively capturing, will pause device before adding
// stream, reconfiguring device, and unpausing.
- virtual status_t createStream(sp<ANativeWindow> consumer,
+ virtual status_t createStream(sp<Surface> consumer,
uint32_t width, uint32_t height, int format,
android_dataspace dataSpace, camera3_stream_rotation_t rotation, int *id);
virtual status_t createInputStream(
diff --git a/services/camera/libcameraservice/device3/Camera3OutputStream.cpp b/services/camera/libcameraservice/device3/Camera3OutputStream.cpp
index 7a0331b..8c611d5 100644
--- a/services/camera/libcameraservice/device3/Camera3OutputStream.cpp
+++ b/services/camera/libcameraservice/device3/Camera3OutputStream.cpp
@@ -32,7 +32,7 @@ namespace android {
namespace camera3 {
Camera3OutputStream::Camera3OutputStream(int id,
- sp<ANativeWindow> consumer,
+ sp<Surface> consumer,
uint32_t width, uint32_t height, int format,
android_dataspace dataSpace, camera3_stream_rotation_t rotation) :
Camera3IOStreamBase(id, CAMERA3_STREAM_OUTPUT, width, height,
@@ -48,7 +48,7 @@ Camera3OutputStream::Camera3OutputStream(int id,
}
Camera3OutputStream::Camera3OutputStream(int id,
- sp<ANativeWindow> consumer,
+ sp<Surface> consumer,
uint32_t width, uint32_t height, size_t maxSize, int format,
android_dataspace dataSpace, camera3_stream_rotation_t rotation) :
Camera3IOStreamBase(id, CAMERA3_STREAM_OUTPUT, width, height, maxSize,
@@ -229,6 +229,7 @@ void Camera3OutputStream::dump(int fd, const Vector<String16> &args) const {
(void) args;
String8 lines;
lines.appendFormat(" Stream[%d]: Output\n", mId);
+ lines.appendFormat(" Consumer name: %s\n", mConsumerName.string());
write(fd, lines.string(), lines.size());
Camera3IOStreamBase::dump(fd, args);
@@ -278,6 +279,8 @@ status_t Camera3OutputStream::configureQueueLocked() {
return res;
}
+ mConsumerName = mConsumer->getConsumerName();
+
res = native_window_set_usage(mConsumer.get(), camera3_stream::usage);
if (res != OK) {
ALOGE("%s: Unable to configure usage %08x for stream %d",
@@ -326,7 +329,8 @@ status_t Camera3OutputStream::configureQueueLocked() {
}
int maxConsumerBuffers;
- res = mConsumer->query(mConsumer.get(),
+ res = static_cast<ANativeWindow*>(mConsumer.get())->query(
+ mConsumer.get(),
NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS, &maxConsumerBuffers);
if (res != OK) {
ALOGE("%s: Unable to query consumer undequeued"
@@ -401,7 +405,7 @@ status_t Camera3OutputStream::getEndpointUsage(uint32_t *usage) const {
status_t res;
int32_t u = 0;
- res = mConsumer->query(mConsumer.get(),
+ res = static_cast<ANativeWindow*>(mConsumer.get())->query(mConsumer.get(),
NATIVE_WINDOW_CONSUMER_USAGE_BITS, &u);
// If an opaque output stream's endpoint is ImageReader, add
diff --git a/services/camera/libcameraservice/device3/Camera3OutputStream.h b/services/camera/libcameraservice/device3/Camera3OutputStream.h
index 513b695..941d693 100644
--- a/services/camera/libcameraservice/device3/Camera3OutputStream.h
+++ b/services/camera/libcameraservice/device3/Camera3OutputStream.h
@@ -38,7 +38,7 @@ class Camera3OutputStream :
/**
* Set up a stream for formats that have 2 dimensions, such as RAW and YUV.
*/
- Camera3OutputStream(int id, sp<ANativeWindow> consumer,
+ Camera3OutputStream(int id, sp<Surface> consumer,
uint32_t width, uint32_t height, int format,
android_dataspace dataSpace, camera3_stream_rotation_t rotation);
@@ -46,7 +46,7 @@ class Camera3OutputStream :
* Set up a stream for formats that have a variable buffer size for the same
* dimensions, such as compressed JPEG.
*/
- Camera3OutputStream(int id, sp<ANativeWindow> consumer,
+ Camera3OutputStream(int id, sp<Surface> consumer,
uint32_t width, uint32_t height, size_t maxSize, int format,
android_dataspace dataSpace, camera3_stream_rotation_t rotation);
@@ -81,7 +81,7 @@ class Camera3OutputStream :
virtual status_t disconnectLocked();
- sp<ANativeWindow> mConsumer;
+ sp<Surface> mConsumer;
private:
int mTransform;
@@ -89,6 +89,9 @@ class Camera3OutputStream :
bool mTraceFirstBuffer;
+ // Name of Surface consumer
+ String8 mConsumerName;
+
/**
* Internal Camera3Stream interface
*/
diff --git a/services/camera/libcameraservice/device3/Camera3ZslStream.cpp b/services/camera/libcameraservice/device3/Camera3ZslStream.cpp
index 10d7f2e..eefcb44 100644
--- a/services/camera/libcameraservice/device3/Camera3ZslStream.cpp
+++ b/services/camera/libcameraservice/device3/Camera3ZslStream.cpp
@@ -122,6 +122,7 @@ Camera3ZslStream::Camera3ZslStream(int id, uint32_t width, uint32_t height,
sp<IGraphicBufferConsumer> consumer;
BufferQueue::createBufferQueue(&producer, &consumer);
mProducer = new RingBufferConsumer(consumer, GRALLOC_USAGE_HW_CAMERA_ZSL, bufferCount);
+ mProducer->setName(String8("Camera2-ZslRingBufferConsumer"));
mConsumer = new Surface(producer);
}