| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MEDIA_CAPTURE_VIDEO_ANDROID_TANGO_CLIENT_API_GLUE_H_ |
| 6 #define MEDIA_CAPTURE_VIDEO_ANDROID_TANGO_CLIENT_API_GLUE_H_ |
| 7 |
| 8 #include <stdint.h> |
| 9 |
| 10 #include <memory> |
| 11 |
| 12 namespace media { |
| 13 |
| 14 // A helper class for dynamic loading of symbols from libtango_client_api.so and |
| 15 // invoking them. We load only a set of symbols required for capture. |
| 16 // libtango_client_api.so is present only on Android Tango devices. |
| 17 class TangoClientApiGlue { |
| 18 public: |
| 19 using TangoConfig = void*; |
| 20 enum TangoCameraId { |
| 21 TANGO_CAMERA_COLOR = 0, ///< Back-facing color camera |
| 22 TANGO_CAMERA_RGBIR, ///< Back-facing camera producing IR-sensitive images |
| 23 TANGO_CAMERA_FISHEYE, ///< Back-facing fisheye wide-angle camera |
| 24 TANGO_CAMERA_DEPTH, ///< Depth camera |
| 25 TANGO_MAX_CAMERA_ID ///< Maximum camera allowable |
| 26 }; |
| 27 |
| 28 enum TangoConfigType { |
| 29 TANGO_CONFIG_DEFAULT = 0, ///< Default, motion tracking only. |
| 30 TANGO_CONFIG_CURRENT, ///< Current |
| 31 TANGO_CONFIG_MOTION_TRACKING, ///< Motion tracking |
| 32 TANGO_CONFIG_AREA_LEARNING, ///< Area learning |
| 33 TANGO_CONFIG_RUNTIME, ///< Runtime settable configuration |
| 34 TANGO_MAX_CONFIG_TYPE ///< Maximum number allowable |
| 35 }; |
| 36 |
| 37 enum TangoErrorType { |
| 38 TANGO_METHOD_NOT_FOUND = -8, |
| 39 TANGO_NO_DATASET_PERMISSION = -7, |
| 40 TANGO_NO_IMPORT_EXPORT_PERMISSION = -6, |
| 41 TANGO_NO_CAMERA_PERMISSION = -5, |
| 42 TANGO_NO_ADF_PERMISSION = -4, |
| 43 TANGO_NO_MOTION_TRACKING_PERMISSION = -3, |
| 44 TANGO_INVALID = -2, |
| 45 TANGO_ERROR = -1, |
| 46 TANGO_SUCCESS = 0, |
| 47 }; |
| 48 |
| 49 struct TangoCameraIntrinsics { |
| 50 TangoCameraId camera_id; |
| 51 enum { |
| 52 UNUSED, |
| 53 } calibration_type; |
| 54 uint32_t width; |
| 55 uint32_t height; |
| 56 double fx; |
| 57 double fy; |
| 58 double cx; |
| 59 double cy; |
| 60 double distortion[5]; |
| 61 }; |
| 62 |
| 63 struct TangoPointCloud { |
| 64 uint32_t version; |
| 65 double timestamp; |
| 66 uint32_t num_points; |
| 67 float (*points)[4]; |
| 68 }; |
| 69 |
| 70 static TangoErrorType TangoService_setBinder(void* jni_env, void* iBinder); |
| 71 static TangoConfig TangoService_getConfig(TangoConfigType config_type); |
| 72 static TangoErrorType TangoService_connect(void* context, TangoConfig config); |
| 73 static void TangoService_disconnect(); |
| 74 static TangoErrorType TangoService_connectOnPointCloudAvailable( |
| 75 void (*TangoService_onPointCloudAvailable)(void* context, |
| 76 const TangoPointCloud* cloud), |
| 77 ...); |
| 78 static TangoErrorType TangoService_getCameraIntrinsics( |
| 79 TangoCameraId camera_id, |
| 80 TangoCameraIntrinsics* intrinsics); |
| 81 static TangoErrorType TangoConfig_setBool(TangoConfig config, |
| 82 const char* key, |
| 83 bool value); |
| 84 static TangoErrorType TangoConfig_setInt32(TangoConfig config, |
| 85 const char* key, |
| 86 int32_t value); |
| 87 |
| 88 private: |
| 89 static void* handle(); |
| 90 friend class VideoCaptureDeviceTangoAndroidTest; |
| 91 }; |
| 92 |
| 93 } // namespace media |
| 94 |
| 95 #endif /* MEDIA_CAPTURE_VIDEO_ANDROID_TANGO_CLIENT_API_GLUE_H_ */ |
| OLD | NEW |