2 * Copyright (C) 2013 Canonical Ltd
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 * Authored by: Michael Frey <michael.frey@canonical.com>
17 * Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
23 #include <hybris/internal/binding.h>
24 #include <hybris/camera/camera_compatibility_layer.h>
25 #include <hybris/camera/camera_compatibility_layer_capabilities.h>
26 #include <hybris/surface_flinger/surface_flinger_compatibility_layer.h>
28 #define COMPAT_LIBRARY_PATH "/system/lib/libcamera_compat_layer.so"
30 HYBRIS_LIBRARY_INITIALIZE(camera
, COMPAT_LIBRARY_PATH
);
32 HYBRIS_IMPLEMENT_FUNCTION0(camera
, int, android_camera_get_number_of_devices
);
33 HYBRIS_IMPLEMENT_FUNCTION2(camera
, struct CameraControl
*, android_camera_connect_to
,
34 CameraType
, struct CameraControlListener
*);
35 HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera
, android_camera_disconnect
,
36 struct CameraControl
*);
37 HYBRIS_IMPLEMENT_FUNCTION1(camera
, int, android_camera_lock
, struct CameraControl
*);
38 HYBRIS_IMPLEMENT_FUNCTION1(camera
, int, android_camera_unlock
, struct CameraControl
*);
39 HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera
, android_camera_delete
, struct CameraControl
*);
40 HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera
, android_camera_dump_parameters
,
41 struct CameraControl
*);
44 HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera
, android_camera_set_effect_mode
,
45 struct CameraControl
*, EffectMode
);
46 HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera
, android_camera_set_flash_mode
,
47 struct CameraControl
*, FlashMode
);
48 HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera
, android_camera_set_white_balance_mode
,
49 struct CameraControl
*, WhiteBalanceMode
);
50 HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera
, android_camera_set_scene_mode
,
51 struct CameraControl
*, SceneMode
);
52 HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera
, android_camera_set_auto_focus_mode
,
53 struct CameraControl
*, AutoFocusMode
);
54 HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera
, android_camera_set_picture_size
,
55 struct CameraControl
*, int, int);
56 HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera
, android_camera_set_preview_size
,
57 struct CameraControl
*, int, int);
58 HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera
, android_camera_set_display_orientation
,
59 struct CameraControl
*, int32_t);
60 HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera
, android_camera_set_preview_texture
,
61 struct CameraControl
*, int);
62 HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera
, android_camera_set_preview_surface
,
63 struct CameraControl
*, struct SfSurface
*);
64 HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera
, android_camera_set_focus_region
,
65 struct CameraControl
*, FocusRegion
*);
66 HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera
, android_camera_reset_focus_region
,
67 struct CameraControl
*);
68 HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera
, android_camera_set_preview_fps
,
69 struct CameraControl
*, int);
70 HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera
, android_camera_set_rotation
,
71 struct CameraControl
*, int);
72 HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera
, android_camera_set_video_size
,
73 struct CameraControl
*, int, int);
76 HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera
, android_camera_get_effect_mode
,
77 struct CameraControl
*, EffectMode
*);
78 HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera
, android_camera_get_flash_mode
,
79 struct CameraControl
*, FlashMode
*);
80 HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera
, android_camera_get_white_balance_mode
,
81 struct CameraControl
*, WhiteBalanceMode
*);
82 HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera
, android_camera_get_scene_mode
,
83 struct CameraControl
*, SceneMode
*);
84 HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera
, android_camera_get_auto_focus_mode
,
85 struct CameraControl
*, AutoFocusMode
*);
86 HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera
, android_camera_get_max_zoom
,
87 struct CameraControl
*, int*);
88 HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera
, android_camera_get_picture_size
,
89 struct CameraControl
*, int*, int*);
90 HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera
, android_camera_get_preview_size
,
91 struct CameraControl
*, int*, int*);
92 HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera
, android_camera_get_preview_fps_range
,
93 struct CameraControl
*, int*, int*);
94 HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera
, android_camera_get_preview_fps
,
95 struct CameraControl
*, int*);
96 HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera
, android_camera_get_preview_texture_transformation
,
97 struct CameraControl
*, float*);
98 HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera
, android_camera_get_video_size
,
99 struct CameraControl
*, int*, int*);
102 HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera
, android_camera_enumerate_supported_picture_sizes
,
103 struct CameraControl
*, size_callback
, void*);
104 HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera
, android_camera_enumerate_supported_preview_sizes
,
105 struct CameraControl
*, size_callback
, void*);
106 HYBRIS_IMPLEMENT_VOID_FUNCTION3(camera
, android_camera_enumerate_supported_video_sizes
,
107 struct CameraControl
*, size_callback
, void*);
109 HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera
, android_camera_update_preview_texture
, struct CameraControl
*);
111 HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera
, android_camera_start_preview
, struct CameraControl
*);
112 HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera
, android_camera_stop_preview
, struct CameraControl
*);
113 HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera
, android_camera_start_autofocus
, struct CameraControl
*);
114 HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera
, android_camera_stop_autofocus
, struct CameraControl
*);
116 HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera
, android_camera_start_zoom
, struct CameraControl
*, int32_t);
117 HYBRIS_IMPLEMENT_VOID_FUNCTION2(camera
, android_camera_set_zoom
, struct CameraControl
*, int32_t);
118 HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera
, android_camera_stop_zoom
, struct CameraControl
*);
119 HYBRIS_IMPLEMENT_VOID_FUNCTION1(camera
, android_camera_take_snapshot
, struct CameraControl
*);