Mir

Merge lp:~kdub/mir/upgrade-hal-headers-to-4.2 into lp:~mir-team/mir/trunk

Proposed by Kevin DuBois
Status: Merged
Approved by: Alan Griffiths
Approved revision: no longer in the source branch.
Merged at revision: 466
Proposed branch: lp:~kdub/mir/upgrade-hal-headers-to-4.2
Merge into: lp:~mir-team/mir/trunk
Diff against target: 5324 lines (+974/-3859)
20 files modified
3rd_party/android-deps/android/native_window.h (+10/-1)
3rd_party/android-deps/hardware/audio.h (+0/-343)
3rd_party/android-deps/hardware/audio_effect.h (+0/-897)
3rd_party/android-deps/hardware/audio_policy.h (+0/-386)
3rd_party/android-deps/hardware/camera.h (+0/-309)
3rd_party/android-deps/hardware/fb.h (+4/-1)
3rd_party/android-deps/hardware/gps.h (+0/-679)
3rd_party/android-deps/hardware/gralloc.h (+49/-12)
3rd_party/android-deps/hardware/hardware.h (+110/-5)
3rd_party/android-deps/hardware/hwcomposer.h (+462/-224)
3rd_party/android-deps/hardware/lights.h (+0/-137)
3rd_party/android-deps/hardware/nfc.h (+0/-96)
3rd_party/android-deps/hardware/qemu_pipe.h (+0/-91)
3rd_party/android-deps/hardware/qemud.h (+0/-153)
3rd_party/android-deps/hardware/sensors.h (+0/-485)
3rd_party/android-deps/sync/sync.h (+62/-0)
3rd_party/android-deps/system/graphics.h (+33/-2)
3rd_party/android-deps/system/window.h (+228/-22)
src/client/android/mir_native_window.cpp (+4/-4)
tests/unit-tests/client/test_android_native_window.cpp (+12/-12)
To merge this branch: bzr merge lp:~kdub/mir/upgrade-hal-headers-to-4.2
Reviewer Review Type Date Requested Status
Alan Griffiths Approve
Alexandros Frantzis (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+151856@code.launchpad.net

Commit message

bump the HAL headers in 3rd_party surrounding the android graphics stack from GB headers to ICS headers.

Description of the change

bump the HAL headers in 3rd_party surrounding the android graphics stack from GB headers to ICS headers.

This is necessary because some of the headers changed slightly between GB and ICS and the nexus 4 needs the new support that comes in the ICS headers. The ICS headers are backwards compatible with GB drivers.
Tested on Galaxy Nexus.

This is mostly a code drop/update from our phablet build sources (cyanogen). however, I had to change the names of some of our functions to get things to compile

I left the headers used by the input stack (eg, the things that Alan ported) alone

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

Looks good (can't test on a real device, though).

review: Approve
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

> Looks good (can't test on a real device, though).

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '3rd_party/android-deps/android/native_window.h'
--- 3rd_party/android-deps/android/native_window.h 2013-01-08 17:44:16 +0000
+++ 3rd_party/android-deps/android/native_window.h 2013-03-06 00:16:21 +0000
@@ -95,11 +95,20 @@
95 *95 *
96 * For all of these parameters, if 0 is supplied then the window's base96 * For all of these parameters, if 0 is supplied then the window's base
97 * value will come back in force.97 * value will come back in force.
98 *
99 * width and height must be either both zero or both non-zero.
100 *
98 */101 */
99int32_t ANativeWindow_setBuffersGeometry(ANativeWindow* window, int32_t width, int32_t height, int32_t format);102int32_t ANativeWindow_setBuffersGeometry(ANativeWindow* window,
103 int32_t width, int32_t height, int32_t format);
100104
101/**105/**
102 * Lock the window's next drawing surface for writing.106 * Lock the window's next drawing surface for writing.
107 * inOutDirtyBounds is used as an in/out parameter, upon entering the
108 * function, it contains the dirty region, that is, the region the caller
109 * intends to redraw. When the function returns, inOutDirtyBounds is updated
110 * with the actual area the caller needs to redraw -- this region is often
111 * extended by ANativeWindow_lock.
103 */112 */
104int32_t ANativeWindow_lock(ANativeWindow* window, ANativeWindow_Buffer* outBuffer,113int32_t ANativeWindow_lock(ANativeWindow* window, ANativeWindow_Buffer* outBuffer,
105 ARect* inOutDirtyBounds);114 ARect* inOutDirtyBounds);
106115
=== removed file '3rd_party/android-deps/hardware/audio.h'
--- 3rd_party/android-deps/hardware/audio.h 2013-01-08 17:44:16 +0000
+++ 3rd_party/android-deps/hardware/audio.h 1970-01-01 00:00:00 +0000
@@ -1,343 +0,0 @@
1/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17
18#ifndef ANDROID_AUDIO_HAL_INTERFACE_H
19#define ANDROID_AUDIO_HAL_INTERFACE_H
20
21#include <stdint.h>
22#include <strings.h>
23#include <sys/cdefs.h>
24#include <sys/types.h>
25
26#include <cutils/bitops.h>
27
28#include <hardware/hardware.h>
29#include <system/audio.h>
30#include <hardware/audio_effect.h>
31
32__BEGIN_DECLS
33
34/**
35 * The id of this module
36 */
37#define AUDIO_HARDWARE_MODULE_ID "audio"
38
39/**
40 * Name of the audio devices to open
41 */
42#define AUDIO_HARDWARE_INTERFACE "audio_hw_if"
43
44/**************************************/
45
46/**
47 * standard audio parameters that the HAL may need to handle
48 */
49
50/**
51 * audio device parameters
52 */
53
54/* BT SCO Noise Reduction + Echo Cancellation parameters */
55#define AUDIO_PARAMETER_KEY_BT_NREC "bt_headset_nrec"
56#define AUDIO_PARAMETER_VALUE_ON "on"
57#define AUDIO_PARAMETER_VALUE_OFF "off"
58
59/* TTY mode selection */
60#define AUDIO_PARAMETER_KEY_TTY_MODE "tty_mode"
61#define AUDIO_PARAMETER_VALUE_TTY_OFF "tty_off"
62#define AUDIO_PARAMETER_VALUE_TTY_VCO "tty_vco"
63#define AUDIO_PARAMETER_VALUE_TTY_HCO "tty_hco"
64#define AUDIO_PARAMETER_VALUE_TTY_FULL "tty_full"
65
66/**
67 * audio stream parameters
68 */
69
70#define AUDIO_PARAMETER_STREAM_ROUTING "routing"
71#define AUDIO_PARAMETER_STREAM_FORMAT "format"
72#define AUDIO_PARAMETER_STREAM_CHANNELS "channels"
73#define AUDIO_PARAMETER_STREAM_FRAME_COUNT "frame_count"
74#define AUDIO_PARAMETER_STREAM_INPUT_SOURCE "input_source"
75
76/**************************************/
77
78/* common audio stream parameters and operations */
79struct audio_stream {
80
81 /**
82 * sampling rate is in Hz - eg. 44100
83 */
84 uint32_t (*get_sample_rate)(const struct audio_stream *stream);
85
86 /* currently unused - use set_parameters with key
87 * AUDIO_PARAMETER_STREAM_SAMPLING_RATE
88 */
89 int (*set_sample_rate)(struct audio_stream *stream, uint32_t rate);
90
91 /**
92 * size of output buffer in bytes - eg. 4800
93 */
94 size_t (*get_buffer_size)(const struct audio_stream *stream);
95
96 /**
97 * the channel mask -
98 * e.g. AUDIO_CHANNEL_OUT_STEREO or AUDIO_CHANNEL_IN_STEREO
99 */
100 uint32_t (*get_channels)(const struct audio_stream *stream);
101
102 /**
103 * audio format - eg. AUDIO_FORMAT_PCM_16_BIT
104 */
105 int (*get_format)(const struct audio_stream *stream);
106
107 /* currently unused - use set_parameters with key
108 * AUDIO_PARAMETER_STREAM_FORMAT
109 */
110 int (*set_format)(struct audio_stream *stream, int format);
111
112 /**
113 * Put the audio hardware input/output into standby mode.
114 * Returns 0 on success and <0 on failure.
115 */
116 int (*standby)(struct audio_stream *stream);
117
118 /** dump the state of the audio input/output device */
119 int (*dump)(const struct audio_stream *stream, int fd);
120
121 audio_devices_t (*get_device)(const struct audio_stream *stream);
122 int (*set_device)(struct audio_stream *stream, audio_devices_t device);
123
124 /**
125 * set/get audio stream parameters. The function accepts a list of
126 * parameter key value pairs in the form: key1=value1;key2=value2;...
127 *
128 * Some keys are reserved for standard parameters (See AudioParameter class)
129 *
130 * If the implementation does not accept a parameter change while
131 * the output is active but the parameter is acceptable otherwise, it must
132 * return -ENOSYS.
133 *
134 * The audio flinger will put the stream in standby and then change the
135 * parameter value.
136 */
137 int (*set_parameters)(struct audio_stream *stream, const char *kv_pairs);
138
139 /*
140 * Returns a pointer to a heap allocated string. The caller is responsible
141 * for freeing the memory for it.
142 */
143 char * (*get_parameters)(const struct audio_stream *stream,
144 const char *keys);
145 int (*add_audio_effect)(const struct audio_stream *stream,
146 effect_handle_t effect);
147 int (*remove_audio_effect)(const struct audio_stream *stream,
148 effect_handle_t effect);
149};
150typedef struct audio_stream audio_stream_t;
151
152/**
153 * audio_stream_out is the abstraction interface for the audio output hardware.
154 *
155 * It provides information about various properties of the audio output
156 * hardware driver.
157 */
158
159struct audio_stream_out {
160 struct audio_stream common;
161
162 /**
163 * return the audio hardware driver latency in milli seconds.
164 */
165 uint32_t (*get_latency)(const struct audio_stream_out *stream);
166
167 /**
168 * Use this method in situations where audio mixing is done in the
169 * hardware. This method serves as a direct interface with hardware,
170 * allowing you to directly set the volume as apposed to via the framework.
171 * This method might produce multiple PCM outputs or hardware accelerated
172 * codecs, such as MP3 or AAC.
173 */
174 int (*set_volume)(struct audio_stream_out *stream, float left, float right);
175
176 /**
177 * write audio buffer to driver. Returns number of bytes written
178 */
179 ssize_t (*write)(struct audio_stream_out *stream, const void* buffer,
180 size_t bytes);
181
182 /* return the number of audio frames written by the audio dsp to DAC since
183 * the output has exited standby
184 */
185 int (*get_render_position)(const struct audio_stream_out *stream,
186 uint32_t *dsp_frames);
187};
188typedef struct audio_stream_out audio_stream_out_t;
189
190struct audio_stream_in {
191 struct audio_stream common;
192
193 /** set the input gain for the audio driver. This method is for
194 * for future use */
195 int (*set_gain)(struct audio_stream_in *stream, float gain);
196
197 /** read audio buffer in from audio driver */
198 ssize_t (*read)(struct audio_stream_in *stream, void* buffer,
199 size_t bytes);
200
201 /**
202 * Return the amount of input frames lost in the audio driver since the
203 * last call of this function.
204 * Audio driver is expected to reset the value to 0 and restart counting
205 * upon returning the current value by this function call.
206 * Such loss typically occurs when the user space process is blocked
207 * longer than the capacity of audio driver buffers.
208 *
209 * Unit: the number of input audio frames
210 */
211 uint32_t (*get_input_frames_lost)(struct audio_stream_in *stream);
212};
213typedef struct audio_stream_in audio_stream_in_t;
214
215/**
216 * return the frame size (number of bytes per sample).
217 */
218static inline uint32_t audio_stream_frame_size(struct audio_stream *s)
219{
220 int chan_samp_sz;
221
222 switch (s->get_format(s)) {
223 case AUDIO_FORMAT_PCM_16_BIT:
224 chan_samp_sz = sizeof(int16_t);
225 break;
226 case AUDIO_FORMAT_PCM_8_BIT:
227 default:
228 chan_samp_sz = sizeof(int8_t);
229 break;
230 }
231
232 return popcount(s->get_channels(s)) * chan_samp_sz;
233}
234
235
236/**********************************************************************/
237
238/**
239 * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM
240 * and the fields of this data structure must begin with hw_module_t
241 * followed by module specific information.
242 */
243struct audio_module {
244 struct hw_module_t common;
245};
246
247struct audio_hw_device {
248 struct hw_device_t common;
249
250 /**
251 * used by audio flinger to enumerate what devices are supported by
252 * each audio_hw_device implementation.
253 *
254 * Return value is a bitmask of 1 or more values of audio_devices_t
255 */
256 uint32_t (*get_supported_devices)(const struct audio_hw_device *dev);
257
258 /**
259 * check to see if the audio hardware interface has been initialized.
260 * returns 0 on success, -ENODEV on failure.
261 */
262 int (*init_check)(const struct audio_hw_device *dev);
263
264 /** set the audio volume of a voice call. Range is between 0.0 and 1.0 */
265 int (*set_voice_volume)(struct audio_hw_device *dev, float volume);
266
267 /**
268 * set the audio volume for all audio activities other than voice call.
269 * Range between 0.0 and 1.0. If any value other than 0 is returned,
270 * the software mixer will emulate this capability.
271 */
272 int (*set_master_volume)(struct audio_hw_device *dev, float volume);
273
274 /**
275 * setMode is called when the audio mode changes. AUDIO_MODE_NORMAL mode
276 * is for standard audio playback, AUDIO_MODE_RINGTONE when a ringtone is
277 * playing, and AUDIO_MODE_IN_CALL when a call is in progress.
278 */
279 int (*set_mode)(struct audio_hw_device *dev, int mode);
280
281 /* mic mute */
282 int (*set_mic_mute)(struct audio_hw_device *dev, bool state);
283 int (*get_mic_mute)(const struct audio_hw_device *dev, bool *state);
284
285 /* set/get global audio parameters */
286 int (*set_parameters)(struct audio_hw_device *dev, const char *kv_pairs);
287
288 /*
289 * Returns a pointer to a heap allocated string. The caller is responsible
290 * for freeing the memory for it.
291 */
292 char * (*get_parameters)(const struct audio_hw_device *dev,
293 const char *keys);
294
295 /* Returns audio input buffer size according to parameters passed or
296 * 0 if one of the parameters is not supported
297 */
298 size_t (*get_input_buffer_size)(const struct audio_hw_device *dev,
299 uint32_t sample_rate, int format,
300 int channel_count);
301
302 /** This method creates and opens the audio hardware output stream */
303 int (*open_output_stream)(struct audio_hw_device *dev, uint32_t devices,
304 int *format, uint32_t *channels,
305 uint32_t *sample_rate,
306 struct audio_stream_out **out);
307
308 void (*close_output_stream)(struct audio_hw_device *dev,
309 struct audio_stream_out* out);
310
311 /** This method creates and opens the audio hardware input stream */
312 int (*open_input_stream)(struct audio_hw_device *dev, uint32_t devices,
313 int *format, uint32_t *channels,
314 uint32_t *sample_rate,
315 audio_in_acoustics_t acoustics,
316 struct audio_stream_in **stream_in);
317
318 void (*close_input_stream)(struct audio_hw_device *dev,
319 struct audio_stream_in *in);
320
321 /** This method dumps the state of the audio hardware */
322 int (*dump)(const struct audio_hw_device *dev, int fd);
323};
324typedef struct audio_hw_device audio_hw_device_t;
325
326/** convenience API for opening and closing a supported device */
327
328static inline int audio_hw_device_open(const struct hw_module_t* module,
329 struct audio_hw_device** device)
330{
331 return module->methods->open(module, AUDIO_HARDWARE_INTERFACE,
332 (struct hw_device_t**)device);
333}
334
335static inline int audio_hw_device_close(struct audio_hw_device* device)
336{
337 return device->common.close(&device->common);
338}
339
340
341__END_DECLS
342
343#endif // ANDROID_AUDIO_INTERFACE_H
3440
=== removed file '3rd_party/android-deps/hardware/audio_effect.h'
--- 3rd_party/android-deps/hardware/audio_effect.h 2013-01-08 17:44:16 +0000
+++ 3rd_party/android-deps/hardware/audio_effect.h 1970-01-01 00:00:00 +0000
@@ -1,897 +0,0 @@
1/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17
18#ifndef ANDROID_AUDIO_EFFECT_H
19#define ANDROID_AUDIO_EFFECT_H
20
21#include <errno.h>
22#include <stdint.h>
23#include <strings.h>
24#include <sys/cdefs.h>
25#include <sys/types.h>
26
27#include <cutils/bitops.h>
28
29#include <system/audio.h>
30
31
32__BEGIN_DECLS
33
34
35/////////////////////////////////////////////////
36// Common Definitions
37/////////////////////////////////////////////////
38
39//
40//--- Effect descriptor structure effect_descriptor_t
41//
42
43// Unique effect ID (can be generated from the following site:
44// http://www.itu.int/ITU-T/asn1/uuid.html)
45// This format is used for both "type" and "uuid" fields of the effect descriptor structure.
46// - When used for effect type and the engine is implementing and effect corresponding to a standard
47// OpenSL ES interface, this ID must be the one defined in OpenSLES_IID.h for that interface.
48// - When used as uuid, it should be a unique UUID for this particular implementation.
49typedef struct effect_uuid_s {
50 uint32_t timeLow;
51 uint16_t timeMid;
52 uint16_t timeHiAndVersion;
53 uint16_t clockSeq;
54 uint8_t node[6];
55} effect_uuid_t;
56
57// Maximum length of character strings in structures defines by this API.
58#define EFFECT_STRING_LEN_MAX 64
59
60// NULL UUID definition (matches SL_IID_NULL_)
61#define EFFECT_UUID_INITIALIZER { 0xec7178ec, 0xe5e1, 0x4432, 0xa3f4, \
62 { 0x46, 0x57, 0xe6, 0x79, 0x52, 0x10 } }
63static const effect_uuid_t EFFECT_UUID_NULL_ = EFFECT_UUID_INITIALIZER;
64const effect_uuid_t * const EFFECT_UUID_NULL = &EFFECT_UUID_NULL_;
65const char * const EFFECT_UUID_NULL_STR = "ec7178ec-e5e1-4432-a3f4-4657e6795210";
66
67// The effect descriptor contains necessary information to facilitate the enumeration of the effect
68// engines present in a library.
69typedef struct effect_descriptor_s {
70 effect_uuid_t type; // UUID of to the OpenSL ES interface implemented by this effect
71 effect_uuid_t uuid; // UUID for this particular implementation
72 uint32_t apiVersion; // Version of the effect control API implemented
73 uint32_t flags; // effect engine capabilities/requirements flags (see below)
74 uint16_t cpuLoad; // CPU load indication (see below)
75 uint16_t memoryUsage; // Data Memory usage (see below)
76 char name[EFFECT_STRING_LEN_MAX]; // human readable effect name
77 char implementor[EFFECT_STRING_LEN_MAX]; // human readable effect implementor name
78} effect_descriptor_t;
79
80// CPU load and memory usage indication: each effect implementation must provide an indication of
81// its CPU and memory usage for the audio effect framework to limit the number of effects
82// instantiated at a given time on a given platform.
83// The CPU load is expressed in 0.1 MIPS units as estimated on an ARM9E core (ARMv5TE) with 0 WS.
84// The memory usage is expressed in KB and includes only dynamically allocated memory
85
86// Definitions for flags field of effect descriptor.
87// +---------------------------+-----------+-----------------------------------
88// | description | bits | values
89// +---------------------------+-----------+-----------------------------------
90// | connection mode | 0..2 | 0 insert: after track process
91// | | | 1 auxiliary: connect to track auxiliary
92// | | | output and use send level
93// | | | 2 replace: replaces track process function;
94// | | | must implement SRC, volume and mono to stereo.
95// | | | 3 pre processing: applied below audio HAL on input
96// | | | 4 post processing: applied below audio HAL on output
97// | | | 5 - 7 reserved
98// +---------------------------+-----------+-----------------------------------
99// | insertion preference | 3..5 | 0 none
100// | | | 1 first of the chain
101// | | | 2 last of the chain
102// | | | 3 exclusive (only effect in the insert chain)
103// | | | 4..7 reserved
104// +---------------------------+-----------+-----------------------------------
105// | Volume management | 6..8 | 0 none
106// | | | 1 implements volume control
107// | | | 2 requires volume indication
108// | | | 4 reserved
109// +---------------------------+-----------+-----------------------------------
110// | Device indication | 9..11 | 0 none
111// | | | 1 requires device updates
112// | | | 2, 4 reserved
113// +---------------------------+-----------+-----------------------------------
114// | Sample input mode | 12..13 | 1 direct: process() function or EFFECT_CMD_CONFIGURE
115// | | | command must specify a buffer descriptor
116// | | | 2 provider: process() function uses the
117// | | | bufferProvider indicated by the
118// | | | EFFECT_CMD_CONFIGURE command to request input.
119// | | | buffers.
120// | | | 3 both: both input modes are supported
121// +---------------------------+-----------+-----------------------------------
122// | Sample output mode | 14..15 | 1 direct: process() function or EFFECT_CMD_CONFIGURE
123// | | | command must specify a buffer descriptor
124// | | | 2 provider: process() function uses the
125// | | | bufferProvider indicated by the
126// | | | EFFECT_CMD_CONFIGURE command to request output
127// | | | buffers.
128// | | | 3 both: both output modes are supported
129// +---------------------------+-----------+-----------------------------------
130// | Hardware acceleration | 16..17 | 0 No hardware acceleration
131// | | | 1 non tunneled hw acceleration: the process() function
132// | | | reads the samples, send them to HW accelerated
133// | | | effect processor, reads back the processed samples
134// | | | and returns them to the output buffer.
135// | | | 2 tunneled hw acceleration: the process() function is
136// | | | transparent. The effect interface is only used to
137// | | | control the effect engine. This mode is relevant for
138// | | | global effects actually applied by the audio
139// | | | hardware on the output stream.
140// +---------------------------+-----------+-----------------------------------
141// | Audio Mode indication | 18..19 | 0 none
142// | | | 1 requires audio mode updates
143// | | | 2..3 reserved
144// +---------------------------+-----------+-----------------------------------
145
146// Insert mode
147#define EFFECT_FLAG_TYPE_SHIFT 0
148#define EFFECT_FLAG_TYPE_SIZE 3
149#define EFFECT_FLAG_TYPE_MASK (((1 << EFFECT_FLAG_TYPE_SIZE) -1) \
150 << EFFECT_FLAG_TYPE_SHIFT)
151#define EFFECT_FLAG_TYPE_INSERT (0 << EFFECT_FLAG_TYPE_SHIFT)
152#define EFFECT_FLAG_TYPE_AUXILIARY (1 << EFFECT_FLAG_TYPE_SHIFT)
153#define EFFECT_FLAG_TYPE_REPLACE (2 << EFFECT_FLAG_TYPE_SHIFT)
154#define EFFECT_FLAG_TYPE_PRE_PROC (3 << EFFECT_FLAG_TYPE_SHIFT)
155#define EFFECT_FLAG_TYPE_POST_PROC (4 << EFFECT_FLAG_TYPE_SHIFT)
156
157// Insert preference
158#define EFFECT_FLAG_INSERT_SHIFT (EFFECT_FLAG_TYPE_SHIFT + EFFECT_FLAG_TYPE_SIZE)
159#define EFFECT_FLAG_INSERT_SIZE 3
160#define EFFECT_FLAG_INSERT_MASK (((1 << EFFECT_FLAG_INSERT_SIZE) -1) \
161 << EFFECT_FLAG_INSERT_SHIFT)
162#define EFFECT_FLAG_INSERT_ANY (0 << EFFECT_FLAG_INSERT_SHIFT)
163#define EFFECT_FLAG_INSERT_FIRST (1 << EFFECT_FLAG_INSERT_SHIFT)
164#define EFFECT_FLAG_INSERT_LAST (2 << EFFECT_FLAG_INSERT_SHIFT)
165#define EFFECT_FLAG_INSERT_EXCLUSIVE (3 << EFFECT_FLAG_INSERT_SHIFT)
166
167
168// Volume control
169#define EFFECT_FLAG_VOLUME_SHIFT (EFFECT_FLAG_INSERT_SHIFT + EFFECT_FLAG_INSERT_SIZE)
170#define EFFECT_FLAG_VOLUME_SIZE 3
171#define EFFECT_FLAG_VOLUME_MASK (((1 << EFFECT_FLAG_VOLUME_SIZE) -1) \
172 << EFFECT_FLAG_VOLUME_SHIFT)
173#define EFFECT_FLAG_VOLUME_CTRL (1 << EFFECT_FLAG_VOLUME_SHIFT)
174#define EFFECT_FLAG_VOLUME_IND (2 << EFFECT_FLAG_VOLUME_SHIFT)
175#define EFFECT_FLAG_VOLUME_NONE (0 << EFFECT_FLAG_VOLUME_SHIFT)
176
177// Device indication
178#define EFFECT_FLAG_DEVICE_SHIFT (EFFECT_FLAG_VOLUME_SHIFT + EFFECT_FLAG_VOLUME_SIZE)
179#define EFFECT_FLAG_DEVICE_SIZE 3
180#define EFFECT_FLAG_DEVICE_MASK (((1 << EFFECT_FLAG_DEVICE_SIZE) -1) \
181 << EFFECT_FLAG_DEVICE_SHIFT)
182#define EFFECT_FLAG_DEVICE_IND (1 << EFFECT_FLAG_DEVICE_SHIFT)
183#define EFFECT_FLAG_DEVICE_NONE (0 << EFFECT_FLAG_DEVICE_SHIFT)
184
185// Sample input modes
186#define EFFECT_FLAG_INPUT_SHIFT (EFFECT_FLAG_DEVICE_SHIFT + EFFECT_FLAG_DEVICE_SIZE)
187#define EFFECT_FLAG_INPUT_SIZE 2
188#define EFFECT_FLAG_INPUT_MASK (((1 << EFFECT_FLAG_INPUT_SIZE) -1) \
189 << EFFECT_FLAG_INPUT_SHIFT)
190#define EFFECT_FLAG_INPUT_DIRECT (1 << EFFECT_FLAG_INPUT_SHIFT)
191#define EFFECT_FLAG_INPUT_PROVIDER (2 << EFFECT_FLAG_INPUT_SHIFT)
192#define EFFECT_FLAG_INPUT_BOTH (3 << EFFECT_FLAG_INPUT_SHIFT)
193
194// Sample output modes
195#define EFFECT_FLAG_OUTPUT_SHIFT (EFFECT_FLAG_INPUT_SHIFT + EFFECT_FLAG_INPUT_SIZE)
196#define EFFECT_FLAG_OUTPUT_SIZE 2
197#define EFFECT_FLAG_OUTPUT_MASK (((1 << EFFECT_FLAG_OUTPUT_SIZE) -1) \
198 << EFFECT_FLAG_OUTPUT_SHIFT)
199#define EFFECT_FLAG_OUTPUT_DIRECT (1 << EFFECT_FLAG_OUTPUT_SHIFT)
200#define EFFECT_FLAG_OUTPUT_PROVIDER (2 << EFFECT_FLAG_OUTPUT_SHIFT)
201#define EFFECT_FLAG_OUTPUT_BOTH (3 << EFFECT_FLAG_OUTPUT_SHIFT)
202
203// Hardware acceleration mode
204#define EFFECT_FLAG_HW_ACC_SHIFT (EFFECT_FLAG_OUTPUT_SHIFT + EFFECT_FLAG_OUTPUT_SIZE)
205#define EFFECT_FLAG_HW_ACC_SIZE 2
206#define EFFECT_FLAG_HW_ACC_MASK (((1 << EFFECT_FLAG_HW_ACC_SIZE) -1) \
207 << EFFECT_FLAG_HW_ACC_SHIFT)
208#define EFFECT_FLAG_HW_ACC_SIMPLE (1 << EFFECT_FLAG_HW_ACC_SHIFT)
209#define EFFECT_FLAG_HW_ACC_TUNNEL (2 << EFFECT_FLAG_HW_ACC_SHIFT)
210
211// Audio mode indication
212#define EFFECT_FLAG_AUDIO_MODE_SHIFT (EFFECT_FLAG_HW_ACC_SHIFT + EFFECT_FLAG_HW_ACC_SIZE)
213#define EFFECT_FLAG_AUDIO_MODE_SIZE 2
214#define EFFECT_FLAG_AUDIO_MODE_MASK (((1 << EFFECT_FLAG_AUDIO_MODE_SIZE) -1) \
215 << EFFECT_FLAG_AUDIO_MODE_SHIFT)
216#define EFFECT_FLAG_AUDIO_MODE_IND (1 << EFFECT_FLAG_AUDIO_MODE_SHIFT)
217#define EFFECT_FLAG_AUDIO_MODE_NONE (0 << EFFECT_FLAG_AUDIO_MODE_SHIFT)
218
219
220#define EFFECT_MAKE_API_VERSION(M, m) (((M)<<16) | ((m) & 0xFFFF))
221#define EFFECT_API_VERSION_MAJOR(v) ((v)>>16)
222#define EFFECT_API_VERSION_MINOR(v) ((m) & 0xFFFF)
223
224
225
226/////////////////////////////////////////////////
227// Effect control interface
228/////////////////////////////////////////////////
229
230// Effect control interface version 2.0
231#define EFFECT_CONTROL_API_VERSION EFFECT_MAKE_API_VERSION(2,0)
232
233// Effect control interface structure: effect_interface_s
234// The effect control interface is exposed by each effect engine implementation. It consists of
235// a set of functions controlling the configuration, activation and process of the engine.
236// The functions are grouped in a structure of type effect_interface_s.
237//
238// Effect control interface handle: effect_handle_t
239// The effect_handle_t serves two purposes regarding the implementation of the effect engine:
240// - 1 it is the address of a pointer to an effect_interface_s structure where the functions
241// of the effect control API for a particular effect are located.
242// - 2 it is the address of the context of a particular effect instance.
243// A typical implementation in the effect library would define a structure as follows:
244// struct effect_module_s {
245// const struct effect_interface_s *itfe;
246// effect_config_t config;
247// effect_context_t context;
248// }
249// The implementation of EffectCreate() function would then allocate a structure of this
250// type and return its address as effect_handle_t
251typedef struct effect_interface_s **effect_handle_t;
252
253
254// Forward definition of type audio_buffer_t
255typedef struct audio_buffer_s audio_buffer_t;
256
257
258
259
260
261
262// Effect control interface definition
263struct effect_interface_s {
264 ////////////////////////////////////////////////////////////////////////////////
265 //
266 // Function: process
267 //
268 // Description: Effect process function. Takes input samples as specified
269 // (count and location) in input buffer descriptor and output processed
270 // samples as specified in output buffer descriptor. If the buffer descriptor
271 // is not specified the function must use either the buffer or the
272 // buffer provider function installed by the EFFECT_CMD_CONFIGURE command.
273 // The effect framework will call the process() function after the EFFECT_CMD_ENABLE
274 // command is received and until the EFFECT_CMD_DISABLE is received. When the engine
275 // receives the EFFECT_CMD_DISABLE command it should turn off the effect gracefully
276 // and when done indicate that it is OK to stop calling the process() function by
277 // returning the -ENODATA status.
278 //
279 // NOTE: the process() function implementation should be "real-time safe" that is
280 // it should not perform blocking calls: malloc/free, sleep, read/write/open/close,
281 // pthread_cond_wait/pthread_mutex_lock...
282 //
283 // Input:
284 // self: handle to the effect interface this function
285 // is called on.
286 // inBuffer: buffer descriptor indicating where to read samples to process.
287 // If NULL, use the configuration passed by EFFECT_CMD_CONFIGURE command.
288 //
289 // outBuffer: buffer descriptor indicating where to write processed samples.
290 // If NULL, use the configuration passed by EFFECT_CMD_CONFIGURE command.
291 //
292 // Output:
293 // returned value: 0 successful operation
294 // -ENODATA the engine has finished the disable phase and the framework
295 // can stop calling process()
296 // -EINVAL invalid interface handle or
297 // invalid input/output buffer description
298 ////////////////////////////////////////////////////////////////////////////////
299 int32_t (*process)(effect_handle_t self,
300 audio_buffer_t *inBuffer,
301 audio_buffer_t *outBuffer);
302 ////////////////////////////////////////////////////////////////////////////////
303 //
304 // Function: command
305 //
306 // Description: Send a command and receive a response to/from effect engine.
307 //
308 // Input:
309 // self: handle to the effect interface this function
310 // is called on.
311 // cmdCode: command code: the command can be a standardized command defined in
312 // effect_command_e (see below) or a proprietary command.
313 // cmdSize: size of command in bytes
314 // pCmdData: pointer to command data
315 // pReplyData: pointer to reply data
316 //
317 // Input/Output:
318 // replySize: maximum size of reply data as input
319 // actual size of reply data as output
320 //
321 // Output:
322 // returned value: 0 successful operation
323 // -EINVAL invalid interface handle or
324 // invalid command/reply size or format according to command code
325 // The return code should be restricted to indicate problems related to the this
326 // API specification. Status related to the execution of a particular command should be
327 // indicated as part of the reply field.
328 //
329 // *pReplyData updated with command response
330 //
331 ////////////////////////////////////////////////////////////////////////////////
332 int32_t (*command)(effect_handle_t self,
333 uint32_t cmdCode,
334 uint32_t cmdSize,
335 void *pCmdData,
336 uint32_t *replySize,
337 void *pReplyData);
338 ////////////////////////////////////////////////////////////////////////////////
339 //
340 // Function: get_descriptor
341 //
342 // Description: Returns the effect descriptor
343 //
344 // Input:
345 // self: handle to the effect interface this function
346 // is called on.
347 //
348 // Input/Output:
349 // pDescriptor: address where to return the effect descriptor.
350 //
351 // Output:
352 // returned value: 0 successful operation.
353 // -EINVAL invalid interface handle or invalid pDescriptor
354 // *pDescriptor: updated with the effect descriptor.
355 //
356 ////////////////////////////////////////////////////////////////////////////////
357 int32_t (*get_descriptor)(effect_handle_t self,
358 effect_descriptor_t *pDescriptor);
359 ////////////////////////////////////////////////////////////////////////////////
360 //
361 // Function: process_reverse
362 //
363 // Description: Process reverse stream function. This function is used to pass
364 // a reference stream to the effect engine. If the engine does not need a reference
365 // stream, this function pointer can be set to NULL.
366 // This function would typically implemented by an Echo Canceler.
367 //
368 // Input:
369 // self: handle to the effect interface this function
370 // is called on.
371 // inBuffer: buffer descriptor indicating where to read samples to process.
372 // If NULL, use the configuration passed by EFFECT_CMD_CONFIGURE_REVERSE command.
373 //
374 // outBuffer: buffer descriptor indicating where to write processed samples.
375 // If NULL, use the configuration passed by EFFECT_CMD_CONFIGURE_REVERSE command.
376 // If the buffer and buffer provider in the configuration received by
377 // EFFECT_CMD_CONFIGURE_REVERSE are also NULL, do not return modified reverse
378 // stream data
379 //
380 // Output:
381 // returned value: 0 successful operation
382 // -ENODATA the engine has finished the disable phase and the framework
383 // can stop calling process_reverse()
384 // -EINVAL invalid interface handle or
385 // invalid input/output buffer description
386 ////////////////////////////////////////////////////////////////////////////////
387 int32_t (*process_reverse)(effect_handle_t self,
388 audio_buffer_t *inBuffer,
389 audio_buffer_t *outBuffer);
390};
391
392
393//
394//--- Standardized command codes for command() function
395//
396enum effect_command_e {
397 EFFECT_CMD_INIT, // initialize effect engine
398 EFFECT_CMD_CONFIGURE, // configure effect engine (see effect_config_t)
399 EFFECT_CMD_RESET, // reset effect engine
400 EFFECT_CMD_ENABLE, // enable effect process
401 EFFECT_CMD_DISABLE, // disable effect process
402 EFFECT_CMD_SET_PARAM, // set parameter immediately (see effect_param_t)
403 EFFECT_CMD_SET_PARAM_DEFERRED, // set parameter deferred
404 EFFECT_CMD_SET_PARAM_COMMIT, // commit previous set parameter deferred
405 EFFECT_CMD_GET_PARAM, // get parameter
406 EFFECT_CMD_SET_DEVICE, // set audio device (see audio.h, audio_devices_t)
407 EFFECT_CMD_SET_VOLUME, // set volume
408 EFFECT_CMD_SET_AUDIO_MODE, // set the audio mode (normal, ring, ...)
409 EFFECT_CMD_CONFIGURE_REVERSE, // configure effect engine reverse stream(see effect_config_t)
410 EFFECT_CMD_SET_INPUT_DEVICE, // set capture device (see audio.h, audio_devices_t)
411 EFFECT_CMD_FIRST_PROPRIETARY = 0x10000 // first proprietary command code
412};
413
414//==================================================================================================
415// command: EFFECT_CMD_INIT
416//--------------------------------------------------------------------------------------------------
417// description:
418// Initialize effect engine: All configurations return to default
419//--------------------------------------------------------------------------------------------------
420// command format:
421// size: 0
422// data: N/A
423//--------------------------------------------------------------------------------------------------
424// reply format:
425// size: sizeof(int)
426// data: status
427//==================================================================================================
428// command: EFFECT_CMD_CONFIGURE
429//--------------------------------------------------------------------------------------------------
430// description:
431// Apply new audio parameters configurations for input and output buffers
432//--------------------------------------------------------------------------------------------------
433// command format:
434// size: sizeof(effect_config_t)
435// data: effect_config_t
436//--------------------------------------------------------------------------------------------------
437// reply format:
438// size: sizeof(int)
439// data: status
440//==================================================================================================
441// command: EFFECT_CMD_RESET
442//--------------------------------------------------------------------------------------------------
443// description:
444// Reset the effect engine. Keep configuration but resets state and buffer content
445//--------------------------------------------------------------------------------------------------
446// command format:
447// size: 0
448// data: N/A
449//--------------------------------------------------------------------------------------------------
450// reply format:
451// size: 0
452// data: N/A
453//==================================================================================================
454// command: EFFECT_CMD_ENABLE
455//--------------------------------------------------------------------------------------------------
456// description:
457// Enable the process. Called by the framework before the first call to process()
458//--------------------------------------------------------------------------------------------------
459// command format:
460// size: 0
461// data: N/A
462//--------------------------------------------------------------------------------------------------
463// reply format:
464// size: sizeof(int)
465// data: status
466//==================================================================================================
467// command: EFFECT_CMD_DISABLE
468//--------------------------------------------------------------------------------------------------
469// description:
470// Disable the process. Called by the framework after the last call to process()
471//--------------------------------------------------------------------------------------------------
472// command format:
473// size: 0
474// data: N/A
475//--------------------------------------------------------------------------------------------------
476// reply format:
477// size: sizeof(int)
478// data: status
479//==================================================================================================
480// command: EFFECT_CMD_SET_PARAM
481//--------------------------------------------------------------------------------------------------
482// description:
483// Set a parameter and apply it immediately
484//--------------------------------------------------------------------------------------------------
485// command format:
486// size: sizeof(effect_param_t) + size of param and value
487// data: effect_param_t + param + value. See effect_param_t definition below for value offset
488//--------------------------------------------------------------------------------------------------
489// reply format:
490// size: sizeof(int)
491// data: status
492//==================================================================================================
493// command: EFFECT_CMD_SET_PARAM_DEFERRED
494//--------------------------------------------------------------------------------------------------
495// description:
496// Set a parameter but apply it only when receiving EFFECT_CMD_SET_PARAM_COMMIT command
497//--------------------------------------------------------------------------------------------------
498// command format:
499// size: sizeof(effect_param_t) + size of param and value
500// data: effect_param_t + param + value. See effect_param_t definition below for value offset
501//--------------------------------------------------------------------------------------------------
502// reply format:
503// size: 0
504// data: N/A
505//==================================================================================================
506// command: EFFECT_CMD_SET_PARAM_COMMIT
507//--------------------------------------------------------------------------------------------------
508// description:
509// Apply all previously received EFFECT_CMD_SET_PARAM_DEFERRED commands
510//--------------------------------------------------------------------------------------------------
511// command format:
512// size: 0
513// data: N/A
514//--------------------------------------------------------------------------------------------------
515// reply format:
516// size: sizeof(int)
517// data: status
518//==================================================================================================
519// command: EFFECT_CMD_GET_PARAM
520//--------------------------------------------------------------------------------------------------
521// description:
522// Get a parameter value
523//--------------------------------------------------------------------------------------------------
524// command format:
525// size: sizeof(effect_param_t) + size of param
526// data: effect_param_t + param
527//--------------------------------------------------------------------------------------------------
528// reply format:
529// size: sizeof(effect_param_t) + size of param and value
530// data: effect_param_t + param + value. See effect_param_t definition below for value offset
531//==================================================================================================
532// command: EFFECT_CMD_SET_DEVICE
533//--------------------------------------------------------------------------------------------------
534// description:
535// Set the rendering device the audio output path is connected to. See audio.h, audio_devices_t
536// for device values.
537// The effect implementation must set EFFECT_FLAG_DEVICE_IND flag in its descriptor to receive this
538// command when the device changes
539//--------------------------------------------------------------------------------------------------
540// command format:
541// size: sizeof(uint32_t)
542// data: uint32_t
543//--------------------------------------------------------------------------------------------------
544// reply format:
545// size: 0
546// data: N/A
547//==================================================================================================
548// command: EFFECT_CMD_SET_VOLUME
549//--------------------------------------------------------------------------------------------------
550// description:
551// Set and get volume. Used by audio framework to delegate volume control to effect engine.
552// The effect implementation must set EFFECT_FLAG_VOLUME_IND or EFFECT_FLAG_VOLUME_CTRL flag in
553// its descriptor to receive this command before every call to process() function
554// If EFFECT_FLAG_VOLUME_CTRL flag is set in the effect descriptor, the effect engine must return
555// the volume that should be applied before the effect is processed. The overall volume (the volume
556// actually applied by the effect engine multiplied by the returned value) should match the value
557// indicated in the command.
558//--------------------------------------------------------------------------------------------------
559// command format:
560// size: n * sizeof(uint32_t)
561// data: volume for each channel defined in effect_config_t for output buffer expressed in
562// 8.24 fixed point format
563//--------------------------------------------------------------------------------------------------
564// reply format:
565// size: n * sizeof(uint32_t) / 0
566// data: - if EFFECT_FLAG_VOLUME_CTRL is set in effect descriptor:
567// volume for each channel defined in effect_config_t for output buffer expressed in
568// 8.24 fixed point format
569// - if EFFECT_FLAG_VOLUME_CTRL is not set in effect descriptor:
570// N/A
571// It is legal to receive a null pointer as pReplyData in which case the effect framework has
572// delegated volume control to another effect
573//==================================================================================================
574// command: EFFECT_CMD_SET_AUDIO_MODE
575//--------------------------------------------------------------------------------------------------
576// description:
577// Set the audio mode. The effect implementation must set EFFECT_FLAG_AUDIO_MODE_IND flag in its
578// descriptor to receive this command when the audio mode changes.
579//--------------------------------------------------------------------------------------------------
580// command format:
581// size: sizeof(uint32_t)
582// data: audio_mode_e
583//--------------------------------------------------------------------------------------------------
584// reply format:
585// size: 0
586// data: N/A
587//==================================================================================================
588// command: EFFECT_CMD_CONFIGURE_REVERSE
589//--------------------------------------------------------------------------------------------------
590// description:
591// Apply new audio parameters configurations for input and output buffers of reverse stream
592//--------------------------------------------------------------------------------------------------
593// command format:
594// size: sizeof(effect_config_t)
595// data: effect_config_t
596//--------------------------------------------------------------------------------------------------
597// reply format:
598// size: sizeof(int)
599// data: status
600//==================================================================================================
601// command: EFFECT_CMD_SET_INPUT_DEVICE
602//--------------------------------------------------------------------------------------------------
603// description:
604// Set the capture device the audio input path is connected to. See audio.h, audio_devices_t
605// for device values.
606// The effect implementation must set EFFECT_FLAG_DEVICE_IND flag in its descriptor to receive this
607// command when the device changes
608//--------------------------------------------------------------------------------------------------
609// command format:
610// size: sizeof(uint32_t)
611// data: uint32_t
612//--------------------------------------------------------------------------------------------------
613// reply format:
614// size: 0
615// data: N/A
616//==================================================================================================
617// command: EFFECT_CMD_FIRST_PROPRIETARY
618//--------------------------------------------------------------------------------------------------
619// description:
620// All proprietary effect commands must use command codes above this value. The size and format of
621// command and response fields is free in this case
622//==================================================================================================
623
624
625// Audio buffer descriptor used by process(), bufferProvider() functions and buffer_config_t
626// structure. Multi-channel audio is always interleaved. The channel order is from LSB to MSB with
627// regard to the channel mask definition in audio.h, audio_channels_t e.g :
628// Stereo: left, right
629// 5 point 1: front left, front right, front center, low frequency, back left, back right
630// The buffer size is expressed in frame count, a frame being composed of samples for all
631// channels at a given time. Frame size for unspecified format (AUDIO_FORMAT_OTHER) is 8 bit by
632// definition
633struct audio_buffer_s {
634 size_t frameCount; // number of frames in buffer
635 union {
636 void* raw; // raw pointer to start of buffer
637 int32_t* s32; // pointer to signed 32 bit data at start of buffer
638 int16_t* s16; // pointer to signed 16 bit data at start of buffer
639 uint8_t* u8; // pointer to unsigned 8 bit data at start of buffer
640 };
641};
642
643// The buffer_provider_s structure contains functions that can be used
644// by the effect engine process() function to query and release input
645// or output audio buffer.
646// The getBuffer() function is called to retrieve a buffer where data
647// should read from or written to by process() function.
648// The releaseBuffer() function MUST be called when the buffer retrieved
649// with getBuffer() is not needed anymore.
650// The process function should use the buffer provider mechanism to retrieve
651// input or output buffer if the inBuffer or outBuffer passed as argument is NULL
652// and the buffer configuration (buffer_config_t) given by the EFFECT_CMD_CONFIGURE
653// command did not specify an audio buffer.
654
655typedef int32_t (* buffer_function_t)(void *cookie, audio_buffer_t *buffer);
656
657typedef struct buffer_provider_s {
658 buffer_function_t getBuffer; // retrieve next buffer
659 buffer_function_t releaseBuffer; // release used buffer
660 void *cookie; // for use by client of buffer provider functions
661} buffer_provider_t;
662
663
664// The buffer_config_s structure specifies the input or output audio format
665// to be used by the effect engine. It is part of the effect_config_t
666// structure that defines both input and output buffer configurations and is
667// passed by the EFFECT_CMD_CONFIGURE or EFFECT_CMD_CONFIGURE_REVERSE command.
668typedef struct buffer_config_s {
669 audio_buffer_t buffer; // buffer for use by process() function if not passed explicitly
670 uint32_t samplingRate; // sampling rate
671 uint32_t channels; // channel mask (see audio_channels_t in audio.h)
672 buffer_provider_t bufferProvider; // buffer provider
673 uint8_t format; // Audio format (see see audio_format_t in audio.h)
674 uint8_t accessMode; // read/write or accumulate in buffer (effect_buffer_access_e)
675 uint16_t mask; // indicates which of the above fields is valid
676} buffer_config_t;
677
678// Values for "accessMode" field of buffer_config_t:
679// overwrite, read only, accumulate (read/modify/write)
680enum effect_buffer_access_e {
681 EFFECT_BUFFER_ACCESS_WRITE,
682 EFFECT_BUFFER_ACCESS_READ,
683 EFFECT_BUFFER_ACCESS_ACCUMULATE
684
685};
686
687// Values for bit field "mask" in buffer_config_t. If a bit is set, the corresponding field
688// in buffer_config_t must be taken into account when executing the EFFECT_CMD_CONFIGURE command
689#define EFFECT_CONFIG_BUFFER 0x0001 // buffer field must be taken into account
690#define EFFECT_CONFIG_SMP_RATE 0x0002 // samplingRate field must be taken into account
691#define EFFECT_CONFIG_CHANNELS 0x0004 // channels field must be taken into account
692#define EFFECT_CONFIG_FORMAT 0x0008 // format field must be taken into account
693#define EFFECT_CONFIG_ACC_MODE 0x0010 // accessMode field must be taken into account
694#define EFFECT_CONFIG_PROVIDER 0x0020 // bufferProvider field must be taken into account
695#define EFFECT_CONFIG_ALL (EFFECT_CONFIG_BUFFER | EFFECT_CONFIG_SMP_RATE | \
696 EFFECT_CONFIG_CHANNELS | EFFECT_CONFIG_FORMAT | \
697 EFFECT_CONFIG_ACC_MODE | EFFECT_CONFIG_PROVIDER)
698
699
700// effect_config_s structure describes the format of the pCmdData argument of EFFECT_CMD_CONFIGURE
701// command to configure audio parameters and buffers for effect engine input and output.
702typedef struct effect_config_s {
703 buffer_config_t inputCfg;
704 buffer_config_t outputCfg;
705} effect_config_t;
706
707
708// effect_param_s structure describes the format of the pCmdData argument of EFFECT_CMD_SET_PARAM
709// command and pCmdData and pReplyData of EFFECT_CMD_GET_PARAM command.
710// psize and vsize represent the actual size of parameter and value.
711//
712// NOTE: the start of value field inside the data field is always on a 32 bit boundary:
713//
714// +-----------+
715// | status | sizeof(int)
716// +-----------+
717// | psize | sizeof(int)
718// +-----------+
719// | vsize | sizeof(int)
720// +-----------+
721// | | | |
722// ~ parameter ~ > psize |
723// | | | > ((psize - 1)/sizeof(int) + 1) * sizeof(int)
724// +-----------+ |
725// | padding | |
726// +-----------+
727// | | |
728// ~ value ~ > vsize
729// | | |
730// +-----------+
731
732typedef struct effect_param_s {
733 int32_t status; // Transaction status (unused for command, used for reply)
734 uint32_t psize; // Parameter size
735 uint32_t vsize; // Value size
736 char data[]; // Start of Parameter + Value data
737} effect_param_t;
738
739
740
741/////////////////////////////////////////////////
742// Effect library interface
743/////////////////////////////////////////////////
744
745// Effect library interface version 2.0
746#define EFFECT_LIBRARY_API_VERSION EFFECT_MAKE_API_VERSION(2,0)
747
748#define AUDIO_EFFECT_LIBRARY_TAG ((('A') << 24) | (('E') << 16) | (('L') << 8) | ('T'))
749
750// Every effect library must have a data structure named AUDIO_EFFECT_LIBRARY_INFO_SYM
751// and the fields of this data structure must begin with audio_effect_library_t
752
753typedef struct audio_effect_library_s {
754 // tag must be initialized to AUDIO_EFFECT_LIBRARY_TAG
755 uint32_t tag;
756 // Version of the effect library API : 0xMMMMmmmm MMMM: Major, mmmm: minor
757 uint32_t version;
758 // Name of this library
759 const char *name;
760 // Author/owner/implementor of the library
761 const char *implementor;
762
763 ////////////////////////////////////////////////////////////////////////////////
764 //
765 // Function: query_num_effects
766 //
767 // Description: Returns the number of different effects exposed by the
768 // library. Each effect must have a unique effect uuid (see
769 // effect_descriptor_t). This function together with EffectQueryEffect()
770 // is used to enumerate all effects present in the library.
771 //
772 // Input/Output:
773 // pNumEffects: address where the number of effects should be returned.
774 //
775 // Output:
776 // returned value: 0 successful operation.
777 // -ENODEV library failed to initialize
778 // -EINVAL invalid pNumEffects
779 // *pNumEffects: updated with number of effects in library
780 //
781 ////////////////////////////////////////////////////////////////////////////////
782 int32_t (*query_num_effects)(uint32_t *pNumEffects);
783
784 ////////////////////////////////////////////////////////////////////////////////
785 //
786 // Function: query_effect
787 //
788 // Description: Returns the descriptor of the effect engine which index is
789 // given as argument.
790 // See effect_descriptor_t for details on effect descriptors.
791 // This function together with EffectQueryNumberEffects() is used to enumerate all
792 // effects present in the library. The enumeration sequence is:
793 // EffectQueryNumberEffects(&num_effects);
794 // for (i = 0; i < num_effects; i++)
795 // EffectQueryEffect(i,...);
796 //
797 // Input/Output:
798 // index: index of the effect
799 // pDescriptor: address where to return the effect descriptor.
800 //
801 // Output:
802 // returned value: 0 successful operation.
803 // -ENODEV library failed to initialize
804 // -EINVAL invalid pDescriptor or index
805 // -ENOSYS effect list has changed since last execution of
806 // EffectQueryNumberEffects()
807 // -ENOENT no more effect available
808 // *pDescriptor: updated with the effect descriptor.
809 //
810 ////////////////////////////////////////////////////////////////////////////////
811 int32_t (*query_effect)(uint32_t index,
812 effect_descriptor_t *pDescriptor);
813
814 ////////////////////////////////////////////////////////////////////////////////
815 //
816 // Function: create_effect
817 //
818 // Description: Creates an effect engine of the specified implementation uuid and
819 // returns an effect control interface on this engine. The function will allocate the
820 // resources for an instance of the requested effect engine and return
821 // a handle on the effect control interface.
822 //
823 // Input:
824 // uuid: pointer to the effect uuid.
825 // sessionId: audio session to which this effect instance will be attached. All effects
826 // created with the same session ID are connected in series and process the same signal
827 // stream. Knowing that two effects are part of the same effect chain can help the
828 // library implement some kind of optimizations.
829 // ioId: identifies the output or input stream this effect is directed to at audio HAL.
830 // For future use especially with tunneled HW accelerated effects
831 //
832 // Input/Output:
833 // pHandle: address where to return the effect interface handle.
834 //
835 // Output:
836 // returned value: 0 successful operation.
837 // -ENODEV library failed to initialize
838 // -EINVAL invalid pEffectUuid or pHandle
839 // -ENOENT no effect with this uuid found
840 // *pHandle: updated with the effect interface handle.
841 //
842 ////////////////////////////////////////////////////////////////////////////////
843 int32_t (*create_effect)(effect_uuid_t *uuid,
844 int32_t sessionId,
845 int32_t ioId,
846 effect_handle_t *pHandle);
847
848 ////////////////////////////////////////////////////////////////////////////////
849 //
850 // Function: release_effect
851 //
852 // Description: Releases the effect engine whose handle is given as argument.
853 // All resources allocated to this particular instance of the effect are
854 // released.
855 //
856 // Input:
857 // handle: handle on the effect interface to be released.
858 //
859 // Output:
860 // returned value: 0 successful operation.
861 // -ENODEV library failed to initialize
862 // -EINVAL invalid interface handle
863 //
864 ////////////////////////////////////////////////////////////////////////////////
865 int32_t (*release_effect)(effect_handle_t handle);
866
867 ////////////////////////////////////////////////////////////////////////////////
868 //
869 // Function: get_descriptor
870 //
871 // Description: Returns the descriptor of the effect engine which implementation UUID is
872 // given as argument.
873 //
874 // Input/Output:
875 // uuid: pointer to the effect uuid.
876 // pDescriptor: address where to return the effect descriptor.
877 //
878 // Output:
879 // returned value: 0 successful operation.
880 // -ENODEV library failed to initialize
881 // -EINVAL invalid pDescriptor or uuid
882 // *pDescriptor: updated with the effect descriptor.
883 //
884 ////////////////////////////////////////////////////////////////////////////////
885 int32_t (*get_descriptor)(effect_uuid_t *uuid,
886 effect_descriptor_t *pDescriptor);
887} audio_effect_library_t;
888
889// Name of the hal_module_info
890#define AUDIO_EFFECT_LIBRARY_INFO_SYM AELI
891
892// Name of the hal_module_info as a string
893#define AUDIO_EFFECT_LIBRARY_INFO_SYM_AS_STR "AELI"
894
895__END_DECLS
896
897#endif // ANDROID_AUDIO_EFFECT_H
8980
=== removed file '3rd_party/android-deps/hardware/audio_policy.h'
--- 3rd_party/android-deps/hardware/audio_policy.h 2013-01-08 17:44:16 +0000
+++ 3rd_party/android-deps/hardware/audio_policy.h 1970-01-01 00:00:00 +0000
@@ -1,386 +0,0 @@
1/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17
18#ifndef ANDROID_AUDIO_POLICY_INTERFACE_H
19#define ANDROID_AUDIO_POLICY_INTERFACE_H
20
21#include <stdint.h>
22#include <sys/cdefs.h>
23#include <sys/types.h>
24
25#include <hardware/hardware.h>
26
27#include <system/audio.h>
28#include <system/audio_policy.h>
29
30__BEGIN_DECLS
31
32/**
33 * The id of this module
34 */
35#define AUDIO_POLICY_HARDWARE_MODULE_ID "audio_policy"
36
37/**
38 * Name of the audio devices to open
39 */
40#define AUDIO_POLICY_INTERFACE "policy"
41
42/* ---------------------------------------------------------------------------- */
43
44/*
45 * The audio_policy and audio_policy_service_ops structs define the
46 * communication interfaces between the platform specific audio policy manager
47 * and Android generic audio policy manager.
48 * The platform specific audio policy manager must implement methods of the
49 * audio_policy struct.
50 * This implementation makes use of the audio_policy_service_ops to control
51 * the activity and configuration of audio input and output streams.
52 *
53 * The platform specific audio policy manager is in charge of the audio
54 * routing and volume control policies for a given platform.
55 * The main roles of this module are:
56 * - keep track of current system state (removable device connections, phone
57 * state, user requests...).
58 * System state changes and user actions are notified to audio policy
59 * manager with methods of the audio_policy.
60 *
61 * - process get_output() queries received when AudioTrack objects are
62 * created: Those queries return a handler on an output that has been
63 * selected, configured and opened by the audio policy manager and that
64 * must be used by the AudioTrack when registering to the AudioFlinger
65 * with the createTrack() method.
66 * When the AudioTrack object is released, a release_output() query
67 * is received and the audio policy manager can decide to close or
68 * reconfigure the output depending on other streams using this output and
69 * current system state.
70 *
71 * - similarly process get_input() and release_input() queries received from
72 * AudioRecord objects and configure audio inputs.
73 * - process volume control requests: the stream volume is converted from
74 * an index value (received from UI) to a float value applicable to each
75 * output as a function of platform specific settings and current output
76 * route (destination device). It also make sure that streams are not
77 * muted if not allowed (e.g. camera shutter sound in some countries).
78 */
79
80/* XXX: this should be defined OUTSIDE of frameworks/base */
81struct effect_descriptor_s;
82
83struct audio_policy {
84 /*
85 * configuration functions
86 */
87
88 /* indicate a change in device connection status */
89 int (*set_device_connection_state)(struct audio_policy *pol,
90 audio_devices_t device,
91 audio_policy_dev_state_t state,
92 const char *device_address);
93
94 /* retreive a device connection status */
95 audio_policy_dev_state_t (*get_device_connection_state)(
96 const struct audio_policy *pol,
97 audio_devices_t device,
98 const char *device_address);
99
100 /* indicate a change in phone state. Valid phones states are defined
101 * by audio_mode_t */
102 void (*set_phone_state)(struct audio_policy *pol, int state);
103
104 /* indicate a change in ringer mode */
105 void (*set_ringer_mode)(struct audio_policy *pol, uint32_t mode,
106 uint32_t mask);
107
108 /* force using a specific device category for the specified usage */
109 void (*set_force_use)(struct audio_policy *pol,
110 audio_policy_force_use_t usage,
111 audio_policy_forced_cfg_t config);
112
113 /* retreive current device category forced for a given usage */
114 audio_policy_forced_cfg_t (*get_force_use)(const struct audio_policy *pol,
115 audio_policy_force_use_t usage);
116
117 /* if can_mute is true, then audio streams that are marked ENFORCED_AUDIBLE
118 * can still be muted. */
119 void (*set_can_mute_enforced_audible)(struct audio_policy *pol,
120 bool can_mute);
121
122 /* check proper initialization */
123 int (*init_check)(const struct audio_policy *pol);
124
125 /*
126 * Audio routing query functions
127 */
128
129 /* request an output appriate for playback of the supplied stream type and
130 * parameters */
131 audio_io_handle_t (*get_output)(struct audio_policy *pol,
132 audio_stream_type_t stream,
133 uint32_t samplingRate,
134 uint32_t format,
135 uint32_t channels,
136 audio_policy_output_flags_t flags);
137
138 /* indicates to the audio policy manager that the output starts being used
139 * by corresponding stream. */
140 int (*start_output)(struct audio_policy *pol,
141 audio_io_handle_t output,
142 audio_stream_type_t stream,
143 int session);
144
145 /* indicates to the audio policy manager that the output stops being used
146 * by corresponding stream. */
147 int (*stop_output)(struct audio_policy *pol,
148 audio_io_handle_t output,
149 audio_stream_type_t stream,
150 int session);
151
152 /* releases the output. */
153 void (*release_output)(struct audio_policy *pol, audio_io_handle_t output);
154
155 /* request an input appriate for record from the supplied device with
156 * supplied parameters. */
157 audio_io_handle_t (*get_input)(struct audio_policy *pol, int inputSource,
158 uint32_t samplingRate,
159 uint32_t format,
160 uint32_t channels,
161 audio_in_acoustics_t acoustics);
162
163 /* indicates to the audio policy manager that the input starts being used */
164 int (*start_input)(struct audio_policy *pol, audio_io_handle_t input);
165
166 /* indicates to the audio policy manager that the input stops being used. */
167 int (*stop_input)(struct audio_policy *pol, audio_io_handle_t input);
168
169 /* releases the input. */
170 void (*release_input)(struct audio_policy *pol, audio_io_handle_t input);
171
172 /*
173 * volume control functions
174 */
175
176 /* initialises stream volume conversion parameters by specifying volume
177 * index range. */
178 void (*init_stream_volume)(struct audio_policy *pol,
179 audio_stream_type_t stream,
180 int index_min,
181 int index_max);
182
183 /* sets the new stream volume at a level corresponding to the supplied
184 * index */
185 int (*set_stream_volume_index)(struct audio_policy *pol,
186 audio_stream_type_t stream,
187 int index);
188
189 /* retreive current volume index for the specified stream */
190 int (*get_stream_volume_index)(const struct audio_policy *pol,
191 audio_stream_type_t stream,
192 int *index);
193
194 /* return the strategy corresponding to a given stream type */
195 uint32_t (*get_strategy_for_stream)(const struct audio_policy *pol,
196 audio_stream_type_t stream);
197
198 /* return the enabled output devices for the given stream type */
199 uint32_t (*get_devices_for_stream)(const struct audio_policy *pol,
200 audio_stream_type_t stream);
201
202 /* Audio effect management */
203 audio_io_handle_t (*get_output_for_effect)(struct audio_policy *pol,
204 struct effect_descriptor_s *desc);
205
206 int (*register_effect)(struct audio_policy *pol,
207 struct effect_descriptor_s *desc,
208 audio_io_handle_t output,
209 uint32_t strategy,
210 int session,
211 int id);
212
213 int (*unregister_effect)(struct audio_policy *pol, int id);
214
215 int (*set_effect_enabled)(struct audio_policy *pol, int id, bool enabled);
216
217 bool (*is_stream_active)(const struct audio_policy *pol,
218 int stream,
219 uint32_t in_past_ms);
220
221 /* dump state */
222 int (*dump)(const struct audio_policy *pol, int fd);
223};
224
225struct audio_policy_service_ops {
226 /*
227 * Audio output Control functions
228 */
229
230 /* Opens an audio output with the requested parameters.
231 *
232 * The parameter values can indicate to use the default values in case the
233 * audio policy manager has no specific requirements for the output being
234 * opened.
235 *
236 * When the function returns, the parameter values reflect the actual
237 * values used by the audio hardware output stream.
238 *
239 * The audio policy manager can check if the proposed parameters are
240 * suitable or not and act accordingly.
241 */
242 audio_io_handle_t (*open_output)(void *service,
243 uint32_t *pDevices,
244 uint32_t *pSamplingRate,
245 uint32_t *pFormat,
246 uint32_t *pChannels,
247 uint32_t *pLatencyMs,
248 audio_policy_output_flags_t flags);
249
250 /* creates a special output that is duplicated to the two outputs passed as
251 * arguments. The duplication is performed by
252 * a special mixer thread in the AudioFlinger.
253 */
254 audio_io_handle_t (*open_duplicate_output)(void *service,
255 audio_io_handle_t output1,
256 audio_io_handle_t output2);
257
258 /* closes the output stream */
259 int (*close_output)(void *service, audio_io_handle_t output);
260
261 /* suspends the output.
262 *
263 * When an output is suspended, the corresponding audio hardware output
264 * stream is placed in standby and the AudioTracks attached to the mixer
265 * thread are still processed but the output mix is discarded.
266 */
267 int (*suspend_output)(void *service, audio_io_handle_t output);
268
269 /* restores a suspended output. */
270 int (*restore_output)(void *service, audio_io_handle_t output);
271
272 /* */
273 /* Audio input Control functions */
274 /* */
275
276 /* opens an audio input */
277 audio_io_handle_t (*open_input)(void *service,
278 uint32_t *pDevices,
279 uint32_t *pSamplingRate,
280 uint32_t *pFormat,
281 uint32_t *pChannels,
282 uint32_t acoustics);
283
284 /* closes an audio input */
285 int (*close_input)(void *service, audio_io_handle_t input);
286
287 /* */
288 /* misc control functions */
289 /* */
290
291 /* set a stream volume for a particular output.
292 *
293 * For the same user setting, a given stream type can have different
294 * volumes for each output (destination device) it is attached to.
295 */
296 int (*set_stream_volume)(void *service,
297 audio_stream_type_t stream,
298 float volume,
299 audio_io_handle_t output,
300 int delay_ms);
301
302 /* reroute a given stream type to the specified output */
303 int (*set_stream_output)(void *service,
304 audio_stream_type_t stream,
305 audio_io_handle_t output);
306
307 /* function enabling to send proprietary informations directly from audio
308 * policy manager to audio hardware interface. */
309 void (*set_parameters)(void *service,
310 audio_io_handle_t io_handle,
311 const char *kv_pairs,
312 int delay_ms);
313
314 /* function enabling to receive proprietary informations directly from
315 * audio hardware interface to audio policy manager.
316 *
317 * Returns a pointer to a heap allocated string. The caller is responsible
318 * for freeing the memory for it.
319 */
320
321 char * (*get_parameters)(void *service, audio_io_handle_t io_handle,
322 const char *keys);
323
324 /* request the playback of a tone on the specified stream.
325 * used for instance to replace notification sounds when playing over a
326 * telephony device during a phone call.
327 */
328 int (*start_tone)(void *service,
329 audio_policy_tone_t tone,
330 audio_stream_type_t stream);
331
332 int (*stop_tone)(void *service);
333
334 /* set down link audio volume. */
335 int (*set_voice_volume)(void *service,
336 float volume,
337 int delay_ms);
338
339 /* move effect to the specified output */
340 int (*move_effects)(void *service,
341 int session,
342 audio_io_handle_t src_output,
343 audio_io_handle_t dst_output);
344};
345
346/**********************************************************************/
347
348/**
349 * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM
350 * and the fields of this data structure must begin with hw_module_t
351 * followed by module specific information.
352 */
353typedef struct audio_policy_module {
354 struct hw_module_t common;
355} audio_policy_module_t;
356
357struct audio_policy_device {
358 struct hw_device_t common;
359
360 int (*create_audio_policy)(const struct audio_policy_device *device,
361 struct audio_policy_service_ops *aps_ops,
362 void *service,
363 struct audio_policy **ap);
364
365 int (*destroy_audio_policy)(const struct audio_policy_device *device,
366 struct audio_policy *ap);
367};
368
369/** convenience API for opening and closing a supported device */
370
371static inline int audio_policy_dev_open(const hw_module_t* module,
372 struct audio_policy_device** device)
373{
374 return module->methods->open(module, AUDIO_POLICY_INTERFACE,
375 (hw_device_t**)device);
376}
377
378static inline int audio_policy_dev_close(struct audio_policy_device* device)
379{
380 return device->common.close(&device->common);
381}
382
383
384__END_DECLS
385
386#endif // ANDROID_AUDIO_POLICY_INTERFACE_H
3870
=== removed file '3rd_party/android-deps/hardware/camera.h'
--- 3rd_party/android-deps/hardware/camera.h 2013-01-08 17:44:16 +0000
+++ 3rd_party/android-deps/hardware/camera.h 1970-01-01 00:00:00 +0000
@@ -1,309 +0,0 @@
1/*
2 * Copyright (C) 2010-2011 The Android Open Source Project
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17// FIXME: add well-defined names for cameras
18
19#ifndef ANDROID_INCLUDE_CAMERA_H
20#define ANDROID_INCLUDE_CAMERA_H
21
22#include <stdint.h>
23#include <sys/cdefs.h>
24#include <sys/types.h>
25#include <cutils/native_handle.h>
26#include <system/camera.h>
27#include <hardware/hardware.h>
28#include <hardware/gralloc.h>
29
30__BEGIN_DECLS
31
32/**
33 * The id of this module
34 */
35#define CAMERA_HARDWARE_MODULE_ID "camera"
36
37struct camera_info {
38 /**
39 * The direction that the camera faces to. It should be CAMERA_FACING_BACK
40 * or CAMERA_FACING_FRONT.
41 */
42 int facing;
43
44 /**
45 * The orientation of the camera image. The value is the angle that the
46 * camera image needs to be rotated clockwise so it shows correctly on the
47 * display in its natural orientation. It should be 0, 90, 180, or 270.
48 *
49 * For example, suppose a device has a naturally tall screen. The
50 * back-facing camera sensor is mounted in landscape. You are looking at
51 * the screen. If the top side of the camera sensor is aligned with the
52 * right edge of the screen in natural orientation, the value should be
53 * 90. If the top side of a front-facing camera sensor is aligned with the
54 * right of the screen, the value should be 270.
55 */
56 int orientation;
57};
58
59typedef struct camera_module {
60 hw_module_t common;
61 int (*get_number_of_cameras)(void);
62 int (*get_camera_info)(int camera_id, struct camera_info *info);
63} camera_module_t;
64
65struct camera_memory;
66typedef void (*camera_release_memory)(struct camera_memory *mem);
67
68typedef struct camera_memory {
69 void *data;
70 size_t size;
71 void *handle;
72 camera_release_memory release;
73} camera_memory_t;
74
75typedef camera_memory_t* (*camera_request_memory)(int fd, size_t buf_size, unsigned int num_bufs,
76 void *user);
77
78typedef void (*camera_notify_callback)(int32_t msg_type,
79 int32_t ext1,
80 int32_t ext2,
81 void *user);
82
83typedef void (*camera_data_callback)(int32_t msg_type,
84 const camera_memory_t *data, unsigned int index,
85 camera_frame_metadata_t *metadata, void *user);
86
87typedef void (*camera_data_timestamp_callback)(int64_t timestamp,
88 int32_t msg_type,
89 const camera_memory_t *data, unsigned int index,
90 void *user);
91
92#define HAL_CAMERA_PREVIEW_WINDOW_TAG 0xcafed00d
93
94typedef struct preview_stream_ops {
95 int (*dequeue_buffer)(struct preview_stream_ops* w,
96 buffer_handle_t** buffer, int *stride);
97 int (*enqueue_buffer)(struct preview_stream_ops* w,
98 buffer_handle_t* buffer);
99 int (*cancel_buffer)(struct preview_stream_ops* w,
100 buffer_handle_t* buffer);
101 int (*set_buffer_count)(struct preview_stream_ops* w, int count);
102 int (*set_buffers_geometry)(struct preview_stream_ops* pw,
103 int w, int h, int format);
104 int (*set_crop)(struct preview_stream_ops *w,
105 int left, int top, int right, int bottom);
106 int (*set_usage)(struct preview_stream_ops* w, int usage);
107 int (*set_swap_interval)(struct preview_stream_ops *w, int interval);
108 int (*get_min_undequeued_buffer_count)(const struct preview_stream_ops *w,
109 int *count);
110 int (*lock_buffer)(struct preview_stream_ops* w,
111 buffer_handle_t* buffer);
112} preview_stream_ops_t;
113
114struct camera_device;
115typedef struct camera_device_ops {
116 /** Set the ANativeWindow to which preview frames are sent */
117 int (*set_preview_window)(struct camera_device *,
118 struct preview_stream_ops *window);
119
120 /** Set the notification and data callbacks */
121 void (*set_callbacks)(struct camera_device *,
122 camera_notify_callback notify_cb,
123 camera_data_callback data_cb,
124 camera_data_timestamp_callback data_cb_timestamp,
125 camera_request_memory get_memory,
126 void *user);
127
128 /**
129 * The following three functions all take a msg_type, which is a bitmask of
130 * the messages defined in include/ui/Camera.h
131 */
132
133 /**
134 * Enable a message, or set of messages.
135 */
136 void (*enable_msg_type)(struct camera_device *, int32_t msg_type);
137
138 /**
139 * Disable a message, or a set of messages.
140 *
141 * Once received a call to disableMsgType(CAMERA_MSG_VIDEO_FRAME), camera
142 * HAL should not rely on its client to call releaseRecordingFrame() to
143 * release video recording frames sent out by the cameral HAL before and
144 * after the disableMsgType(CAMERA_MSG_VIDEO_FRAME) call. Camera HAL
145 * clients must not modify/access any video recording frame after calling
146 * disableMsgType(CAMERA_MSG_VIDEO_FRAME).
147 */
148 void (*disable_msg_type)(struct camera_device *, int32_t msg_type);
149
150 /**
151 * Query whether a message, or a set of messages, is enabled. Note that
152 * this is operates as an AND, if any of the messages queried are off, this
153 * will return false.
154 */
155 int (*msg_type_enabled)(struct camera_device *, int32_t msg_type);
156
157 /**
158 * Start preview mode.
159 */
160 int (*start_preview)(struct camera_device *);
161
162 /**
163 * Stop a previously started preview.
164 */
165 void (*stop_preview)(struct camera_device *);
166
167 /**
168 * Returns true if preview is enabled.
169 */
170 int (*preview_enabled)(struct camera_device *);
171
172 /**
173 * Request the camera HAL to store meta data or real YUV data in the video
174 * buffers sent out via CAMERA_MSG_VIDEO_FRAME for a recording session. If
175 * it is not called, the default camera HAL behavior is to store real YUV
176 * data in the video buffers.
177 *
178 * This method should be called before startRecording() in order to be
179 * effective.
180 *
181 * If meta data is stored in the video buffers, it is up to the receiver of
182 * the video buffers to interpret the contents and to find the actual frame
183 * data with the help of the meta data in the buffer. How this is done is
184 * outside of the scope of this method.
185 *
186 * Some camera HALs may not support storing meta data in the video buffers,
187 * but all camera HALs should support storing real YUV data in the video
188 * buffers. If the camera HAL does not support storing the meta data in the
189 * video buffers when it is requested to do do, INVALID_OPERATION must be
190 * returned. It is very useful for the camera HAL to pass meta data rather
191 * than the actual frame data directly to the video encoder, since the
192 * amount of the uncompressed frame data can be very large if video size is
193 * large.
194 *
195 * @param enable if true to instruct the camera HAL to store
196 * meta data in the video buffers; false to instruct
197 * the camera HAL to store real YUV data in the video
198 * buffers.
199 *
200 * @return OK on success.
201 */
202 int (*store_meta_data_in_buffers)(struct camera_device *, int enable);
203
204 /**
205 * Start record mode. When a record image is available, a
206 * CAMERA_MSG_VIDEO_FRAME message is sent with the corresponding
207 * frame. Every record frame must be released by a camera HAL client via
208 * releaseRecordingFrame() before the client calls
209 * disableMsgType(CAMERA_MSG_VIDEO_FRAME). After the client calls
210 * disableMsgType(CAMERA_MSG_VIDEO_FRAME), it is the camera HAL's
211 * responsibility to manage the life-cycle of the video recording frames,
212 * and the client must not modify/access any video recording frames.
213 */
214 int (*start_recording)(struct camera_device *);
215
216 /**
217 * Stop a previously started recording.
218 */
219 void (*stop_recording)(struct camera_device *);
220
221 /**
222 * Returns true if recording is enabled.
223 */
224 int (*recording_enabled)(struct camera_device *);
225
226 /**
227 * Release a record frame previously returned by CAMERA_MSG_VIDEO_FRAME.
228 *
229 * It is camera HAL client's responsibility to release video recording
230 * frames sent out by the camera HAL before the camera HAL receives a call
231 * to disableMsgType(CAMERA_MSG_VIDEO_FRAME). After it receives the call to
232 * disableMsgType(CAMERA_MSG_VIDEO_FRAME), it is the camera HAL's
233 * responsibility to manage the life-cycle of the video recording frames.
234 */
235 void (*release_recording_frame)(struct camera_device *,
236 const void *opaque);
237
238 /**
239 * Start auto focus, the notification callback routine is called with
240 * CAMERA_MSG_FOCUS once when focusing is complete. autoFocus() will be
241 * called again if another auto focus is needed.
242 */
243 int (*auto_focus)(struct camera_device *);
244
245 /**
246 * Cancels auto-focus function. If the auto-focus is still in progress,
247 * this function will cancel it. Whether the auto-focus is in progress or
248 * not, this function will return the focus position to the default. If
249 * the camera does not support auto-focus, this is a no-op.
250 */
251 int (*cancel_auto_focus)(struct camera_device *);
252
253 /**
254 * Take a picture.
255 */
256 int (*take_picture)(struct camera_device *);
257
258 /**
259 * Cancel a picture that was started with takePicture. Calling this method
260 * when no picture is being taken is a no-op.
261 */
262 int (*cancel_picture)(struct camera_device *);
263
264 /**
265 * Set the camera parameters. This returns BAD_VALUE if any parameter is
266 * invalid or not supported.
267 */
268 int (*set_parameters)(struct camera_device *, const char *parms);
269
270 /** Retrieve the camera parameters. The buffer returned by the camera HAL
271 must be returned back to it with put_parameters, if put_parameters
272 is not NULL.
273 */
274 char *(*get_parameters)(struct camera_device *);
275
276 /** The camera HAL uses its own memory to pass us the parameters when we
277 call get_parameters. Use this function to return the memory back to
278 the camera HAL, if put_parameters is not NULL. If put_parameters
279 is NULL, then you have to use free() to release the memory.
280 */
281 void (*put_parameters)(struct camera_device *, char *);
282
283 /**
284 * Send command to camera driver.
285 */
286 int (*send_command)(struct camera_device *,
287 int32_t cmd, int32_t arg1, int32_t arg2);
288
289 /**
290 * Release the hardware resources owned by this object. Note that this is
291 * *not* done in the destructor.
292 */
293 void (*release)(struct camera_device *);
294
295 /**
296 * Dump state of the camera hardware
297 */
298 int (*dump)(struct camera_device *, int fd);
299} camera_device_ops_t;
300
301typedef struct camera_device {
302 hw_device_t common;
303 camera_device_ops_t *ops;
304 void *priv;
305} camera_device_t;
306
307__END_DECLS
308
309#endif /* ANDROID_INCLUDE_CAMERA_H */
3100
=== modified file '3rd_party/android-deps/hardware/fb.h'
--- 3rd_party/android-deps/hardware/fb.h 2013-01-08 17:44:16 +0000
+++ 3rd_party/android-deps/hardware/fb.h 2013-03-06 00:16:21 +0000
@@ -64,7 +64,10 @@
64 /* max swap interval supported by this framebuffer */64 /* max swap interval supported by this framebuffer */
65 const int maxSwapInterval;65 const int maxSwapInterval;
6666
67 int reserved[8];67 /* Number of framebuffers supported*/
68 const int numFramebuffers;
69
70 int reserved[7];
6871
69 /*72 /*
70 * requests a specific swap-interval (same definition than EGL)73 * requests a specific swap-interval (same definition than EGL)
7174
=== removed file '3rd_party/android-deps/hardware/gps.h'
--- 3rd_party/android-deps/hardware/gps.h 2013-01-08 17:44:16 +0000
+++ 3rd_party/android-deps/hardware/gps.h 1970-01-01 00:00:00 +0000
@@ -1,679 +0,0 @@
1/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17#ifndef ANDROID_INCLUDE_HARDWARE_GPS_H
18#define ANDROID_INCLUDE_HARDWARE_GPS_H
19
20#include <stdint.h>
21#include <sys/cdefs.h>
22#include <sys/types.h>
23#include <pthread.h>
24
25#include <hardware/hardware.h>
26
27__BEGIN_DECLS
28
29/**
30 * The id of this module
31 */
32#define GPS_HARDWARE_MODULE_ID "gps"
33
34
35/** Milliseconds since January 1, 1970 */
36typedef int64_t GpsUtcTime;
37
38/** Maximum number of SVs for gps_sv_status_callback(). */
39#define GPS_MAX_SVS 32
40
41/** Requested operational mode for GPS operation. */
42typedef uint32_t GpsPositionMode;
43// IMPORTANT: Note that the following values must match
44// constants in GpsLocationProvider.java.
45/** Mode for running GPS standalone (no assistance). */
46#define GPS_POSITION_MODE_STANDALONE 0
47/** AGPS MS-Based mode. */
48#define GPS_POSITION_MODE_MS_BASED 1
49/** AGPS MS-Assisted mode. */
50#define GPS_POSITION_MODE_MS_ASSISTED 2
51
52/** Requested recurrence mode for GPS operation. */
53typedef uint32_t GpsPositionRecurrence;
54// IMPORTANT: Note that the following values must match
55// constants in GpsLocationProvider.java.
56/** Receive GPS fixes on a recurring basis at a specified period. */
57#define GPS_POSITION_RECURRENCE_PERIODIC 0
58/** Request a single shot GPS fix. */
59#define GPS_POSITION_RECURRENCE_SINGLE 1
60
61/** GPS status event values. */
62typedef uint16_t GpsStatusValue;
63// IMPORTANT: Note that the following values must match
64// constants in GpsLocationProvider.java.
65/** GPS status unknown. */
66#define GPS_STATUS_NONE 0
67/** GPS has begun navigating. */
68#define GPS_STATUS_SESSION_BEGIN 1
69/** GPS has stopped navigating. */
70#define GPS_STATUS_SESSION_END 2
71/** GPS has powered on but is not navigating. */
72#define GPS_STATUS_ENGINE_ON 3
73/** GPS is powered off. */
74#define GPS_STATUS_ENGINE_OFF 4
75
76/** Flags to indicate which values are valid in a GpsLocation. */
77typedef uint16_t GpsLocationFlags;
78// IMPORTANT: Note that the following values must match
79// constants in GpsLocationProvider.java.
80/** GpsLocation has valid latitude and longitude. */
81#define GPS_LOCATION_HAS_LAT_LONG 0x0001
82/** GpsLocation has valid altitude. */
83#define GPS_LOCATION_HAS_ALTITUDE 0x0002
84/** GpsLocation has valid speed. */
85#define GPS_LOCATION_HAS_SPEED 0x0004
86/** GpsLocation has valid bearing. */
87#define GPS_LOCATION_HAS_BEARING 0x0008
88/** GpsLocation has valid accuracy. */
89#define GPS_LOCATION_HAS_ACCURACY 0x0010
90
91/** Flags for the gps_set_capabilities callback. */
92
93/** GPS HAL schedules fixes for GPS_POSITION_RECURRENCE_PERIODIC mode.
94 If this is not set, then the framework will use 1000ms for min_interval
95 and will start and call start() and stop() to schedule the GPS.
96 */
97#define GPS_CAPABILITY_SCHEDULING 0x0000001
98/** GPS supports MS-Based AGPS mode */
99#define GPS_CAPABILITY_MSB 0x0000002
100/** GPS supports MS-Assisted AGPS mode */
101#define GPS_CAPABILITY_MSA 0x0000004
102/** GPS supports single-shot fixes */
103#define GPS_CAPABILITY_SINGLE_SHOT 0x0000008
104/** GPS supports on demand time injection */
105#define GPS_CAPABILITY_ON_DEMAND_TIME 0x0000010
106
107/** Flags used to specify which aiding data to delete
108 when calling delete_aiding_data(). */
109typedef uint16_t GpsAidingData;
110// IMPORTANT: Note that the following values must match
111// constants in GpsLocationProvider.java.
112#define GPS_DELETE_EPHEMERIS 0x0001
113#define GPS_DELETE_ALMANAC 0x0002
114#define GPS_DELETE_POSITION 0x0004
115#define GPS_DELETE_TIME 0x0008
116#define GPS_DELETE_IONO 0x0010
117#define GPS_DELETE_UTC 0x0020
118#define GPS_DELETE_HEALTH 0x0040
119#define GPS_DELETE_SVDIR 0x0080
120#define GPS_DELETE_SVSTEER 0x0100
121#define GPS_DELETE_SADATA 0x0200
122#define GPS_DELETE_RTI 0x0400
123#define GPS_DELETE_CELLDB_INFO 0x8000
124#define GPS_DELETE_ALL 0xFFFF
125
126/** AGPS type */
127typedef uint16_t AGpsType;
128#define AGPS_TYPE_SUPL 1
129#define AGPS_TYPE_C2K 2
130
131typedef uint16_t AGpsSetIDType;
132#define AGPS_SETID_TYPE_NONE 0
133#define AGPS_SETID_TYPE_IMSI 1
134#define AGPS_SETID_TYPE_MSISDN 2
135
136/**
137 * String length constants
138 */
139#define GPS_NI_SHORT_STRING_MAXLEN 256
140#define GPS_NI_LONG_STRING_MAXLEN 2048
141
142/**
143 * GpsNiType constants
144 */
145typedef uint32_t GpsNiType;
146#define GPS_NI_TYPE_VOICE 1
147#define GPS_NI_TYPE_UMTS_SUPL 2
148#define GPS_NI_TYPE_UMTS_CTRL_PLANE 3
149
150/**
151 * GpsNiNotifyFlags constants
152 */
153typedef uint32_t GpsNiNotifyFlags;
154/** NI requires notification */
155#define GPS_NI_NEED_NOTIFY 0x0001
156/** NI requires verification */
157#define GPS_NI_NEED_VERIFY 0x0002
158/** NI requires privacy override, no notification/minimal trace */
159#define GPS_NI_PRIVACY_OVERRIDE 0x0004
160
161/**
162 * GPS NI responses, used to define the response in
163 * NI structures
164 */
165typedef int GpsUserResponseType;
166#define GPS_NI_RESPONSE_ACCEPT 1
167#define GPS_NI_RESPONSE_DENY 2
168#define GPS_NI_RESPONSE_NORESP 3
169
170/**
171 * NI data encoding scheme
172 */
173typedef int GpsNiEncodingType;
174#define GPS_ENC_NONE 0
175#define GPS_ENC_SUPL_GSM_DEFAULT 1
176#define GPS_ENC_SUPL_UTF8 2
177#define GPS_ENC_SUPL_UCS2 3
178#define GPS_ENC_UNKNOWN -1
179
180/** AGPS status event values. */
181typedef uint16_t AGpsStatusValue;
182/** GPS requests data connection for AGPS. */
183#define GPS_REQUEST_AGPS_DATA_CONN 1
184/** GPS releases the AGPS data connection. */
185#define GPS_RELEASE_AGPS_DATA_CONN 2
186/** AGPS data connection initiated */
187#define GPS_AGPS_DATA_CONNECTED 3
188/** AGPS data connection completed */
189#define GPS_AGPS_DATA_CONN_DONE 4
190/** AGPS data connection failed */
191#define GPS_AGPS_DATA_CONN_FAILED 5
192
193#define AGPS_REF_LOCATION_TYPE_GSM_CELLID 1
194#define AGPS_REF_LOCATION_TYPE_UMTS_CELLID 2
195#define AGPS_REG_LOCATION_TYPE_MAC 3
196
197/** Network types for update_network_state "type" parameter */
198#define AGPS_RIL_NETWORK_TYPE_MOBILE 0
199#define AGPS_RIL_NETWORK_TYPE_WIFI 1
200#define AGPS_RIL_NETWORK_TYPE_MOBILE_MMS 2
201#define AGPS_RIL_NETWORK_TYPE_MOBILE_SUPL 3
202#define AGPS_RIL_NETWORK_TTYPE_MOBILE_DUN 4
203#define AGPS_RIL_NETWORK_TTYPE_MOBILE_HIPRI 5
204#define AGPS_RIL_NETWORK_TTYPE_WIMAX 6
205
206/**
207 * Name for the GPS XTRA interface.
208 */
209#define GPS_XTRA_INTERFACE "gps-xtra"
210
211/**
212 * Name for the GPS DEBUG interface.
213 */
214#define GPS_DEBUG_INTERFACE "gps-debug"
215
216/**
217 * Name for the AGPS interface.
218 */
219#define AGPS_INTERFACE "agps"
220
221/**
222 * Name for NI interface
223 */
224#define GPS_NI_INTERFACE "gps-ni"
225
226/**
227 * Name for the AGPS-RIL interface.
228 */
229#define AGPS_RIL_INTERFACE "agps_ril"
230
231/** Represents a location. */
232typedef struct {
233 /** set to sizeof(GpsLocation) */
234 size_t size;
235 /** Contains GpsLocationFlags bits. */
236 uint16_t flags;
237 /** Represents latitude in degrees. */
238 double latitude;
239 /** Represents longitude in degrees. */
240 double longitude;
241 /** Represents altitude in meters above the WGS 84 reference
242 * ellipsoid. */
243 double altitude;
244 /** Represents speed in meters per second. */
245 float speed;
246 /** Represents heading in degrees. */
247 float bearing;
248 /** Represents expected accuracy in meters. */
249 float accuracy;
250 /** Timestamp for the location fix. */
251 GpsUtcTime timestamp;
252} GpsLocation;
253
254/** Represents the status. */
255typedef struct {
256 /** set to sizeof(GpsStatus) */
257 size_t size;
258 GpsStatusValue status;
259} GpsStatus;
260
261/** Represents SV information. */
262typedef struct {
263 /** set to sizeof(GpsSvInfo) */
264 size_t size;
265 /** Pseudo-random number for the SV. */
266 int prn;
267 /** Signal to noise ratio. */
268 float snr;
269 /** Elevation of SV in degrees. */
270 float elevation;
271 /** Azimuth of SV in degrees. */
272 float azimuth;
273} GpsSvInfo;
274
275/** Represents SV status. */
276typedef struct {
277 /** set to sizeof(GpsSvStatus) */
278 size_t size;
279
280 /** Number of SVs currently visible. */
281 int num_svs;
282
283 /** Contains an array of SV information. */
284 GpsSvInfo sv_list[GPS_MAX_SVS];
285
286 /** Represents a bit mask indicating which SVs
287 * have ephemeris data.
288 */
289 uint32_t ephemeris_mask;
290
291 /** Represents a bit mask indicating which SVs
292 * have almanac data.
293 */
294 uint32_t almanac_mask;
295
296 /**
297 * Represents a bit mask indicating which SVs
298 * were used for computing the most recent position fix.
299 */
300 uint32_t used_in_fix_mask;
301} GpsSvStatus;
302
303/* 2G and 3G */
304/* In 3G lac is discarded */
305typedef struct {
306 uint16_t type;
307 uint16_t mcc;
308 uint16_t mnc;
309 uint16_t lac;
310 uint32_t cid;
311} AGpsRefLocationCellID;
312
313typedef struct {
314 uint8_t mac[6];
315} AGpsRefLocationMac;
316
317/** Represents ref locations */
318typedef struct {
319 uint16_t type;
320 union {
321 AGpsRefLocationCellID cellID;
322 AGpsRefLocationMac mac;
323 } u;
324} AGpsRefLocation;
325
326/** Callback with location information.
327 * Can only be called from a thread created by create_thread_cb.
328 */
329typedef void (* gps_location_callback)(GpsLocation* location);
330
331/** Callback with status information.
332 * Can only be called from a thread created by create_thread_cb.
333 */
334typedef void (* gps_status_callback)(GpsStatus* status);
335
336/** Callback with SV status information.
337 * Can only be called from a thread created by create_thread_cb.
338 */
339typedef void (* gps_sv_status_callback)(GpsSvStatus* sv_info);
340
341/** Callback for reporting NMEA sentences.
342 * Can only be called from a thread created by create_thread_cb.
343 */
344typedef void (* gps_nmea_callback)(GpsUtcTime timestamp, const char* nmea, int length);
345
346/** Callback to inform framework of the GPS engine's capabilities.
347 * Capability parameter is a bit field of GPS_CAPABILITY_* flags.
348 */
349typedef void (* gps_set_capabilities)(uint32_t capabilities);
350
351/** Callback utility for acquiring the GPS wakelock.
352 * This can be used to prevent the CPU from suspending while handling GPS events.
353 */
354typedef void (* gps_acquire_wakelock)();
355
356/** Callback utility for releasing the GPS wakelock. */
357typedef void (* gps_release_wakelock)();
358
359/** Callback for requesting NTP time */
360typedef void (* gps_request_utc_time)();
361
362/** Callback for creating a thread that can call into the Java framework code.
363 * This must be used to create any threads that report events up to the framework.
364 */
365typedef pthread_t (* gps_create_thread)(const char* name, void (*start)(void *), void* arg);
366
367/** GPS callback structure. */
368typedef struct {
369 /** set to sizeof(GpsCallbacks) */
370 size_t size;
371 gps_location_callback location_cb;
372 gps_status_callback status_cb;
373 gps_sv_status_callback sv_status_cb;
374 gps_nmea_callback nmea_cb;
375 gps_set_capabilities set_capabilities_cb;
376 gps_acquire_wakelock acquire_wakelock_cb;
377 gps_release_wakelock release_wakelock_cb;
378 gps_create_thread create_thread_cb;
379 gps_request_utc_time request_utc_time_cb;
380} GpsCallbacks;
381
382
383/** Represents the standard GPS interface. */
384typedef struct {
385 /** set to sizeof(GpsInterface) */
386 size_t size;
387 /**
388 * Opens the interface and provides the callback routines
389 * to the implemenation of this interface.
390 */
391 int (*init)( GpsCallbacks* callbacks );
392
393 /** Starts navigating. */
394 int (*start)( void );
395
396 /** Stops navigating. */
397 int (*stop)( void );
398
399 /** Closes the interface. */
400 void (*cleanup)( void );
401
402 /** Injects the current time. */
403 int (*inject_time)(GpsUtcTime time, int64_t timeReference,
404 int uncertainty);
405
406 /** Injects current location from another location provider
407 * (typically cell ID).
408 * latitude and longitude are measured in degrees
409 * expected accuracy is measured in meters
410 */
411 int (*inject_location)(double latitude, double longitude, float accuracy);
412
413 /**
414 * Specifies that the next call to start will not use the
415 * information defined in the flags. GPS_DELETE_ALL is passed for
416 * a cold start.
417 */
418 void (*delete_aiding_data)(GpsAidingData flags);
419
420 /**
421 * min_interval represents the time between fixes in milliseconds.
422 * preferred_accuracy represents the requested fix accuracy in meters.
423 * preferred_time represents the requested time to first fix in milliseconds.
424 */
425 int (*set_position_mode)(GpsPositionMode mode, GpsPositionRecurrence recurrence,
426 uint32_t min_interval, uint32_t preferred_accuracy, uint32_t preferred_time);
427
428 /** Get a pointer to extension information. */
429 const void* (*get_extension)(const char* name);
430} GpsInterface;
431
432/** Callback to request the client to download XTRA data.
433 * The client should download XTRA data and inject it by calling inject_xtra_data().
434 * Can only be called from a thread created by create_thread_cb.
435 */
436typedef void (* gps_xtra_download_request)();
437
438/** Callback structure for the XTRA interface. */
439typedef struct {
440 gps_xtra_download_request download_request_cb;
441 gps_create_thread create_thread_cb;
442} GpsXtraCallbacks;
443
444/** Extended interface for XTRA support. */
445typedef struct {
446 /** set to sizeof(GpsXtraInterface) */
447 size_t size;
448 /**
449 * Opens the XTRA interface and provides the callback routines
450 * to the implemenation of this interface.
451 */
452 int (*init)( GpsXtraCallbacks* callbacks );
453 /** Injects XTRA data into the GPS. */
454 int (*inject_xtra_data)( char* data, int length );
455} GpsXtraInterface;
456
457/** Extended interface for DEBUG support. */
458typedef struct {
459 /** set to sizeof(GpsDebugInterface) */
460 size_t size;
461
462 /**
463 * This function should return any information that the native
464 * implementation wishes to include in a bugreport.
465 */
466 size_t (*get_internal_state)(char* buffer, size_t bufferSize);
467} GpsDebugInterface;
468
469/** Represents the status of AGPS. */
470typedef struct {
471 /** set to sizeof(AGpsStatus) */
472 size_t size;
473
474 AGpsType type;
475 AGpsStatusValue status;
476 uint32_t ipaddr;
477} AGpsStatus;
478
479/** Callback with AGPS status information.
480 * Can only be called from a thread created by create_thread_cb.
481 */
482typedef void (* agps_status_callback)(AGpsStatus* status);
483
484/** Callback structure for the AGPS interface. */
485typedef struct {
486 agps_status_callback status_cb;
487 gps_create_thread create_thread_cb;
488} AGpsCallbacks;
489
490
491/** Extended interface for AGPS support. */
492typedef struct {
493 /** set to sizeof(AGpsInterface) */
494 size_t size;
495
496 /**
497 * Opens the AGPS interface and provides the callback routines
498 * to the implemenation of this interface.
499 */
500 void (*init)( AGpsCallbacks* callbacks );
501 /**
502 * Notifies that a data connection is available and sets
503 * the name of the APN to be used for SUPL.
504 */
505 int (*data_conn_open)( const char* apn );
506 /**
507 * Notifies that the AGPS data connection has been closed.
508 */
509 int (*data_conn_closed)();
510 /**
511 * Notifies that a data connection is not available for AGPS.
512 */
513 int (*data_conn_failed)();
514 /**
515 * Sets the hostname and port for the AGPS server.
516 */
517 int (*set_server)( AGpsType type, const char* hostname, int port );
518} AGpsInterface;
519
520
521/** Represents an NI request */
522typedef struct {
523 /** set to sizeof(GpsNiNotification) */
524 size_t size;
525
526 /**
527 * An ID generated by HAL to associate NI notifications and UI
528 * responses
529 */
530 int notification_id;
531
532 /**
533 * An NI type used to distinguish different categories of NI
534 * events, such as GPS_NI_TYPE_VOICE, GPS_NI_TYPE_UMTS_SUPL, ...
535 */
536 GpsNiType ni_type;
537
538 /**
539 * Notification/verification options, combinations of GpsNiNotifyFlags constants
540 */
541 GpsNiNotifyFlags notify_flags;
542
543 /**
544 * Timeout period to wait for user response.
545 * Set to 0 for no time out limit.
546 */
547 int timeout;
548
549 /**
550 * Default response when time out.
551 */
552 GpsUserResponseType default_response;
553
554 /**
555 * Requestor ID
556 */
557 char requestor_id[GPS_NI_SHORT_STRING_MAXLEN];
558
559 /**
560 * Notification message. It can also be used to store client_id in some cases
561 */
562 char text[GPS_NI_LONG_STRING_MAXLEN];
563
564 /**
565 * Client name decoding scheme
566 */
567 GpsNiEncodingType requestor_id_encoding;
568
569 /**
570 * Client name decoding scheme
571 */
572 GpsNiEncodingType text_encoding;
573
574 /**
575 * A pointer to extra data. Format:
576 * key_1 = value_1
577 * key_2 = value_2
578 */
579 char extras[GPS_NI_LONG_STRING_MAXLEN];
580
581} GpsNiNotification;
582
583/** Callback with NI notification.
584 * Can only be called from a thread created by create_thread_cb.
585 */
586typedef void (*gps_ni_notify_callback)(GpsNiNotification *notification);
587
588/** GPS NI callback structure. */
589typedef struct
590{
591 /**
592 * Sends the notification request from HAL to GPSLocationProvider.
593 */
594 gps_ni_notify_callback notify_cb;
595 gps_create_thread create_thread_cb;
596} GpsNiCallbacks;
597
598/**
599 * Extended interface for Network-initiated (NI) support.
600 */
601typedef struct
602{
603 /** set to sizeof(GpsNiInterface) */
604 size_t size;
605
606 /** Registers the callbacks for HAL to use. */
607 void (*init) (GpsNiCallbacks *callbacks);
608
609 /** Sends a response to HAL. */
610 void (*respond) (int notif_id, GpsUserResponseType user_response);
611} GpsNiInterface;
612
613struct gps_device_t {
614 struct hw_device_t common;
615
616 /**
617 * Set the provided lights to the provided values.
618 *
619 * Returns: 0 on succes, error code on failure.
620 */
621 const GpsInterface* (*get_gps_interface)(struct gps_device_t* dev);
622};
623
624#define AGPS_RIL_REQUEST_SETID_IMSI (1<<0L)
625#define AGPS_RIL_REQUEST_SETID_MSISDN (1<<1L)
626
627#define AGPS_RIL_REQUEST_REFLOC_CELLID (1<<0L)
628#define AGPS_RIL_REQUEST_REFLOC_MAC (1<<1L)
629
630typedef void (*agps_ril_request_set_id)(uint32_t flags);
631typedef void (*agps_ril_request_ref_loc)(uint32_t flags);
632
633typedef struct {
634 agps_ril_request_set_id request_setid;
635 agps_ril_request_ref_loc request_refloc;
636 gps_create_thread create_thread_cb;
637} AGpsRilCallbacks;
638
639/** Extended interface for AGPS_RIL support. */
640typedef struct {
641 /** set to sizeof(AGpsRilInterface) */
642 size_t size;
643 /**
644 * Opens the AGPS interface and provides the callback routines
645 * to the implemenation of this interface.
646 */
647 void (*init)( AGpsRilCallbacks* callbacks );
648
649 /**
650 * Sets the reference location.
651 */
652 void (*set_ref_location) (const AGpsRefLocation *agps_reflocation, size_t sz_struct);
653 /**
654 * Sets the set ID.
655 */
656 void (*set_set_id) (AGpsSetIDType type, const char* setid);
657
658 /**
659 * Send network initiated message.
660 */
661 void (*ni_message) (uint8_t *msg, size_t len);
662
663 /**
664 * Notify GPS of network status changes.
665 * These parameters match values in the android.net.NetworkInfo class.
666 */
667 void (*update_network_state) (int connected, int type, int roaming, const char* extra_info);
668
669 /**
670 * Notify GPS of network status changes.
671 * These parameters match values in the android.net.NetworkInfo class.
672 */
673 void (*update_network_availability) (int avaiable, const char* apn);
674} AGpsRilInterface;
675
676__END_DECLS
677
678#endif /* ANDROID_INCLUDE_HARDWARE_GPS_H */
679
6800
=== modified file '3rd_party/android-deps/hardware/gralloc.h'
--- 3rd_party/android-deps/hardware/gralloc.h 2013-01-08 17:44:16 +0000
+++ 3rd_party/android-deps/hardware/gralloc.h 2013-03-06 00:16:21 +0000
@@ -76,16 +76,16 @@
76 GRALLOC_USAGE_HW_FB = 0x00001000,76 GRALLOC_USAGE_HW_FB = 0x00001000,
77 /* buffer will be used with the HW video encoder */77 /* buffer will be used with the HW video encoder */
78 GRALLOC_USAGE_HW_VIDEO_ENCODER = 0x00010000,78 GRALLOC_USAGE_HW_VIDEO_ENCODER = 0x00010000,
79 /* buffer will be written by the HW camera pipeline */
80 GRALLOC_USAGE_HW_CAMERA_WRITE = 0x00020000,
81 /* buffer will be read by the HW camera pipeline */
82 GRALLOC_USAGE_HW_CAMERA_READ = 0x00040000,
83 /* buffer will be used as part of zero-shutter-lag queue */
84 GRALLOC_USAGE_HW_CAMERA_ZSL = 0x00060000,
85 /* mask for the camera access values */
86 GRALLOC_USAGE_HW_CAMERA_MASK = 0x00060000,
79 /* mask for the software usage bit-mask */87 /* mask for the software usage bit-mask */
80 GRALLOC_USAGE_HW_MASK = 0x00011F00,88 GRALLOC_USAGE_HW_MASK = 0x00071F00,
81
82#ifdef SAMSUNG_CODEC_SUPPORT
83 GRALLOC_USAGE_HW_FIMC1 = 0x01000000,
84 GRALLOC_USAGE_HW_ION = 0x02000000,
85 GRALLOC_USAGE_YUV_ADDR = 0x04000000,
86 /* SEC Private usage , for Overlay path at HWC */
87 GRALLOC_USAGE_HWC_HWOVERLAY = 0x20000000,
88#endif
8989
90 /* buffer should be displayed full-screen on an external display when90 /* buffer should be displayed full-screen on an external display when
91 * possible91 * possible
@@ -106,8 +106,26 @@
106 GRALLOC_USAGE_PRIVATE_2 = 0x40000000,106 GRALLOC_USAGE_PRIVATE_2 = 0x40000000,
107 GRALLOC_USAGE_PRIVATE_3 = 0x80000000,107 GRALLOC_USAGE_PRIVATE_3 = 0x80000000,
108 GRALLOC_USAGE_PRIVATE_MASK = 0xF0000000,108 GRALLOC_USAGE_PRIVATE_MASK = 0xF0000000,
109};109
110110#ifdef EXYNOS4_ENHANCEMENTS
111 /* SAMSUNG */
112 GRALLOC_USAGE_PRIVATE_NONECACHE = 0x00800000,
113
114 GRALLOC_USAGE_HW_FIMC1 = 0x01000000,
115 GRALLOC_USAGE_HW_ION = 0x02000000,
116 GRALLOC_USAGE_YUV_ADDR = 0x04000000,
117 GRALLOC_USAGE_CAMERA = 0x08000000,
118
119 /* SEC Private usage , for Overlay path at HWC */
120 GRALLOC_USAGE_HWC_HWOVERLAY = 0x20000000,
121#endif
122};
123
124enum {
125 /* Gralloc perform enums */
126 GRALLOC_MODULE_PERFORM_UPDATE_BUFFER_GEOMETRY = 0,
127 GRALLOC_MODULE_PERFORM_PRIVATE_START
128};
111/*****************************************************************************/129/*****************************************************************************/
112130
113/**131/**
@@ -196,6 +214,10 @@
196 int (*unlock)(struct gralloc_module_t const* module,214 int (*unlock)(struct gralloc_module_t const* module,
197 buffer_handle_t handle);215 buffer_handle_t handle);
198216
217#ifdef EXYNOS4_ENHANCEMENTS
218 int (*getphys) (struct gralloc_module_t const* module,
219 buffer_handle_t handle, void** paddr);
220#endif
199221
200 /* reserved for future use */222 /* reserved for future use */
201 int (*perform)(struct gralloc_module_t const* module,223 int (*perform)(struct gralloc_module_t const* module,
@@ -215,6 +237,21 @@
215typedef struct alloc_device_t {237typedef struct alloc_device_t {
216 struct hw_device_t common;238 struct hw_device_t common;
217239
240#ifdef QCOM_HARDWARE
241 /*
242 * (*allocSize)() Allocates a buffer in graphic memory with the requested
243 * bufferSize parameter and returns a buffer_handle_t and the stride in
244 * pixels to allow the implementation to satisfy hardware constraints on
245 * the width of a pixmap (eg: it may have to be multiple of 8 pixels).
246 * The CALLER TAKES OWNERSHIP of the buffer_handle_t.
247 *
248 * Returns 0 on success or -errno on error.
249 */
250 int (*allocSize)(struct alloc_device_t* dev,
251 int w, int h, int format, int usage,
252 buffer_handle_t* handle, int* stride, int bufferSize);
253#endif
254
218 /* 255 /*
219 * (*alloc)() Allocates a buffer in graphic memory with the requested256 * (*alloc)() Allocates a buffer in graphic memory with the requested
220 * parameters and returns a buffer_handle_t and the stride in pixels to257 * parameters and returns a buffer_handle_t and the stride in pixels to
@@ -266,4 +303,4 @@
266303
267__END_DECLS304__END_DECLS
268305
269#endif // ANDROID_ALLOC_INTERFACE_H306#endif // ANDROID_GRALLOC_INTERFACE_H
270307
=== modified file '3rd_party/android-deps/hardware/hardware.h'
--- 3rd_party/android-deps/hardware/hardware.h 2013-01-08 17:44:16 +0000
+++ 3rd_party/android-deps/hardware/hardware.h 2013-03-06 00:16:21 +0000
@@ -33,6 +33,60 @@
3333
34#define HARDWARE_MODULE_TAG MAKE_TAG_CONSTANT('H', 'W', 'M', 'T')34#define HARDWARE_MODULE_TAG MAKE_TAG_CONSTANT('H', 'W', 'M', 'T')
35#define HARDWARE_DEVICE_TAG MAKE_TAG_CONSTANT('H', 'W', 'D', 'T')35#define HARDWARE_DEVICE_TAG MAKE_TAG_CONSTANT('H', 'W', 'D', 'T')
36#ifdef QCOM_HARDWARE
37#define IS_TARGET_MPQ(status) \
38{ \
39 int id = 0; \
40 FILE *fp; \
41 if ((fp = fopen("/sys/devices/system/soc/soc0/id", "r")) != NULL) { \
42 fscanf(fp, "%d", &id); \
43 fclose(fp); \
44 } \
45 if (id == 130) \
46 status = 1; \
47 else \
48 status = 0;\
49}
50#endif
51#define HARDWARE_MAKE_API_VERSION(maj,min) \
52 ((((maj) & 0xff) << 8) | ((min) & 0xff))
53
54#define HARDWARE_MAKE_API_VERSION_2(maj,min,hdr) \
55 ((((maj) & 0xff) << 24) | (((min) & 0xff) << 16) | ((hdr) & 0xffff))
56#define HARDWARE_API_VERSION_2_MAJ_MIN_MASK 0xffff0000
57#define HARDWARE_API_VERSION_2_HEADER_MASK 0x0000ffff
58
59
60/*
61 * The current HAL API version.
62 *
63 * All module implementations must set the hw_module_t.hal_api_version field
64 * to this value when declaring the module with HAL_MODULE_INFO_SYM.
65 *
66 * Note that previous implementations have always set this field to 0.
67 * Therefore, libhardware HAL API will always consider versions 0.0 and 1.0
68 * to be 100% binary compatible.
69 *
70 */
71#define HARDWARE_HAL_API_VERSION HARDWARE_MAKE_API_VERSION(1, 0)
72
73/*
74 * Helper macros for module implementors.
75 *
76 * The derived modules should provide convenience macros for supported
77 * versions so that implementations can explicitly specify module/device
78 * versions at definition time.
79 *
80 * Use this macro to set the hw_module_t.module_api_version field.
81 */
82#define HARDWARE_MODULE_API_VERSION(maj,min) HARDWARE_MAKE_API_VERSION(maj,min)
83#define HARDWARE_MODULE_API_VERSION_2(maj,min,hdr) HARDWARE_MAKE_API_VERSION_2(maj,min,hdr)
84
85/*
86 * Use this macro to set the hw_device_t.version field
87 */
88#define HARDWARE_DEVICE_API_VERSION(maj,min) HARDWARE_MAKE_API_VERSION(maj,min)
89#define HARDWARE_DEVICE_API_VERSION_2(maj,min,hdr) HARDWARE_MAKE_API_VERSION_2(maj,min,hdr)
3690
37struct hw_module_t;91struct hw_module_t;
38struct hw_module_methods_t;92struct hw_module_methods_t;
@@ -47,11 +101,47 @@
47 /** tag must be initialized to HARDWARE_MODULE_TAG */101 /** tag must be initialized to HARDWARE_MODULE_TAG */
48 uint32_t tag;102 uint32_t tag;
49103
50 /** major version number for the module */104 /**
51 uint16_t version_major;105 * The API version of the implemented module. The module owner is
106 * responsible for updating the version when a module interface has
107 * changed.
108 *
109 * The derived modules such as gralloc and audio own and manage this field.
110 * The module user must interpret the version field to decide whether or
111 * not to inter-operate with the supplied module implementation.
112 * For example, SurfaceFlinger is responsible for making sure that
113 * it knows how to manage different versions of the gralloc-module API,
114 * and AudioFlinger must know how to do the same for audio-module API.
115 *
116 * The module API version should include a major and a minor component.
117 * For example, version 1.0 could be represented as 0x0100. This format
118 * implies that versions 0x0100-0x01ff are all API-compatible.
119 *
120 * In the future, libhardware will expose a hw_get_module_version()
121 * (or equivalent) function that will take minimum/maximum supported
122 * versions as arguments and would be able to reject modules with
123 * versions outside of the supplied range.
124 */
125 uint16_t module_api_version;
126#define version_major module_api_version
127 /**
128 * version_major/version_minor defines are supplied here for temporary
129 * source code compatibility. They will be removed in the next version.
130 * ALL clients must convert to the new version format.
131 */
52132
53 /** minor version number of the module */133 /**
54 uint16_t version_minor;134 * The API version of the HAL module interface. This is meant to
135 * version the hw_module_t, hw_module_methods_t, and hw_device_t
136 * structures and definitions.
137 *
138 * The HAL interface owns this field. Module users/implementations
139 * must NOT rely on this value for version information.
140 *
141 * Presently, 0 is the only valid value.
142 */
143 uint16_t hal_api_version;
144#define version_minor hal_api_version
55145
56 /** Identifier of module */146 /** Identifier of module */
57 const char *id;147 const char *id;
@@ -88,7 +178,22 @@
88 /** tag must be initialized to HARDWARE_DEVICE_TAG */178 /** tag must be initialized to HARDWARE_DEVICE_TAG */
89 uint32_t tag;179 uint32_t tag;
90180
91 /** version number for hw_device_t */181 /**
182 * Version of the module-specific device API. This value is used by
183 * the derived-module user to manage different device implementations.
184 *
185 * The module user is responsible for checking the module_api_version
186 * and device version fields to ensure that the user is capable of
187 * communicating with the specific module implementation.
188 *
189 * One module can support multiple devices with different versions. This
190 * can be useful when a device interface changes in an incompatible way
191 * but it is still necessary to support older implementations at the same
192 * time. One such example is the Camera 2.0 API.
193 *
194 * This field is interpreted by the module user and is ignored by the
195 * HAL interface itself.
196 */
92 uint32_t version;197 uint32_t version;
93198
94 /** reference to the module this device belongs to */199 /** reference to the module this device belongs to */
95200
=== modified file '3rd_party/android-deps/hardware/hwcomposer.h'
--- 3rd_party/android-deps/hardware/hwcomposer.h 2013-01-08 17:44:16 +0000
+++ 3rd_party/android-deps/hardware/hwcomposer.h 2013-03-06 00:16:21 +0000
@@ -24,11 +24,30 @@
24#include <hardware/hardware.h>24#include <hardware/hardware.h>
25#include <cutils/native_handle.h>25#include <cutils/native_handle.h>
2626
27#include <hardware/hwcomposer_defs.h>
28
27__BEGIN_DECLS29__BEGIN_DECLS
2830
29/*****************************************************************************/31/*****************************************************************************/
3032
31#define HWC_API_VERSION 133/* for compatibility */
34#define HWC_MODULE_API_VERSION HWC_MODULE_API_VERSION_0_1
35#define HWC_DEVICE_API_VERSION HWC_DEVICE_API_VERSION_0_1
36#define HWC_API_VERSION HWC_DEVICE_API_VERSION
37
38/* Users of this header can define HWC_REMOVE_DEPRECATED_VERSIONS to test that
39 * they still work with just the current version declared, before the
40 * deprecated versions are actually removed.
41 *
42 * To find code that still depends on the old versions, set the #define to 1
43 * here. Code that explicitly sets it to zero (rather than simply not defining
44 * it) will still see the old versions.
45 */
46#if !defined(HWC_REMOVE_DEPRECATED_VERSIONS)
47#define HWC_REMOVE_DEPRECATED_VERSIONS 0
48#endif
49
50/*****************************************************************************/
3251
33/**52/**
34 * The id of this module53 * The id of this module
@@ -40,89 +59,6 @@
40 */59 */
41#define HWC_HARDWARE_COMPOSER "composer"60#define HWC_HARDWARE_COMPOSER "composer"
4261
43
44enum {
45 /* hwc_composer_device_t::set failed in EGL */
46 HWC_EGL_ERROR = -1
47};
48
49/*
50 * hwc_layer_t::hints values
51 * Hints are set by the HAL and read by SurfaceFlinger
52 */
53enum {
54 /*
55 * HWC can set the HWC_HINT_TRIPLE_BUFFER hint to indicate to SurfaceFlinger
56 * that it should triple buffer this layer. Typically HWC does this when
57 * the layer will be unavailable for use for an extended period of time,
58 * e.g. if the display will be fetching data directly from the layer and
59 * the layer can not be modified until after the next set().
60 */
61 HWC_HINT_TRIPLE_BUFFER = 0x00000001,
62
63 /*
64 * HWC sets HWC_HINT_CLEAR_FB to tell SurfaceFlinger that it should clear the
65 * framebuffer with transparent pixels where this layer would be.
66 * SurfaceFlinger will only honor this flag when the layer has no blending
67 *
68 */
69 HWC_HINT_CLEAR_FB = 0x00000002
70};
71
72/*
73 * hwc_layer_t::flags values
74 * Flags are set by SurfaceFlinger and read by the HAL
75 */
76enum {
77 /*
78 * HWC_SKIP_LAYER is set by SurfaceFlnger to indicate that the HAL
79 * shall not consider this layer for composition as it will be handled
80 * by SurfaceFlinger (just as if compositionType was set to HWC_OVERLAY).
81 */
82 HWC_SKIP_LAYER = 0x00000001,
83};
84
85/*
86 * hwc_layer_t::compositionType values
87 */
88enum {
89 /* this layer is to be drawn into the framebuffer by SurfaceFlinger */
90 HWC_FRAMEBUFFER = 0,
91
92 /* this layer will be handled in the HWC */
93 HWC_OVERLAY = 1,
94};
95
96/*
97 * hwc_layer_t::blending values
98 */
99enum {
100 /* no blending */
101 HWC_BLENDING_NONE = 0x0100,
102
103 /* ONE / ONE_MINUS_SRC_ALPHA */
104 HWC_BLENDING_PREMULT = 0x0105,
105
106 /* SRC_ALPHA / ONE_MINUS_SRC_ALPHA */
107 HWC_BLENDING_COVERAGE = 0x0405
108};
109
110/*
111 * hwc_layer_t::transform values
112 */
113enum {
114 /* flip source image horizontally */
115 HWC_TRANSFORM_FLIP_H = HAL_TRANSFORM_FLIP_H,
116 /* flip source image vertically */
117 HWC_TRANSFORM_FLIP_V = HAL_TRANSFORM_FLIP_V,
118 /* rotate source image 90 degrees clock-wise */
119 HWC_TRANSFORM_ROT_90 = HAL_TRANSFORM_ROT_90,
120 /* rotate source image 180 degrees */
121 HWC_TRANSFORM_ROT_180 = HAL_TRANSFORM_ROT_180,
122 /* rotate source image 270 degrees clock-wise */
123 HWC_TRANSFORM_ROT_270 = HAL_TRANSFORM_ROT_270,
124};
125
126typedef struct hwc_rect {62typedef struct hwc_rect {
127 int left;63 int left;
128 int top;64 int top;
@@ -135,69 +71,163 @@
135 hwc_rect_t const* rects;71 hwc_rect_t const* rects;
136} hwc_region_t;72} hwc_region_t;
13773
138typedef struct hwc_layer {74typedef struct hwc_color {
75 uint8_t r;
76 uint8_t g;
77 uint8_t b;
78 uint8_t a;
79} hwc_color_t;
80
81typedef struct hwc_layer_1 {
139 /*82 /*
140 * initially set to HWC_FRAMEBUFFER, indicates the layer will83 * compositionType is used to specify this layer's type and is set by either
141 * be drawn into the framebuffer using OpenGL ES.84 * the hardware composer implementation, or by the caller (see below).
142 * The HWC can toggle this value to HWC_OVERLAY, to indicate85 *
143 * it will handle the layer.86 * This field is always reset to HWC_BACKGROUND or HWC_FRAMEBUFFER
87 * before (*prepare)() is called when the HWC_GEOMETRY_CHANGED flag is
88 * also set, otherwise, this field is preserved between (*prepare)()
89 * calls.
90 *
91 * HWC_BACKGROUND
92 * Always set by the caller before calling (*prepare)(), this value
93 * indicates this is a special "background" layer. The only valid field
94 * is backgroundColor.
95 * The HWC can toggle this value to HWC_FRAMEBUFFER to indicate it CANNOT
96 * handle the background color.
97 *
98 *
99 * HWC_FRAMEBUFFER_TARGET
100 * Always set by the caller before calling (*prepare)(), this value
101 * indicates this layer is the framebuffer surface used as the target of
102 * OpenGL ES composition. If the HWC sets all other layers to HWC_OVERLAY
103 * or HWC_BACKGROUND, then no OpenGL ES composition will be done, and
104 * this layer should be ignored during set().
105 *
106 * This flag (and the framebuffer surface layer) will only be used if the
107 * HWC version is HWC_DEVICE_API_VERSION_1_1 or higher. In older versions,
108 * the OpenGL ES target surface is communicated by the (dpy, sur) fields
109 * in hwc_compositor_device_1_t.
110 *
111 * This value cannot be set by the HWC implementation.
112 *
113 *
114 * HWC_FRAMEBUFFER
115 * Set by the caller before calling (*prepare)() ONLY when the
116 * HWC_GEOMETRY_CHANGED flag is also set.
117 *
118 * Set by the HWC implementation during (*prepare)(), this indicates
119 * that the layer will be drawn into the framebuffer using OpenGL ES.
120 * The HWC can toggle this value to HWC_OVERLAY to indicate it will
121 * handle the layer.
122 *
123 *
124 * HWC_OVERLAY
125 * Set by the HWC implementation during (*prepare)(), this indicates
126 * that the layer will be handled by the HWC (ie: it must not be
127 * composited with OpenGL ES).
128 *
144 */129 */
145 int32_t compositionType;130 int32_t compositionType;
146131
147 /* see hwc_layer_t::hints above */132 /*
133 * hints is bit mask set by the HWC implementation during (*prepare)().
134 * It is preserved between (*prepare)() calls, unless the
135 * HWC_GEOMETRY_CHANGED flag is set, in which case it is reset to 0.
136 *
137 * see hwc_layer_t::hints
138 */
148 uint32_t hints;139 uint32_t hints;
149140
150 /* see hwc_layer_t::flags above */141 /* see hwc_layer_t::flags */
151 uint32_t flags;142 uint32_t flags;
152143
153 /* handle of buffer to compose. this handle is guaranteed to have been144 union {
154 * allocated with gralloc */145 /* color of the background. hwc_color_t.a is ignored */
155 buffer_handle_t handle;146 hwc_color_t backgroundColor;
156147
157 /* transformation to apply to the buffer during composition */148 struct {
158 uint32_t transform;149 /* handle of buffer to compose. This handle is guaranteed to have been
159150 * allocated from gralloc using the GRALLOC_USAGE_HW_COMPOSER usage flag. If
160 /* blending to apply during composition */151 * the layer's handle is unchanged across two consecutive prepare calls and
161 int32_t blending;152 * the HWC_GEOMETRY_CHANGED flag is not set for the second call then the
162153 * HWComposer implementation may assume that the contents of the buffer have
163 /* area of the source to consider, the origin is the top-left corner of154 * not changed. */
164 * the buffer */155 buffer_handle_t handle;
165 hwc_rect_t sourceCrop;156
166157 /* transformation to apply to the buffer during composition */
167 /* where to composite the sourceCrop onto the display. The sourceCrop158 uint32_t transform;
168 * is scaled using linear filtering to the displayFrame. The origin is the159
169 * top-left corner of the screen.160#ifdef QCOM_HARDWARE
170 */161 /* source transform of the buffer */
171 hwc_rect_t displayFrame;162 uint32_t sourceTransform;
172163#endif
173 /* visible region in screen space. The origin is the164
174 * top-left corner of the screen.165 /* blending to apply during composition */
175 * The visible region INCLUDES areas overlapped by a translucent layer.166 int32_t blending;
176 */167
177 hwc_region_t visibleRegionScreen;168 /* area of the source to consider, the origin is the top-left corner of
178} hwc_layer_t;169 * the buffer */
179170 hwc_rect_t sourceCrop;
180171
181/*172 /* where to composite the sourceCrop onto the display. The sourceCrop
182 * hwc_layer_list_t::flags values173 * is scaled using linear filtering to the displayFrame. The origin is the
183 */174 * top-left corner of the screen.
184enum {175 */
185 /*176 hwc_rect_t displayFrame;
186 * HWC_GEOMETRY_CHANGED is set by SurfaceFlinger to indicate that the list177
187 * passed to (*prepare)() has changed by more than just the buffer handles.178 /* visible region in screen space. The origin is the
188 */179 * top-left corner of the screen.
189 HWC_GEOMETRY_CHANGED = 0x00000001,180 * The visible region INCLUDES areas overlapped by a translucent layer.
190};181 */
191182 hwc_region_t visibleRegionScreen;
192/*183
193 * List of layers.184 /* Sync fence object that will be signaled when the buffer's
194 * The handle members of hwLayers elements must be unique.185 * contents are available. May be -1 if the contents are already
195 */186 * available. This field is only valid during set(), and should be
196typedef struct hwc_layer_list {187 * ignored during prepare(). The set() call must not wait for the
197 uint32_t flags;188 * fence to be signaled before returning, but the HWC must wait for
198 size_t numHwLayers;189 * all buffers to be signaled before reading from them.
199 hwc_layer_t hwLayers[0];190 *
200} hwc_layer_list_t;191 * HWC_FRAMEBUFFER layers will never have an acquire fence, since
192 * reads from them are complete before the framebuffer is ready for
193 * display.
194 *
195 * The HWC takes ownership of the acquireFenceFd and is responsible
196 * for closing it when no longer needed.
197 */
198 int acquireFenceFd;
199
200 /* During set() the HWC must set this field to a file descriptor for
201 * a sync fence object that will signal after the HWC has finished
202 * reading from the buffer. The field is ignored by prepare(). Each
203 * layer should have a unique file descriptor, even if more than one
204 * refer to the same underlying fence object; this allows each to be
205 * closed independently.
206 *
207 * If buffer reads can complete at significantly different times,
208 * then using independent fences is preferred. For example, if the
209 * HWC handles some layers with a blit engine and others with
210 * overlays, then the blit layers can be reused immediately after
211 * the blit completes, but the overlay layers can't be reused until
212 * a subsequent frame has been displayed.
213 *
214 * Since HWC doesn't read from HWC_FRAMEBUFFER layers, it shouldn't
215 * produce a release fence for them. The releaseFenceFd will be -1
216 * for these layers when set() is called.
217 *
218 * The HWC client taks ownership of the releaseFenceFd and is
219 * responsible for closing it when no longer needed.
220 */
221 int releaseFenceFd;
222 };
223 };
224
225 /* Allow for expansion w/o breaking binary compatibility.
226 * Pad layer to 96 bytes, assuming 32-bit pointers.
227 */
228 int32_t reserved[24 - 18];
229
230} hwc_layer_1_t;
201231
202/* This represents a display, typically an EGLDisplay object */232/* This represents a display, typically an EGLDisplay object */
203typedef void* hwc_display_t;233typedef void* hwc_display_t;
@@ -205,10 +235,82 @@
205/* This represents a surface, typically an EGLSurface object */235/* This represents a surface, typically an EGLSurface object */
206typedef void* hwc_surface_t;236typedef void* hwc_surface_t;
207237
238/*
239 * hwc_display_contents_1_t::flags values
240 */
241enum {
242 /*
243 * HWC_GEOMETRY_CHANGED is set by SurfaceFlinger to indicate that the list
244 * passed to (*prepare)() has changed by more than just the buffer handles
245 * and acquire fences.
246 */
247 HWC_GEOMETRY_CHANGED = 0x00000001,
248};
249
250/*
251 * Description of the contents to output on a display.
252 *
253 * This is the top-level structure passed to the prepare and set calls to
254 * negotiate and commit the composition of a display image.
255 */
256typedef struct hwc_display_contents_1 {
257 /* File descriptor referring to a Sync HAL fence object which will signal
258 * when this composition is retired. For a physical display, a composition
259 * is retired when it has been replaced on-screen by a subsequent set. For
260 * a virtual display, the composition is retired when the writes to
261 * outputBuffer are complete and can be read. The fence object is created
262 * and returned by the set call; this field will be -1 on entry to prepare
263 * and set. SurfaceFlinger will close the returned file descriptor.
264 */
265 int retireFenceFd;
266
267 union {
268 /* Fields only relevant for HWC_DEVICE_VERSION_1_0. */
269 struct {
270 /* (dpy, sur) is the target of SurfaceFlinger's OpenGL ES
271 * composition for HWC_DEVICE_VERSION_1_0. They aren't relevant to
272 * prepare. The set call should commit this surface atomically to
273 * the display along with any overlay layers.
274 */
275 hwc_display_t dpy;
276 hwc_surface_t sur;
277 };
278
279 /* Fields only relevant for HWC_DEVICE_VERSION_1_2 and later. */
280 struct {
281 /* outbuf is the buffer that receives the composed image for
282 * virtual displays. Writes to the outbuf must wait until
283 * outbufAcquireFenceFd signals. A fence that will signal when
284 * writes to outbuf are complete should be returned in
285 * retireFenceFd.
286 *
287 * For physical displays, outbuf will be NULL.
288 */
289 buffer_handle_t outbuf;
290
291 /* File descriptor for a fence that will signal when outbuf is
292 * ready to be written. The h/w composer is responsible for closing
293 * this when no longer needed.
294 *
295 * Will be -1 whenever outbuf is NULL, or when the outbuf can be
296 * written immediately.
297 */
298 int outbufAcquireFenceFd;
299 };
300 };
301
302 /* List of layers that will be composed on the display. The buffer handles
303 * in the list will be unique. If numHwLayers is 0, all composition will be
304 * performed by SurfaceFlinger.
305 */
306 uint32_t flags;
307 size_t numHwLayers;
308 hwc_layer_1_t hwLayers[0];
309
310} hwc_display_contents_1_t;
208311
209/* see hwc_composer_device::registerProcs()312/* see hwc_composer_device::registerProcs()
210 * Any of the callbacks can be NULL, in which case the corresponding313 * All of the callbacks are required and non-NULL unless otherwise noted.
211 * functionality is not supported.
212 */314 */
213typedef struct hwc_procs {315typedef struct hwc_procs {
214 /*316 /*
@@ -220,7 +322,52 @@
220 * it is safe to call invalidate() from any of hwc_composer_device322 * it is safe to call invalidate() from any of hwc_composer_device
221 * hooks, unless noted otherwise.323 * hooks, unless noted otherwise.
222 */324 */
223 void (*invalidate)(struct hwc_procs* procs);325 void (*invalidate)(const struct hwc_procs* procs);
326
327 /*
328 * (*vsync)() is called by the h/w composer HAL when a vsync event is
329 * received and HWC_EVENT_VSYNC is enabled on a display
330 * (see: hwc_event_control).
331 *
332 * the "disp" parameter indicates which display the vsync event is for.
333 * the "timestamp" parameter is the system monotonic clock timestamp in
334 * nanosecond of when the vsync event happened.
335 *
336 * vsync() is GUARANTEED TO NOT CALL BACK into the h/w composer HAL.
337 *
338 * It is expected that vsync() is called from a thread of at least
339 * HAL_PRIORITY_URGENT_DISPLAY with as little latency as possible,
340 * typically less than 0.5 ms.
341 *
342 * It is a (silent) error to have HWC_EVENT_VSYNC enabled when calling
343 * hwc_composer_device.set(..., 0, 0, 0) (screen off). The implementation
344 * can either stop or continue to process VSYNC events, but must not
345 * crash or cause other problems.
346 */
347 void (*vsync)(const struct hwc_procs* procs, int disp, int64_t timestamp);
348
349 /*
350 * (*hotplug)() is called by the h/w composer HAL when a display is
351 * connected or disconnected. The PRIMARY display is always connected and
352 * the hotplug callback should not be called for it.
353 *
354 * The disp parameter indicates which display type this event is for.
355 * The connected parameter indicates whether the display has just been
356 * connected (1) or disconnected (0).
357 *
358 * The hotplug() callback may call back into the h/w composer on the same
359 * thread to query refresh rate and dpi for the display. Additionally,
360 * other threads may be calling into the h/w composer while the callback
361 * is in progress.
362 *
363 * The h/w composer must serialize calls to the hotplug callback; only
364 * one thread may call it at a time.
365 *
366 * This callback will be NULL if the h/w composer is using
367 * HWC_DEVICE_API_VERSION_1_0.
368 */
369 void (*hotplug)(const struct hwc_procs* procs, int disp, int connected);
370
224} hwc_procs_t;371} hwc_procs_t;
225372
226373
@@ -230,8 +377,7 @@
230 struct hw_module_t common;377 struct hw_module_t common;
231} hwc_module_t;378} hwc_module_t;
232379
233380typedef struct hwc_composer_device_1 {
234typedef struct hwc_composer_device {
235 struct hw_device_t common;381 struct hw_device_t common;
236382
237 /*383 /*
@@ -240,115 +386,207 @@
240 *386 *
241 * (*prepare)() can be called more than once, the last call prevails.387 * (*prepare)() can be called more than once, the last call prevails.
242 *388 *
243 * The HWC responds by setting the compositionType field to either389 * The HWC responds by setting the compositionType field in each layer to
244 * HWC_FRAMEBUFFER or HWC_OVERLAY. In the former case, the composition for390 * either HWC_FRAMEBUFFER or HWC_OVERLAY. In the former case, the
245 * this layer is handled by SurfaceFlinger with OpenGL ES, in the later391 * composition for the layer is handled by SurfaceFlinger with OpenGL ES,
246 * case, the HWC will have to handle this layer's composition.392 * in the later case, the HWC will have to handle the layer's composition.
393 * compositionType and hints are preserved between (*prepare)() calles
394 * unless the HWC_GEOMETRY_CHANGED flag is set.
247 *395 *
248 * (*prepare)() is called with HWC_GEOMETRY_CHANGED to indicate that the396 * (*prepare)() is called with HWC_GEOMETRY_CHANGED to indicate that the
249 * list's geometry has changed, that is, when more than just the buffer's397 * list's geometry has changed, that is, when more than just the buffer's
250 * handles have been updated. Typically this happens (but is not limited to)398 * handles have been updated. Typically this happens (but is not limited to)
251 * when a window is added, removed, resized or moved.399 * when a window is added, removed, resized or moved. In this case
252 *400 * compositionType and hints are reset to their default value.
253 * a NULL list parameter or a numHwLayers of zero indicates that the401 *
254 * entire composition will be handled by SurfaceFlinger with OpenGL ES.402 * For HWC 1.0, numDisplays will always be one, and displays[0] will be
403 * non-NULL.
404 *
405 * For HWC 1.1, numDisplays will always be HWC_NUM_DISPLAY_TYPES. Entries
406 * for unsupported or disabled/disconnected display types will be NULL.
407 *
408 * For HWC 1.2 and later, numDisplays will be HWC_NUM_DISPLAY_TYPES or more.
409 * The extra entries correspond to enabled virtual displays, and will be
410 * non-NULL. In HWC 1.2, support for one virtual display is required, and
411 * no more than one will be used. Future HWC versions might require more.
255 *412 *
256 * returns: 0 on success. An negative error code on error. If an error is413 * returns: 0 on success. An negative error code on error. If an error is
257 * returned, SurfaceFlinger will assume that none of the layer will be414 * returned, SurfaceFlinger will assume that none of the layer will be
258 * handled by the HWC.415 * handled by the HWC.
259 */416 */
260 int (*prepare)(struct hwc_composer_device *dev, hwc_layer_list_t* list);417 int (*prepare)(struct hwc_composer_device_1 *dev,
261418 size_t numDisplays, hwc_display_contents_1_t** displays);
262419
263 /*420 /*
264 * (*set)() is used in place of eglSwapBuffers(), and assumes the same421 * (*set)() is used in place of eglSwapBuffers(), and assumes the same
265 * functionality, except it also commits the work list atomically with422 * functionality, except it also commits the work list atomically with
266 * the actual eglSwapBuffers().423 * the actual eglSwapBuffers().
267 *424 *
268 * The list parameter is guaranteed to be the same as the one returned425 * The layer lists are guaranteed to be the same as the ones returned from
269 * from the last call to (*prepare)().426 * the last call to (*prepare)().
270 *427 *
271 * When this call returns the caller assumes that:428 * When this call returns the caller assumes that the displays will be
272 *429 * updated in the near future with the content of their work lists, without
273 * - the display will be updated in the near future with the content430 * artifacts during the transition from the previous frame.
274 * of the work list, without artifacts during the transition from the431 *
275 * previous frame.432 * A display with zero layers indicates that the entire composition has
276 *433 * been handled by SurfaceFlinger with OpenGL ES. In this case, (*set)()
277 * - all objects are available for immediate access or destruction, in434 * behaves just like eglSwapBuffers().
278 * particular, hwc_region_t::rects data and hwc_layer_t::layer's buffer.435 *
279 * Note that this means that immediately accessing (potentially from a436 * For HWC 1.0, numDisplays will always be one, and displays[0] will be
280 * different process) a buffer used in this call will not result in437 * non-NULL.
281 * screen corruption, the driver must apply proper synchronization or438 *
282 * scheduling (eg: block the caller, such as gralloc_module_t::lock(),439 * For HWC 1.1, numDisplays will always be HWC_NUM_DISPLAY_TYPES. Entries
283 * OpenGL ES, Camera, Codecs, etc..., or schedule the caller's work440 * for unsupported or disabled/disconnected display types will be NULL.
284 * after the buffer is freed from the actual composition).441 *
285 *442 * For HWC 1.2 and later, numDisplays will be HWC_NUM_DISPLAY_TYPES or more.
286 * a NULL list parameter or a numHwLayers of zero indicates that the443 * The extra entries correspond to enabled virtual displays, and will be
287 * entire composition has been handled by SurfaceFlinger with OpenGL ES.444 * non-NULL. In HWC 1.2, support for one virtual display is required, and
288 * In this case, (*set)() behaves just like eglSwapBuffers().445 * no more than one will be used. Future HWC versions might require more.
289 *446 *
290 * dpy, sur, and list are set to NULL to indicate that the screen is447 * IMPORTANT NOTE: There is an implicit layer containing opaque black
291 * turning off. This happens WITHOUT prepare() being called first.448 * pixels behind all the layers in the list. It is the responsibility of
292 * This is a good time to free h/w resources and/or power449 * the hwcomposer module to make sure black pixels are output (or blended
293 * the relevant h/w blocks down.450 * from).
294 *451 *
295 * IMPORTANT NOTE: there is an implicit layer containing opaque black452 * IMPORTANT NOTE: In the event of an error this call *MUST* still cause
296 * pixels behind all the layers in the list.453 * any fences returned in the previous call to set to eventually become
297 * It is the responsibility of the hwcomposer module to make454 * signaled. The caller may have already issued wait commands on these
298 * sure black pixels are output (or blended from).455 * fences, and having set return without causing those fences to signal
299 *456 * will likely result in a deadlock.
300 * returns: 0 on success. An negative error code on error:457 *
301 * HWC_EGL_ERROR: eglGetError() will provide the proper error code458 * returns: 0 on success. A negative error code on error:
459 * HWC_EGL_ERROR: eglGetError() will provide the proper error code (only
460 * allowed prior to HWComposer 1.1)
302 * Another code for non EGL errors.461 * Another code for non EGL errors.
303 *462 */
304 */463 int (*set)(struct hwc_composer_device_1 *dev,
305 int (*set)(struct hwc_composer_device *dev,464 size_t numDisplays, hwc_display_contents_1_t** displays);
306 hwc_display_t dpy,465
307 hwc_surface_t sur,466 /*
308 hwc_layer_list_t* list);467 * eventControl(..., event, enabled)
309 /*468 * Enables or disables h/w composer events for a display.
310 * This hook is OPTIONAL.469 *
470 * eventControl can be called from any thread and takes effect
471 * immediately.
472 *
473 * Supported events are:
474 * HWC_EVENT_VSYNC
475 *
476 * returns -EINVAL if the "event" parameter is not one of the value above
477 * or if the "enabled" parameter is not 0 or 1.
478 */
479 int (*eventControl)(struct hwc_composer_device_1* dev, int disp,
480 int event, int enabled);
481
482 /*
483 * blank(..., blank)
484 * Blanks or unblanks a display's screen.
485 *
486 * Turns the screen off when blank is nonzero, on when blank is zero.
487 * Multiple sequential calls with the same blank value must be supported.
488 * The screen state transition must be be complete when the function
489 * returns.
490 *
491 * returns 0 on success, negative on error.
492 */
493 int (*blank)(struct hwc_composer_device_1* dev, int disp, int blank);
494
495 /*
496 * Used to retrieve information about the h/w composer
497 *
498 * Returns 0 on success or -errno on error.
499 */
500 int (*query)(struct hwc_composer_device_1* dev, int what, int* value);
501
502 /*
503 * (*registerProcs)() registers callbacks that the h/w composer HAL can
504 * later use. It will be called immediately after the composer device is
505 * opened with non-NULL procs. It is FORBIDDEN to call any of the callbacks
506 * from within registerProcs(). registerProcs() must save the hwc_procs_t
507 * pointer which is needed when calling a registered callback.
508 */
509 void (*registerProcs)(struct hwc_composer_device_1* dev,
510 hwc_procs_t const* procs);
511
512 /*
513 * This field is OPTIONAL and can be NULL.
311 *514 *
312 * If non NULL it will be called by SurfaceFlinger on dumpsys515 * If non NULL it will be called by SurfaceFlinger on dumpsys
313 */516 */
314 void (*dump)(struct hwc_composer_device* dev, char *buff, int buff_len);517 void (*dump)(struct hwc_composer_device_1* dev, char *buff, int buff_len);
315518
316 /*519 /*
317 * This hook is OPTIONAL.520 * (*getDisplayConfigs)() returns handles for the configurations available
318 *521 * on the connected display. These handles must remain valid as long as the
319 * (*registerProcs)() registers a set of callbacks the h/w composer HAL522 * display is connected.
320 * can later use. It is FORBIDDEN to call any of the callbacks from523 *
321 * within registerProcs(). registerProcs() must save the hwc_procs_t pointer524 * Configuration handles are written to configs. The number of entries
322 * which is needed when calling a registered callback.525 * allocated by the caller is passed in *numConfigs; getDisplayConfigs must
323 * Each call to registerProcs replaces the previous set of callbacks.526 * not try to write more than this number of config handles. On return, the
324 * registerProcs is called with NULL to unregister all callbacks.527 * total number of configurations available for the display is returned in
325 *528 * *numConfigs. If *numConfigs is zero on entry, then configs may be NULL.
326 * Any of the callbacks can be NULL, in which case the corresponding529 *
327 * functionality is not supported.530 * HWC_DEVICE_API_VERSION_1_1 does not provide a way to choose a config.
328 */531 * For displays that support multiple configurations, the h/w composer
329 void (*registerProcs)(struct hwc_composer_device* dev,532 * implementation should choose one and report it as the first config in
330 hwc_procs_t const* procs);533 * the list. Reporting the not-chosen configs is not required.
331534 *
332 void* reserved_proc[6];535 * Returns 0 on success or -errno on error. If disp is a hotpluggable
333536 * display type and no display is connected, an error should be returned.
334} hwc_composer_device_t;537 *
335538 * This field is REQUIRED for HWC_DEVICE_API_VERSION_1_1 and later.
539 * It should be NULL for previous versions.
540 */
541 int (*getDisplayConfigs)(struct hwc_composer_device_1* dev, int disp,
542 uint32_t* configs, size_t* numConfigs);
543
544 /*
545 * (*getDisplayAttributes)() returns attributes for a specific config of a
546 * connected display. The config parameter is one of the config handles
547 * returned by getDisplayConfigs.
548 *
549 * The list of attributes to return is provided in the attributes
550 * parameter, terminated by HWC_DISPLAY_NO_ATTRIBUTE. The value for each
551 * requested attribute is written in order to the values array. The
552 * HWC_DISPLAY_NO_ATTRIBUTE attribute does not have a value, so the values
553 * array will have one less value than the attributes array.
554 *
555 * This field is REQUIRED for HWC_DEVICE_API_VERSION_1_1 and later.
556 * It should be NULL for previous versions.
557 *
558 * If disp is a hotpluggable display type and no display is connected,
559 * or if config is not a valid configuration for the display, a negative
560 * value should be returned.
561 */
562 int (*getDisplayAttributes)(struct hwc_composer_device_1* dev, int disp,
563 uint32_t config, const uint32_t* attributes, int32_t* values);
564
565 /*
566 * Reserved for future use. Must be NULL.
567 */
568 void* reserved_proc[4];
569
570} hwc_composer_device_1_t;
336571
337/** convenience API for opening and closing a device */572/** convenience API for opening and closing a device */
338573
339static inline int hwc_open(const struct hw_module_t* module,574static inline int hwc_open_1(const struct hw_module_t* module,
340 hwc_composer_device_t** device) {575 hwc_composer_device_1_t** device) {
341 return module->methods->open(module,576 return module->methods->open(module,
342 HWC_HARDWARE_COMPOSER, (struct hw_device_t**)device);577 HWC_HARDWARE_COMPOSER, (struct hw_device_t**)device);
343}578}
344579
345static inline int hwc_close(hwc_composer_device_t* device) {580static inline int hwc_close_1(hwc_composer_device_1_t* device) {
346 return device->common.close(&device->common);581 return device->common.close(&device->common);
347}582}
348583
349
350/*****************************************************************************/584/*****************************************************************************/
351585
586#if !HWC_REMOVE_DEPRECATED_VERSIONS
587#include <hardware/hwcomposer_v0.h>
588#endif
589
352__END_DECLS590__END_DECLS
353591
354#endif /* ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_H */592#endif /* ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_H */
355593
=== removed file '3rd_party/android-deps/hardware/lights.h'
--- 3rd_party/android-deps/hardware/lights.h 2013-01-08 17:44:16 +0000
+++ 3rd_party/android-deps/hardware/lights.h 1970-01-01 00:00:00 +0000
@@ -1,137 +0,0 @@
1/*
2 * Copyright (C) 2008 The Android Open Source Project
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17#ifndef ANDROID_LIGHTS_INTERFACE_H
18#define ANDROID_LIGHTS_INTERFACE_H
19
20#include <stdint.h>
21#include <sys/cdefs.h>
22#include <sys/types.h>
23
24#include <hardware/hardware.h>
25
26__BEGIN_DECLS
27
28/**
29 * The id of this module
30 */
31#define LIGHTS_HARDWARE_MODULE_ID "lights"
32
33/*
34 * These light IDs correspond to logical lights, not physical.
35 * So for example, if your INDICATOR light is in line with your
36 * BUTTONS, it might make sense to also light the INDICATOR
37 * light to a reasonable color when the BUTTONS are lit.
38 */
39#define LIGHT_ID_BACKLIGHT "backlight"
40#define LIGHT_ID_KEYBOARD "keyboard"
41#define LIGHT_ID_BUTTONS "buttons"
42#define LIGHT_ID_BATTERY "battery"
43#define LIGHT_ID_NOTIFICATIONS "notifications"
44#define LIGHT_ID_ATTENTION "attention"
45
46/*
47 * These lights aren't currently supported by the higher
48 * layers, but could be someday, so we have the constants
49 * here now.
50 */
51#define LIGHT_ID_BLUETOOTH "bluetooth"
52#define LIGHT_ID_WIFI "wifi"
53
54/* ************************************************************************
55 * Flash modes for the flashMode field of light_state_t.
56 */
57
58#define LIGHT_FLASH_NONE 0
59
60/**
61 * To flash the light at a given rate, set flashMode to LIGHT_FLASH_TIMED,
62 * and then flashOnMS should be set to the number of milliseconds to turn
63 * the light on, followed by the number of milliseconds to turn the light
64 * off.
65 */
66#define LIGHT_FLASH_TIMED 1
67
68/**
69 * To flash the light using hardware assist, set flashMode to
70 * the hardware mode.
71 */
72#define LIGHT_FLASH_HARDWARE 2
73
74/**
75 * Light brightness is managed by a user setting.
76 */
77#define BRIGHTNESS_MODE_USER 0
78
79/**
80 * Light brightness is managed by a light sensor.
81 */
82#define BRIGHTNESS_MODE_SENSOR 1
83
84/**
85 * The parameters that can be set for a given light.
86 *
87 * Not all lights must support all parameters. If you
88 * can do something backward-compatible, you should.
89 */
90struct light_state_t {
91 /**
92 * The color of the LED in ARGB.
93 *
94 * Do your best here.
95 * - If your light can only do red or green, if they ask for blue,
96 * you should do green.
97 * - If you can only do a brightness ramp, then use this formula:
98 * unsigned char brightness = ((77*((color>>16)&0x00ff))
99 * + (150*((color>>8)&0x00ff)) + (29*(color&0x00ff))) >> 8;
100 * - If you can only do on or off, 0 is off, anything else is on.
101 *
102 * The high byte should be ignored. Callers will set it to 0xff (which
103 * would correspond to 255 alpha).
104 */
105 unsigned int color;
106
107 /**
108 * See the LIGHT_FLASH_* constants
109 */
110 int flashMode;
111 int flashOnMS;
112 int flashOffMS;
113
114 /**
115 * Policy used by the framework to manage the light's brightness.
116 * Currently the values are BRIGHTNESS_MODE_USER and BRIGHTNESS_MODE_SENSOR.
117 */
118 int brightnessMode;
119};
120
121struct light_device_t {
122 struct hw_device_t common;
123
124 /**
125 * Set the provided lights to the provided values.
126 *
127 * Returns: 0 on succes, error code on failure.
128 */
129 int (*set_light)(struct light_device_t* dev,
130 struct light_state_t const* state);
131};
132
133
134__END_DECLS
135
136#endif // ANDROID_LIGHTS_INTERFACE_H
137
1380
=== removed file '3rd_party/android-deps/hardware/nfc.h'
--- 3rd_party/android-deps/hardware/nfc.h 2013-01-08 17:44:16 +0000
+++ 3rd_party/android-deps/hardware/nfc.h 1970-01-01 00:00:00 +0000
@@ -1,96 +0,0 @@
1/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17
18#ifndef ANDROID_NFC_HAL_INTERFACE_H
19#define ANDROID_NFC_HAL_INTERFACE_H
20
21#include <stdint.h>
22#include <strings.h>
23#include <sys/cdefs.h>
24#include <sys/types.h>
25
26#include <hardware/hardware.h>
27
28__BEGIN_DECLS
29
30#define NFC_HARDWARE_MODULE_ID "nfc"
31
32/*
33 * Begin PN544 specific HAL
34 */
35#define NFC_PN544_CONTROLLER "pn544"
36
37typedef struct nfc_module_t {
38 struct hw_module_t common;
39} nfc_module_t;
40
41/*
42 * PN544 linktypes.
43 * UART
44 * I2C
45 * USB (uses UART DAL)
46 */
47typedef enum {
48 PN544_LINK_TYPE_UART,
49 PN544_LINK_TYPE_I2C,
50 PN544_LINK_TYPE_USB,
51 PN544_LINK_TYPE_INVALID,
52} nfc_pn544_linktype;
53
54typedef struct {
55 struct hw_device_t common;
56
57 /* The number of EEPROM registers to write */
58 uint32_t num_eeprom_settings;
59
60 /* The actual EEPROM settings
61 * For PN544, each EEPROM setting is a 4-byte entry,
62 * of the format [0x00, addr_msb, addr_lsb, value].
63 */
64 uint8_t* eeprom_settings;
65
66 /* The link type to which the PN544 is connected */
67 nfc_pn544_linktype linktype;
68
69 /* The device node to which the PN544 is connected */
70 const char* device_node;
71
72 /* On Crespo we had an I2C issue that would cause us to sometimes read
73 * the I2C slave address (0x57) over the bus. libnfc contains
74 * a hack to ignore this byte and try to read the length byte
75 * again.
76 * Set to 0 to disable the workaround, 1 to enable it.
77 */
78 uint8_t enable_i2c_workaround;
79} nfc_pn544_device_t;
80
81static inline int nfc_pn544_open(const struct hw_module_t* module,
82 nfc_pn544_device_t** dev) {
83 return module->methods->open(module, NFC_PN544_CONTROLLER,
84 (struct hw_device_t**) dev);
85}
86
87static inline int nfc_pn544_close(nfc_pn544_device_t* dev) {
88 return dev->common.close(&dev->common);
89}
90/*
91 * End PN544 specific HAL
92 */
93
94__END_DECLS
95
96#endif // ANDROID_NFC_HAL_INTERFACE_H
970
=== removed file '3rd_party/android-deps/hardware/qemu_pipe.h'
--- 3rd_party/android-deps/hardware/qemu_pipe.h 2013-01-08 17:44:16 +0000
+++ 3rd_party/android-deps/hardware/qemu_pipe.h 1970-01-01 00:00:00 +0000
@@ -1,91 +0,0 @@
1/*
2 * Copyright (C) 2011 The Android Open Source Project
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16#ifndef ANDROID_INCLUDE_HARDWARE_QEMU_PIPE_H
17#define ANDROID_INCLUDE_HARDWARE_QEMU_PIPE_H
18
19#include <sys/cdefs.h>
20#include <unistd.h>
21#include <fcntl.h>
22#include <sys/mman.h>
23#include <pthread.h> /* for pthread_once() */
24#include <stdlib.h>
25#include <stdio.h>
26#include <errno.h>
27
28#ifndef D
29# define D(...) do{}while(0)
30#endif
31
32/* Try to open a new Qemu fast-pipe. This function returns a file descriptor
33 * that can be used to communicate with a named service managed by the
34 * emulator.
35 *
36 * This file descriptor can be used as a standard pipe/socket descriptor.
37 *
38 * 'pipeName' is the name of the emulator service you want to connect to.
39 * E.g. 'opengles' or 'camera'.
40 *
41 * On success, return a valid file descriptor
42 * Returns -1 on error, and errno gives the error code, e.g.:
43 *
44 * EINVAL -> unknown/unsupported pipeName
45 * ENOSYS -> fast pipes not available in this system.
46 *
47 * ENOSYS should never happen, except if you're trying to run within a
48 * misconfigured emulator.
49 *
50 * You should be able to open several pipes to the same pipe service,
51 * except for a few special cases (e.g. GSM modem), where EBUSY will be
52 * returned if more than one client tries to connect to it.
53 */
54static __inline__ int
55qemu_pipe_open(const char* pipeName)
56{
57 char buff[256];
58 int buffLen;
59 int fd, ret;
60
61 if (pipeName == NULL || pipeName[0] == '\0') {
62 errno = EINVAL;
63 return -1;
64 }
65
66 snprintf(buff, sizeof buff, "pipe:%s", pipeName);
67
68 fd = open("/dev/qemu_pipe", O_RDWR);
69 if (fd < 0) {
70 D("%s: Could not open /dev/qemu_pipe: %s", __FUNCTION__, strerror(errno));
71 //errno = ENOSYS;
72 return -1;
73 }
74
75 buffLen = strlen(buff);
76
77 ret = TEMP_FAILURE_RETRY(write(fd, buff, buffLen+1));
78 if (ret != buffLen+1) {
79 D("%s: Could not connect to %s pipe service: %s", __FUNCTION__, pipeName, strerror(errno));
80 if (ret == 0) {
81 errno = ECONNRESET;
82 } else if (ret > 0) {
83 errno = EINVAL;
84 }
85 return -1;
86 }
87
88 return fd;
89}
90
91#endif /* ANDROID_INCLUDE_HARDWARE_QEMUD_PIPE_H */
920
=== removed file '3rd_party/android-deps/hardware/qemud.h'
--- 3rd_party/android-deps/hardware/qemud.h 2013-01-08 17:44:16 +0000
+++ 3rd_party/android-deps/hardware/qemud.h 1970-01-01 00:00:00 +0000
@@ -1,153 +0,0 @@
1/*
2 * Copyright (C) 2008 The Android Open Source Project
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17#ifndef ANDROID_INCLUDE_HARDWARE_QEMUD_H
18#define ANDROID_INCLUDE_HARDWARE_QEMUD_H
19
20#include <cutils/sockets.h>
21#include "qemu_pipe.h"
22
23/* the following is helper code that is used by the QEMU-specific
24 * hardware HAL modules to communicate with the emulator program
25 * through the 'qemud' multiplexing daemon, or through the qemud
26 * pipe.
27 *
28 * see the documentation comments for details in
29 * development/emulator/qemud/qemud.c
30 *
31 * all definitions here are built into the HAL module to avoid
32 * having to write a tiny shared library for this.
33 */
34
35/* we expect the D macro to be defined to a function macro
36 * that sends its formatted string argument(s) to the log.
37 * If not, ignore the traces.
38 */
39#ifndef D
40# define D(...) ((void)0)
41#endif
42
43static __inline__ int
44qemud_fd_write(int fd, const void* buff, int len)
45{
46 int len2;
47 do {
48 len2 = write(fd, buff, len);
49 } while (len2 < 0 && errno == EINTR);
50 return len2;
51}
52
53static __inline__ int
54qemud_fd_read(int fd, void* buff, int len)
55{
56 int len2;
57 do {
58 len2 = read(fd, buff, len);
59 } while (len2 < 0 && errno == EINTR);
60 return len2;
61}
62
63static __inline__ int
64qemud_channel_open(const char* name)
65{
66 int fd;
67 int namelen = strlen(name);
68 char answer[2];
69 char pipe_name[256];
70
71 /* First, try to connect to the pipe. */
72 snprintf(pipe_name, sizeof(pipe_name), "qemud:%s", name);
73 fd = qemu_pipe_open(pipe_name);
74 if (fd < 0) {
75 D("QEMUD pipe is not available for %s: %s", name, strerror(errno));
76 /* If pipe is not available, connect to qemud control socket */
77 fd = socket_local_client( "qemud",
78 ANDROID_SOCKET_NAMESPACE_RESERVED,
79 SOCK_STREAM );
80 if (fd < 0) {
81 D("no qemud control socket: %s", strerror(errno));
82 return -1;
83 }
84
85 /* send service name to connect */
86 if (qemud_fd_write(fd, name, namelen) != namelen) {
87 D("can't send service name to qemud: %s",
88 strerror(errno));
89 close(fd);
90 return -1;
91 }
92
93 /* read answer from daemon */
94 if (qemud_fd_read(fd, answer, 2) != 2 ||
95 answer[0] != 'O' || answer[1] != 'K') {
96 D("cant' connect to %s service through qemud", name);
97 close(fd);
98 return -1;
99 }
100 }
101 return fd;
102}
103
104static __inline__ int
105qemud_channel_send(int fd, const void* msg, int msglen)
106{
107 char header[5];
108
109 if (msglen < 0)
110 msglen = strlen((const char*)msg);
111
112 if (msglen == 0)
113 return 0;
114
115 snprintf(header, sizeof header, "%04x", msglen);
116 if (qemud_fd_write(fd, header, 4) != 4) {
117 D("can't write qemud frame header: %s", strerror(errno));
118 return -1;
119 }
120
121 if (qemud_fd_write(fd, msg, msglen) != msglen) {
122 D("can4t write qemud frame payload: %s", strerror(errno));
123 return -1;
124 }
125 return 0;
126}
127
128static __inline__ int
129qemud_channel_recv(int fd, void* msg, int msgsize)
130{
131 char header[5];
132 int size, avail;
133
134 if (qemud_fd_read(fd, header, 4) != 4) {
135 D("can't read qemud frame header: %s", strerror(errno));
136 return -1;
137 }
138 header[4] = 0;
139 if (sscanf(header, "%04x", &size) != 1) {
140 D("malformed qemud frame header: '%.*s'", 4, header);
141 return -1;
142 }
143 if (size > msgsize)
144 return -1;
145
146 if (qemud_fd_read(fd, msg, size) != size) {
147 D("can't read qemud frame payload: %s", strerror(errno));
148 return -1;
149 }
150 return size;
151}
152
153#endif /* ANDROID_INCLUDE_HARDWARE_QEMUD_H */
1540
=== removed file '3rd_party/android-deps/hardware/sensors.h'
--- 3rd_party/android-deps/hardware/sensors.h 2013-01-08 17:44:16 +0000
+++ 3rd_party/android-deps/hardware/sensors.h 1970-01-01 00:00:00 +0000
@@ -1,485 +0,0 @@
1/*
2 * Copyright (C) 2008 The Android Open Source Project
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17#ifndef ANDROID_SENSORS_INTERFACE_H
18#define ANDROID_SENSORS_INTERFACE_H
19
20#include <stdint.h>
21#include <sys/cdefs.h>
22#include <sys/types.h>
23
24#include <hardware/hardware.h>
25#include <cutils/native_handle.h>
26
27__BEGIN_DECLS
28
29/**
30 * The id of this module
31 */
32#define SENSORS_HARDWARE_MODULE_ID "sensors"
33
34/**
35 * Name of the sensors device to open
36 */
37#define SENSORS_HARDWARE_POLL "poll"
38
39/**
40 * Handles must be higher than SENSORS_HANDLE_BASE and must be unique.
41 * A Handle identifies a given sensors. The handle is used to activate
42 * and/or deactivate sensors.
43 * In this version of the API there can only be 256 handles.
44 */
45#define SENSORS_HANDLE_BASE 0
46#define SENSORS_HANDLE_BITS 8
47#define SENSORS_HANDLE_COUNT (1<<SENSORS_HANDLE_BITS)
48
49
50/**
51 * Sensor types
52 */
53#define SENSOR_TYPE_ACCELEROMETER 1
54#define SENSOR_TYPE_MAGNETIC_FIELD 2
55#define SENSOR_TYPE_ORIENTATION 3
56#define SENSOR_TYPE_GYROSCOPE 4
57#define SENSOR_TYPE_LIGHT 5
58#define SENSOR_TYPE_PRESSURE 6
59#define SENSOR_TYPE_TEMPERATURE 7 // deprecated
60#define SENSOR_TYPE_PROXIMITY 8
61#define SENSOR_TYPE_GRAVITY 9
62#define SENSOR_TYPE_LINEAR_ACCELERATION 10
63#define SENSOR_TYPE_ROTATION_VECTOR 11
64#define SENSOR_TYPE_RELATIVE_HUMIDITY 12
65#define SENSOR_TYPE_AMBIENT_TEMPERATURE 13
66
67/**
68 * Values returned by the accelerometer in various locations in the universe.
69 * all values are in SI units (m/s^2)
70 */
71
72#define GRAVITY_SUN (275.0f)
73#define GRAVITY_EARTH (9.80665f)
74
75/** Maximum magnetic field on Earth's surface */
76#define MAGNETIC_FIELD_EARTH_MAX (60.0f)
77
78/** Minimum magnetic field on Earth's surface */
79#define MAGNETIC_FIELD_EARTH_MIN (30.0f)
80
81
82/**
83 * status of each sensor
84 */
85
86#define SENSOR_STATUS_UNRELIABLE 0
87#define SENSOR_STATUS_ACCURACY_LOW 1
88#define SENSOR_STATUS_ACCURACY_MEDIUM 2
89#define SENSOR_STATUS_ACCURACY_HIGH 3
90
91/**
92 * Definition of the axis
93 * ----------------------
94 *
95 * This API is relative to the screen of the device in its default orientation,
96 * that is, if the device can be used in portrait or landscape, this API
97 * is only relative to the NATURAL orientation of the screen. In other words,
98 * the axis are not swapped when the device's screen orientation changes.
99 * Higher level services /may/ perform this transformation.
100 *
101 * x<0 x>0
102 * ^
103 * |
104 * +-----------+--> y>0
105 * | |
106 * | |
107 * | |
108 * | | / z<0
109 * | | /
110 * | | /
111 * O-----------+/
112 * |[] [ ] []/
113 * +----------/+ y<0
114 * /
115 * /
116 * |/ z>0 (toward the sky)
117 *
118 * O: Origin (x=0,y=0,z=0)
119 *
120 *
121 * SENSOR_TYPE_ORIENTATION
122 * -----------------------
123 *
124 * All values are angles in degrees.
125 *
126 * Orientation sensors return sensor events for all 3 axes at a constant
127 * rate defined by setDelay().
128 *
129 * azimuth: angle between the magnetic north direction and the Y axis, around
130 * the Z axis (0<=azimuth<360).
131 * 0=North, 90=East, 180=South, 270=West
132 *
133 * pitch: Rotation around X axis (-180<=pitch<=180), with positive values when
134 * the z-axis moves toward the y-axis.
135 *
136 * roll: Rotation around Y axis (-90<=roll<=90), with positive values when
137 * the x-axis moves towards the z-axis.
138 *
139 * Note: For historical reasons the roll angle is positive in the clockwise
140 * direction (mathematically speaking, it should be positive in the
141 * counter-clockwise direction):
142 *
143 * Z
144 * ^
145 * (+roll) .--> |
146 * / |
147 * | | roll: rotation around Y axis
148 * X <-------(.)
149 * Y
150 * note that +Y == -roll
151 *
152 *
153 *
154 * Note: This definition is different from yaw, pitch and roll used in aviation
155 * where the X axis is along the long side of the plane (tail to nose).
156 *
157 *
158 * SENSOR_TYPE_ACCELEROMETER
159 * -------------------------
160 *
161 * All values are in SI units (m/s^2) and measure the acceleration of the
162 * device minus the force of gravity.
163 *
164 * Acceleration sensors return sensor events for all 3 axes at a constant
165 * rate defined by setDelay().
166 *
167 * x: Acceleration minus Gx on the x-axis
168 * y: Acceleration minus Gy on the y-axis
169 * z: Acceleration minus Gz on the z-axis
170 *
171 * Examples:
172 * When the device lies flat on a table and is pushed on its left side
173 * toward the right, the x acceleration value is positive.
174 *
175 * When the device lies flat on a table, the acceleration value is +9.81,
176 * which correspond to the acceleration of the device (0 m/s^2) minus the
177 * force of gravity (-9.81 m/s^2).
178 *
179 * When the device lies flat on a table and is pushed toward the sky, the
180 * acceleration value is greater than +9.81, which correspond to the
181 * acceleration of the device (+A m/s^2) minus the force of
182 * gravity (-9.81 m/s^2).
183 *
184 *
185 * SENSOR_TYPE_MAGNETIC_FIELD
186 * --------------------------
187 *
188 * All values are in micro-Tesla (uT) and measure the ambient magnetic
189 * field in the X, Y and Z axis.
190 *
191 * Magnetic Field sensors return sensor events for all 3 axes at a constant
192 * rate defined by setDelay().
193 *
194 * SENSOR_TYPE_GYROSCOPE
195 * ---------------------
196 *
197 * All values are in radians/second and measure the rate of rotation
198 * around the X, Y and Z axis. The coordinate system is the same as is
199 * used for the acceleration sensor. Rotation is positive in the
200 * counter-clockwise direction (right-hand rule). That is, an observer
201 * looking from some positive location on the x, y or z axis at a device
202 * positioned on the origin would report positive rotation if the device
203 * appeared to be rotating counter clockwise. Note that this is the
204 * standard mathematical definition of positive rotation and does not agree
205 * with the definition of roll given earlier.
206 * The range should at least be 17.45 rad/s (ie: ~1000 deg/s).
207 *
208 * SENSOR_TYPE_PROXIMITY
209 * ----------------------
210 *
211 * The distance value is measured in centimeters. Note that some proximity
212 * sensors only support a binary "close" or "far" measurement. In this case,
213 * the sensor should report its maxRange value in the "far" state and a value
214 * less than maxRange in the "near" state.
215 *
216 * Proximity sensors report a value only when it changes and each time the
217 * sensor is enabled.
218 *
219 * SENSOR_TYPE_LIGHT
220 * -----------------
221 *
222 * The light sensor value is returned in SI lux units.
223 *
224 * Light sensors report a value only when it changes and each time the
225 * sensor is enabled.
226 *
227 * SENSOR_TYPE_PRESSURE
228 * --------------------
229 *
230 * The pressure sensor return the athmospheric pressure in hectopascal (hPa)
231 *
232 * Pressure sensors report events at a constant rate defined by setDelay().
233 *
234 * SENSOR_TYPE_GRAVITY
235 * -------------------
236 *
237 * A gravity output indicates the direction of and magnitude of gravity in
238 * the devices's coordinates. On Earth, the magnitude is 9.8 m/s^2.
239 * Units are m/s^2. The coordinate system is the same as is used for the
240 * acceleration sensor. When the device is at rest, the output of the
241 * gravity sensor should be identical to that of the accelerometer.
242 *
243 * SENSOR_TYPE_LINEAR_ACCELERATION
244 * --------------------------------
245 *
246 * Indicates the linear acceleration of the device in device coordinates,
247 * not including gravity.
248 * This output is essentially Acceleration - Gravity. Units are m/s^2.
249 * The coordinate system is the same as is used for the acceleration sensor.
250 *
251 *
252 * SENSOR_TYPE_ROTATION_VECTOR
253 * ---------------------------
254 *
255 * A rotation vector represents the orientation of the device as a combination
256 * of an angle and an axis, in which the device has rotated through an angle
257 * theta around an axis <x, y, z>. The three elements of the rotation vector
258 * are <x*sin(theta/2), y*sin(theta/2), z*sin(theta/2)>, such that the magnitude
259 * of the rotation vector is equal to sin(theta/2), and the direction of the
260 * rotation vector is equal to the direction of the axis of rotation. The three
261 * elements of the rotation vector are equal to the last three components of a
262 * unit quaternion <cos(theta/2), x*sin(theta/2), y*sin(theta/2), z*sin(theta/2)>.
263 * Elements of the rotation vector are unitless. The x, y, and z axis are defined
264 * in the same was as for the acceleration sensor.
265 *
266 * The reference coordinate system is defined as a direct orthonormal basis,
267 * where:
268 *
269 * - X is defined as the vector product Y.Z (It is tangential to
270 * the ground at the device's current location and roughly points East).
271 *
272 * - Y is tangential to the ground at the device's current location and
273 * points towards the magnetic North Pole.
274 *
275 * - Z points towards the sky and is perpendicular to the ground.
276 *
277 *
278 * The rotation-vector is stored as:
279 *
280 * sensors_event_t.data[0] = x*sin(theta/2)
281 * sensors_event_t.data[1] = y*sin(theta/2)
282 * sensors_event_t.data[2] = z*sin(theta/2)
283 * sensors_event_t.data[3] = cos(theta/2)
284 *
285 *
286 * SENSOR_TYPE_RELATIVE_HUMIDITY
287 * ------------------------------
288 *
289 * A relative humidity sensor measures relative ambient air humidity and
290 * returns a value in percent.
291 *
292 * Relative humidity sensors report a value only when it changes and each
293 * time the sensor is enabled.
294 *
295 *
296 * SENSOR_TYPE_AMBIENT_TEMPERATURE
297 * -------------------------------
298 *
299 * The ambient (room) temperature in degree Celsius.
300 *
301 * Temperature sensors report a value only when it changes and each time the
302 * sensor is enabled.
303 *
304 */
305
306typedef struct {
307 union {
308 float v[3];
309 struct {
310 float x;
311 float y;
312 float z;
313 };
314 struct {
315 float azimuth;
316 float pitch;
317 float roll;
318 };
319 };
320 int8_t status;
321 uint8_t reserved[3];
322} sensors_vec_t;
323
324/**
325 * Union of the various types of sensor data
326 * that can be returned.
327 */
328typedef struct sensors_event_t {
329 /* must be sizeof(struct sensors_event_t) */
330 int32_t version;
331
332 /* sensor identifier */
333 int32_t sensor;
334
335 /* sensor type */
336 int32_t type;
337
338 /* reserved */
339 int32_t reserved0;
340
341 /* time is in nanosecond */
342 int64_t timestamp;
343
344 union {
345 float data[16];
346
347 /* acceleration values are in meter per second per second (m/s^2) */
348 sensors_vec_t acceleration;
349
350 /* magnetic vector values are in micro-Tesla (uT) */
351 sensors_vec_t magnetic;
352
353 /* orientation values are in degrees */
354 sensors_vec_t orientation;
355
356 /* gyroscope values are in rad/s */
357 sensors_vec_t gyro;
358
359 /* temperature is in degrees centigrade (Celsius) */
360 float temperature;
361
362 /* distance in centimeters */
363 float distance;
364
365 /* light in SI lux units */
366 float light;
367
368 /* pressure in hectopascal (hPa) */
369 float pressure;
370
371 /* relative humidity in percent */
372 float relative_humidity;
373 };
374 uint32_t reserved1[4];
375} sensors_event_t;
376
377
378
379struct sensor_t;
380
381/**
382 * Every hardware module must have a data structure named HAL_MODULE_INFO_SYM
383 * and the fields of this data structure must begin with hw_module_t
384 * followed by module specific information.
385 */
386struct sensors_module_t {
387 struct hw_module_t common;
388
389 /**
390 * Enumerate all available sensors. The list is returned in "list".
391 * @return number of sensors in the list
392 */
393 int (*get_sensors_list)(struct sensors_module_t* module,
394 struct sensor_t const** list);
395};
396
397struct sensor_t {
398 /* name of this sensors */
399 const char* name;
400 /* vendor of the hardware part */
401 const char* vendor;
402 /* version of the hardware part + driver. The value of this field
403 * must increase when the driver is updated in a way that changes the
404 * output of this sensor. This is important for fused sensors when the
405 * fusion algorithm is updated.
406 */
407 int version;
408 /* handle that identifies this sensors. This handle is used to activate
409 * and deactivate this sensor. The value of the handle must be 8 bits
410 * in this version of the API.
411 */
412 int handle;
413 /* this sensor's type. */
414 int type;
415 /* maximaum range of this sensor's value in SI units */
416 float maxRange;
417 /* smallest difference between two values reported by this sensor */
418 float resolution;
419 /* rough estimate of this sensor's power consumption in mA */
420 float power;
421 /* minimum delay allowed between events in microseconds. A value of zero
422 * means that this sensor doesn't report events at a constant rate, but
423 * rather only when a new data is available */
424 int32_t minDelay;
425 /* reserved fields, must be zero */
426 void* reserved[8];
427};
428
429
430/**
431 * Every device data structure must begin with hw_device_t
432 * followed by module specific public methods and attributes.
433 */
434struct sensors_poll_device_t {
435 struct hw_device_t common;
436
437 /** Activate/deactivate one sensor.
438 *
439 * @param handle is the handle of the sensor to change.
440 * @param enabled set to 1 to enable, or 0 to disable the sensor.
441 *
442 * @return 0 on success, negative errno code otherwise
443 */
444 int (*activate)(struct sensors_poll_device_t *dev,
445 int handle, int enabled);
446
447 /**
448 * Set the delay between sensor events in nanoseconds for a given sensor.
449 *
450 * If the requested value is less than sensor_t::minDelay, then it's
451 * silently clamped to sensor_t::minDelay unless sensor_t::minDelay is
452 * 0, in which case it is clamped to >= 1ms.
453 *
454 * @return 0 if successful, < 0 on error
455 */
456 int (*setDelay)(struct sensors_poll_device_t *dev,
457 int handle, int64_t ns);
458
459 /**
460 * Returns an array of sensor data.
461 * This function must block until events are available.
462 *
463 * @return the number of events read on success, or -errno in case of an error.
464 * This function should never return 0 (no event).
465 *
466 */
467 int (*poll)(struct sensors_poll_device_t *dev,
468 sensors_event_t* data, int count);
469};
470
471/** convenience API for opening and closing a device */
472
473static inline int sensors_open(const struct hw_module_t* module,
474 struct sensors_poll_device_t** device) {
475 return module->methods->open(module,
476 SENSORS_HARDWARE_POLL, (struct hw_device_t**)device);
477}
478
479static inline int sensors_close(struct sensors_poll_device_t* device) {
480 return device->common.close(&device->common);
481}
482
483__END_DECLS
484
485#endif // ANDROID_SENSORS_INTERFACE_H
4860
=== added directory '3rd_party/android-deps/sync'
=== added file '3rd_party/android-deps/sync/sync.h'
--- 3rd_party/android-deps/sync/sync.h 1970-01-01 00:00:00 +0000
+++ 3rd_party/android-deps/sync/sync.h 2013-03-06 00:16:21 +0000
@@ -0,0 +1,62 @@
1/*
2 * sync.h
3 *
4 * Copyright 2012 Google, Inc
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19#ifndef __SYS_CORE_SYNC_H
20#define __SYS_CORE_SYNC_H
21
22#include <sys/cdefs.h>
23#include <stdint.h>
24
25__BEGIN_DECLS
26
27// XXX: These structs are copied from the header "linux/sync.h".
28struct sync_fence_info_data {
29 uint32_t len;
30 char name[32];
31 int32_t status;
32 uint8_t pt_info[0];
33};
34
35struct sync_pt_info {
36 uint32_t len;
37 char obj_name[32];
38 char driver_name[32];
39 int32_t status;
40 uint64_t timestamp_ns;
41 uint8_t driver_data[0];
42};
43
44/* timeout in msecs */
45int sync_wait(int fd, int timeout);
46int sync_merge(const char *name, int fd1, int fd2);
47struct sync_fence_info_data *sync_fence_info(int fd);
48struct sync_pt_info *sync_pt_info(struct sync_fence_info_data *info,
49 struct sync_pt_info *itr);
50void sync_fence_info_free(struct sync_fence_info_data *info);
51
52/* sw_sync is mainly inteded for testing and should not be complied into
53 * production kernels
54 */
55
56int sw_sync_timeline_create(void);
57int sw_sync_timeline_inc(int fd, unsigned count);
58int sw_sync_fence_create(int fd, const char *name, unsigned value);
59
60__END_DECLS
61
62#endif /* __SYS_CORE_SYNC_H */
063
=== modified file '3rd_party/android-deps/system/graphics.h'
--- 3rd_party/android-deps/system/graphics.h 2013-03-05 09:47:57 +0000
+++ 3rd_party/android-deps/system/graphics.h 2013-03-06 00:16:21 +0000
@@ -109,10 +109,41 @@
109 */109 */
110 HAL_PIXEL_FORMAT_RAW_SENSOR = 0x20,110 HAL_PIXEL_FORMAT_RAW_SENSOR = 0x20,
111111
112 /*
113 * Android binary blob graphics buffer format:
114 *
115 * This format is used to carry task-specific data which does not have a
116 * standard image structure. The details of the format are left to the two
117 * endpoints.
118 *
119 * A typical use case is for transporting JPEG-compressed images from the
120 * Camera HAL to the framework or to applications.
121 *
122 * Buffers of this format must have a height of 1, and width equal to their
123 * size in bytes.
124 */
125 HAL_PIXEL_FORMAT_BLOB = 0x21,
126
127 /*
128 * Android format indicating that the choice of format is entirely up to the
129 * device-specific Gralloc implementation.
130 *
131 * The Gralloc implementation should examine the usage bits passed in when
132 * allocating a buffer with this format, and it should derive the pixel
133 * format from those usage flags. This format will never be used with any
134 * of the GRALLOC_USAGE_SW_* usage flags.
135 *
136 * If a buffer of this format is to be used as an OpenGL ES texture, the
137 * framework will assume that sampling the texture will always return an
138 * alpha value of 1.0 (i.e. the buffer contains only opaque pixel values).
139 *
140 */
141 HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED = 0x22,
142
112 /* Legacy formats (deprecated), used by ImageFormat.java */143 /* Legacy formats (deprecated), used by ImageFormat.java */
113 HAL_PIXEL_FORMAT_YCbCr_422_SP = 0x10, // NV16144 HAL_PIXEL_FORMAT_YCbCr_422_SP = 0x10, // NV16
114 HAL_PIXEL_FORMAT_YCrCb_420_SP = 0x11, // NV21145 HAL_PIXEL_FORMAT_YCrCb_420_SP = 0x11, // NV21
115 HAL_PIXEL_FORMAT_YCbCr_422_I = 0x14 // YUY2146 HAL_PIXEL_FORMAT_YCbCr_422_I = 0x14, // YUY2
116};147};
117148
118149
@@ -134,7 +165,7 @@
134 /* rotate source image 180 degrees */165 /* rotate source image 180 degrees */
135 HAL_TRANSFORM_ROT_180 = 0x03,166 HAL_TRANSFORM_ROT_180 = 0x03,
136 /* rotate source image 270 degrees clockwise */167 /* rotate source image 270 degrees clockwise */
137 HAL_TRANSFORM_ROT_270 = 0x07168 HAL_TRANSFORM_ROT_270 = 0x07,
138};169};
139170
140#ifdef __cplusplus171#ifdef __cplusplus
141172
=== modified file '3rd_party/android-deps/system/window.h'
--- 3rd_party/android-deps/system/window.h 2013-01-08 17:44:16 +0000
+++ 3rd_party/android-deps/system/window.h 2013-03-06 00:16:21 +0000
@@ -17,10 +17,15 @@
17#ifndef SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H17#ifndef SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H
18#define SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H18#define SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H
1919
20#include <cutils/native_handle.h>
21#include <errno.h>
22#include <limits.h>
20#include <stdint.h>23#include <stdint.h>
24#include <string.h>
25#include <sync/sync.h>
21#include <sys/cdefs.h>26#include <sys/cdefs.h>
22#include <system/graphics.h>27#include <system/graphics.h>
23#include <cutils/native_handle.h>28#include <unistd.h>
2429
25#ifdef __cplusplus30#ifdef __cplusplus
26#include <string.h>31#include <string.h>
@@ -41,6 +46,14 @@
4146
42// ---------------------------------------------------------------------------47// ---------------------------------------------------------------------------
4348
49// This #define may be used to conditionally compile device-specific code to
50// support either the prior ANativeWindow interface, which did not pass libsync
51// fences around, or the new interface that does. This #define is only present
52// when the ANativeWindow interface does include libsync support.
53#define ANDROID_NATIVE_WINDOW_HAS_SYNC 1
54
55// ---------------------------------------------------------------------------
56
44typedef const native_handle_t* buffer_handle_t;57typedef const native_handle_t* buffer_handle_t;
4558
46// ---------------------------------------------------------------------------59// ---------------------------------------------------------------------------
@@ -160,9 +173,10 @@
160173
161174
162 /*175 /*
163 * Default width and height of the ANativeWindow, these are the dimensions176 * Default width and height of ANativeWindow buffers, these are the
164 * of the window irrespective of the NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS177 * dimensions of the window buffers irrespective of the
165 * call.178 * NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS call and match the native window
179 * size unless overridden by NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS.
166 */180 */
167 NATIVE_WINDOW_DEFAULT_WIDTH = 6,181 NATIVE_WINDOW_DEFAULT_WIDTH = 6,
168 NATIVE_WINDOW_DEFAULT_HEIGHT = 7,182 NATIVE_WINDOW_DEFAULT_HEIGHT = 7,
@@ -215,25 +229,46 @@
215 *229 *
216 */230 */
217 NATIVE_WINDOW_TRANSFORM_HINT = 8,231 NATIVE_WINDOW_TRANSFORM_HINT = 8,
232
233 /*
234 * Boolean that indicates whether the consumer is running more than
235 * one buffer behind the producer.
236 */
237 NATIVE_WINDOW_CONSUMER_RUNNING_BEHIND = 9
218};238};
219239
220/* valid operations for the (*perform)() hook */240/* Valid operations for the (*perform)() hook.
241 *
242 * Values marked as 'deprecated' are supported, but have been superceded by
243 * other functionality.
244 *
245 * Values marked as 'private' should be considered private to the framework.
246 * HAL implementation code with access to an ANativeWindow should not use these,
247 * as it may not interact properly with the framework's use of the
248 * ANativeWindow.
249 */
221enum {250enum {
222 NATIVE_WINDOW_SET_USAGE = 0,251 NATIVE_WINDOW_SET_USAGE = 0,
223 NATIVE_WINDOW_CONNECT = 1, /* deprecated */252 NATIVE_WINDOW_CONNECT = 1, /* deprecated */
224 NATIVE_WINDOW_DISCONNECT = 2, /* deprecated */253 NATIVE_WINDOW_DISCONNECT = 2, /* deprecated */
225 NATIVE_WINDOW_SET_CROP = 3,254 NATIVE_WINDOW_SET_CROP = 3, /* private */
226 NATIVE_WINDOW_SET_BUFFER_COUNT = 4,255 NATIVE_WINDOW_SET_BUFFER_COUNT = 4,
227 NATIVE_WINDOW_SET_BUFFERS_GEOMETRY = 5, /* deprecated */256 NATIVE_WINDOW_SET_BUFFERS_GEOMETRY = 5, /* deprecated */
228 NATIVE_WINDOW_SET_BUFFERS_TRANSFORM = 6,257 NATIVE_WINDOW_SET_BUFFERS_TRANSFORM = 6,
229 NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP = 7,258 NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP = 7,
230 NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS = 8,259 NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS = 8,
231 NATIVE_WINDOW_SET_BUFFERS_FORMAT = 9,260 NATIVE_WINDOW_SET_BUFFERS_FORMAT = 9,
232 NATIVE_WINDOW_SET_SCALING_MODE = 10,261 NATIVE_WINDOW_SET_SCALING_MODE = 10, /* private */
233 NATIVE_WINDOW_LOCK = 11, /* private */262 NATIVE_WINDOW_LOCK = 11, /* private */
234 NATIVE_WINDOW_UNLOCK_AND_POST = 12, /* private */263 NATIVE_WINDOW_UNLOCK_AND_POST = 12, /* private */
235 NATIVE_WINDOW_API_CONNECT = 13, /* private */264 NATIVE_WINDOW_API_CONNECT = 13, /* private */
236 NATIVE_WINDOW_API_DISCONNECT = 14, /* private */265 NATIVE_WINDOW_API_DISCONNECT = 14, /* private */
266 NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS = 15, /* private */
267 NATIVE_WINDOW_SET_POST_TRANSFORM_CROP = 16, /* private */
268 NATIVE_WINDOW_SET_BUFFERS_SIZE = 17, /* private */
269#ifdef QCOM_HARDWARE
270 NATIVE_WINDOW_UPDATE_BUFFERS_GEOMETRY = 18, /* private */
271#endif
237};272};
238273
239/* parameter for NATIVE_WINDOW_[API_][DIS]CONNECT */274/* parameter for NATIVE_WINDOW_[API_][DIS]CONNECT */
@@ -279,6 +314,15 @@
279 NATIVE_WINDOW_SCALING_MODE_FREEZE = 0,314 NATIVE_WINDOW_SCALING_MODE_FREEZE = 0,
280 /* the buffer is scaled in both dimensions to match the window size */315 /* the buffer is scaled in both dimensions to match the window size */
281 NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW = 1,316 NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW = 1,
317 /* the buffer is scaled uniformly such that the smaller dimension
318 * of the buffer matches the window size (cropping in the process)
319 */
320 NATIVE_WINDOW_SCALING_MODE_SCALE_CROP = 2,
321 /* the window is clipped to the size of the buffer's crop rectangle; pixels
322 * outside the crop rectangle are treated as if they are completely
323 * transparent.
324 */
325 NATIVE_WINDOW_SCALING_MODE_NO_SCALE_CROP = 3,
282};326};
283327
284/* values returned by the NATIVE_WINDOW_CONCRETE_TYPE query */328/* values returned by the NATIVE_WINDOW_CONCRETE_TYPE query */
@@ -355,8 +399,12 @@
355 * allowed if a specific buffer count has been set.399 * allowed if a specific buffer count has been set.
356 *400 *
357 * Returns 0 on success or -errno on error.401 * Returns 0 on success or -errno on error.
402 *
403 * XXX: This function is deprecated. It will continue to work for some
404 * time for binary compatibility, but the new dequeueBuffer function that
405 * outputs a fence file descriptor should be used in its place.
358 */406 */
359 int (*dequeueBuffer)(struct ANativeWindow* window,407 int (*dequeueBuffer_DEPRECATED)(struct ANativeWindow* window,
360 struct ANativeWindowBuffer** buffer);408 struct ANativeWindowBuffer** buffer);
361409
362 /*410 /*
@@ -365,9 +413,14 @@
365 * dequeueBuffer first.413 * dequeueBuffer first.
366 *414 *
367 * Returns 0 on success or -errno on error.415 * Returns 0 on success or -errno on error.
416 *
417 * XXX: This function is deprecated. It will continue to work for some
418 * time for binary compatibility, but it is essentially a no-op, and calls
419 * to it should be removed.
368 */420 */
369 int (*lockBuffer)(struct ANativeWindow* window,421 int (*lockBuffer_DEPRECATED)(struct ANativeWindow* window,
370 struct ANativeWindowBuffer* buffer);422 struct ANativeWindowBuffer* buffer);
423
371 /*424 /*
372 * Hook called by EGL when modifications to the render buffer are done.425 * Hook called by EGL when modifications to the render buffer are done.
373 * This unlocks and post the buffer.426 * This unlocks and post the buffer.
@@ -381,8 +434,13 @@
381 * Buffers MUST be queued in the same order than they were dequeued.434 * Buffers MUST be queued in the same order than they were dequeued.
382 *435 *
383 * Returns 0 on success or -errno on error.436 * Returns 0 on success or -errno on error.
437 *
438 * XXX: This function is deprecated. It will continue to work for some
439 * time for binary compatibility, but the new queueBuffer function that
440 * takes a fence file descriptor should be used in its place (pass a value
441 * of -1 for the fence file descriptor if there is no valid one to pass).
384 */442 */
385 int (*queueBuffer)(struct ANativeWindow* window,443 int (*queueBuffer_DEPRECATED)(struct ANativeWindow* window,
386 struct ANativeWindowBuffer* buffer);444 struct ANativeWindowBuffer* buffer);
387445
388 /*446 /*
@@ -408,18 +466,20 @@
408 * NATIVE_WINDOW_SET_USAGE466 * NATIVE_WINDOW_SET_USAGE
409 * NATIVE_WINDOW_CONNECT (deprecated)467 * NATIVE_WINDOW_CONNECT (deprecated)
410 * NATIVE_WINDOW_DISCONNECT (deprecated)468 * NATIVE_WINDOW_DISCONNECT (deprecated)
411 * NATIVE_WINDOW_SET_CROP469 * NATIVE_WINDOW_SET_CROP (private)
412 * NATIVE_WINDOW_SET_BUFFER_COUNT470 * NATIVE_WINDOW_SET_BUFFER_COUNT
413 * NATIVE_WINDOW_SET_BUFFERS_GEOMETRY (deprecated)471 * NATIVE_WINDOW_SET_BUFFERS_GEOMETRY (deprecated)
414 * NATIVE_WINDOW_SET_BUFFERS_TRANSFORM472 * NATIVE_WINDOW_SET_BUFFERS_TRANSFORM
415 * NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP473 * NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP
416 * NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS474 * NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS
417 * NATIVE_WINDOW_SET_BUFFERS_FORMAT475 * NATIVE_WINDOW_SET_BUFFERS_FORMAT
418 * NATIVE_WINDOW_SET_SCALING_MODE476 * NATIVE_WINDOW_SET_SCALING_MODE (private)
419 * NATIVE_WINDOW_LOCK (private)477 * NATIVE_WINDOW_LOCK (private)
420 * NATIVE_WINDOW_UNLOCK_AND_POST (private)478 * NATIVE_WINDOW_UNLOCK_AND_POST (private)
421 * NATIVE_WINDOW_API_CONNECT (private)479 * NATIVE_WINDOW_API_CONNECT (private)
422 * NATIVE_WINDOW_API_DISCONNECT (private)480 * NATIVE_WINDOW_API_DISCONNECT (private)
481 * NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS (private)
482 * NATIVE_WINDOW_SET_POST_TRANSFORM_CROP (private)
423 *483 *
424 */484 */
425485
@@ -437,12 +497,86 @@
437 * reference if they might use the buffer after queueing or canceling it.497 * reference if they might use the buffer after queueing or canceling it.
438 * Holding a reference to a buffer after queueing or canceling it is only498 * Holding a reference to a buffer after queueing or canceling it is only
439 * allowed if a specific buffer count has been set.499 * allowed if a specific buffer count has been set.
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches