diff options
author | Shuzhen Wang <shuzhenwang@google.com> | 2017-11-27 23:05:10 -0800 |
---|---|---|
committer | Emilian Peev <epeev@google.com> | 2018-01-20 15:40:28 +0000 |
commit | c28189a64a6ef65aecccb6e3bb980f1afc189a1c (patch) | |
tree | 55c55d7c4317558551ffb0313d96e4703de6936d /camera/camera2/OutputConfiguration.cpp | |
parent | ac3ce6c30c5859401332caa207ed79ac188de647 (diff) |
Camera: Add physicalCameraId to OutputConfiguration
Add physical camera ID in OutputConfiguration so that the application
can optionally set physical camera id for an output stream.
Test: Camera CTS
Bug: 64691172
Change-Id: I5909cd71618cc07ef403c420913eb1c02f1e10f0
Diffstat (limited to 'camera/camera2/OutputConfiguration.cpp')
-rw-r--r-- | camera/camera2/OutputConfiguration.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/camera/camera2/OutputConfiguration.cpp b/camera/camera2/OutputConfiguration.cpp index 813d6c9bb9..feb04c24ed 100644 --- a/camera/camera2/OutputConfiguration.cpp +++ b/camera/camera2/OutputConfiguration.cpp @@ -1,6 +1,6 @@ /* ** -** Copyright 2015, The Android Open Source Project +** Copyright 2015-2018, The Android Open Source Project ** ** Licensed under the Apache License, Version 2.0 (the "License"); ** you may not use this file except in compliance with the License. @@ -64,6 +64,10 @@ bool OutputConfiguration::isShared() const { return mIsShared; } +String16 OutputConfiguration::getPhysicalCameraId() const { + return mPhysicalCameraId; +} + OutputConfiguration::OutputConfiguration() : mRotation(INVALID_ROTATION), mSurfaceSetID(INVALID_SET_ID), @@ -139,6 +143,8 @@ status_t OutputConfiguration::readFromParcel(const android::Parcel* parcel) { return err; } + parcel->readString16(&mPhysicalCameraId); + mRotation = rotation; mSurfaceSetID = setID; mSurfaceType = surfaceType; @@ -153,8 +159,9 @@ status_t OutputConfiguration::readFromParcel(const android::Parcel* parcel) { mGbps.push_back(surface.graphicBufferProducer); } - ALOGV("%s: OutputConfiguration: rotation = %d, setId = %d, surfaceType = %d", - __FUNCTION__, mRotation, mSurfaceSetID, mSurfaceType); + ALOGV("%s: OutputConfiguration: rotation = %d, setId = %d, surfaceType = %d," + " physicalCameraId = %s", __FUNCTION__, mRotation, mSurfaceSetID, + mSurfaceType, String8(mPhysicalCameraId).string()); return err; } @@ -204,6 +211,9 @@ status_t OutputConfiguration::writeToParcel(android::Parcel* parcel) const { err = parcel->writeParcelableVector(surfaceShims); if (err != OK) return err; + err = parcel->writeString16(mPhysicalCameraId); + if (err != OK) return err; + return OK; } |