summaryrefslogtreecommitdiffstats
path: root/services/camera/libcameraservice/api2
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2015-06-09 13:44:19 -0700
committerEino-Ville Talvala <etalvala@google.com>2015-06-09 14:52:26 -0700
commit727d172137b4f32681c098de8e2623c0b65a6406 (patch)
tree8e7a403274d5a770ecd473d6ef66f3a5f32f45da /services/camera/libcameraservice/api2
parent9a17941fa70e43119d2c3464bc00a3cd30b2bd14 (diff)
downloadframeworks_av-727d172137b4f32681c098de8e2623c0b65a6406.zip
frameworks_av-727d172137b4f32681c098de8e2623c0b65a6406.tar.gz
frameworks_av-727d172137b4f32681c098de8e2623c0b65a6406.tar.bz2
CameraService: Add consumer name to output stream dumpsys
Also switch use of ANativeWindow to Surface, to get to the getConsumerName() method where necessary. Surface can always be cast to ANativeWindow, but not the other way around, so it's a better option anyway. Change-Id: Ie5c2d30821c1a754f9e382699ff50b4b328288b3
Diffstat (limited to 'services/camera/libcameraservice/api2')
-rw-r--r--services/camera/libcameraservice/api2/CameraDeviceClient.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/services/camera/libcameraservice/api2/CameraDeviceClient.cpp b/services/camera/libcameraservice/api2/CameraDeviceClient.cpp
index 4d276be..3b83f63 100644
--- a/services/camera/libcameraservice/api2/CameraDeviceClient.cpp
+++ b/services/camera/libcameraservice/api2/CameraDeviceClient.cpp
@@ -411,27 +411,28 @@ status_t CameraDeviceClient::createStream(const OutputConfiguration &outputConfi
(consumerUsage & allowedFlags) != 0;
sp<IBinder> binder = IInterface::asBinder(bufferProducer);
- sp<ANativeWindow> anw = new Surface(bufferProducer, useAsync);
+ sp<Surface> surface = new Surface(bufferProducer, useAsync);
+ ANativeWindow *anw = surface.get();
int width, height, format;
android_dataspace dataSpace;
- if ((res = anw->query(anw.get(), NATIVE_WINDOW_WIDTH, &width)) != OK) {
+ if ((res = anw->query(anw, NATIVE_WINDOW_WIDTH, &width)) != OK) {
ALOGE("%s: Camera %d: Failed to query Surface width", __FUNCTION__,
mCameraId);
return res;
}
- if ((res = anw->query(anw.get(), NATIVE_WINDOW_HEIGHT, &height)) != OK) {
+ if ((res = anw->query(anw, NATIVE_WINDOW_HEIGHT, &height)) != OK) {
ALOGE("%s: Camera %d: Failed to query Surface height", __FUNCTION__,
mCameraId);
return res;
}
- if ((res = anw->query(anw.get(), NATIVE_WINDOW_FORMAT, &format)) != OK) {
+ if ((res = anw->query(anw, NATIVE_WINDOW_FORMAT, &format)) != OK) {
ALOGE("%s: Camera %d: Failed to query Surface format", __FUNCTION__,
mCameraId);
return res;
}
- if ((res = anw->query(anw.get(), NATIVE_WINDOW_DEFAULT_DATASPACE,
+ if ((res = anw->query(anw, NATIVE_WINDOW_DEFAULT_DATASPACE,
reinterpret_cast<int*>(&dataSpace))) != OK) {
ALOGE("%s: Camera %d: Failed to query Surface dataSpace", __FUNCTION__,
mCameraId);
@@ -456,7 +457,7 @@ status_t CameraDeviceClient::createStream(const OutputConfiguration &outputConfi
}
int streamId = -1;
- res = mDevice->createStream(anw, width, height, format, dataSpace,
+ res = mDevice->createStream(surface, width, height, format, dataSpace,
static_cast<camera3_stream_rotation_t>
(outputConfiguration.getRotation()),
&streamId);