Camera: Switch camera2 to auto-gen C++ binder interfaces
- Move camera service AIDL files to frameworks/av
- Build C++ interface stubs with AIDL tools
- Add necessary native-side parcelables and update existing ones
- Remove manually-written stubs, rearrange remaining manual stubs
- Adjust implementations to work with auto-generated stubs
- Adjust method signatures for auto-gen differences
- Add rich error messages using binder::Status
Bug: 25091611
Change-Id: I6f69f34b9d1a3f8d1fb7db87357363f8fa8483ff
diff --git a/include/camera/CameraBase.h b/include/camera/CameraBase.h
index d8561ed..0692a27 100644
--- a/include/camera/CameraBase.h
+++ b/include/camera/CameraBase.h
@@ -18,13 +18,18 @@
#define ANDROID_HARDWARE_CAMERA_BASE_H
#include <utils/Mutex.h>
-#include <camera/ICameraService.h>
struct camera_frame_metadata;
namespace android {
-struct CameraInfo {
+namespace hardware {
+
+
+class ICameraService;
+class ICameraServiceListener;
+
+struct CameraInfo : public android::Parcelable {
/**
* The direction that the camera faces to. It should be CAMERA_FACING_BACK
* or CAMERA_FACING_FRONT.
@@ -44,8 +49,17 @@
* right of the screen, the value should be 270.
*/
int orientation;
+
+ virtual status_t writeToParcel(Parcel* parcel) const;
+ virtual status_t readFromParcel(const Parcel* parcel);
+
};
+} // namespace hardware
+
+using hardware::CameraInfo;
+
+
template <typename TCam>
struct CameraTraits {
};
@@ -70,13 +84,13 @@
static status_t getCameraInfo(int cameraId,
/*out*/
- struct CameraInfo* cameraInfo);
+ struct hardware::CameraInfo* cameraInfo);
static status_t addServiceListener(
- const sp<ICameraServiceListener>& listener);
+ const sp<::android::hardware::ICameraServiceListener>& listener);
static status_t removeServiceListener(
- const sp<ICameraServiceListener>& listener);
+ const sp<::android::hardware::ICameraServiceListener>& listener);
sp<TCamUser> remote();
@@ -101,7 +115,7 @@
virtual void binderDied(const wp<IBinder>& who);
// helper function to obtain camera service handle
- static const sp<ICameraService>& getCameraService();
+ static const sp<::android::hardware::ICameraService>& getCameraService();
sp<TCamUser> mCamera;
status_t mStatus;