1 #ifndef HIDL_GENERATED_ANDROID_HARDWARE_CAMERA_DEVICE_V3_7_ICAMERAINJECTIONSESSION_H
2 #define HIDL_GENERATED_ANDROID_HARDWARE_CAMERA_DEVICE_V3_7_ICAMERAINJECTIONSESSION_H
3
4 #include <android/hardware/camera/common/1.0/types.h>
5 #include <android/hardware/camera/device/3.2/types.h>
6 #include <android/hardware/camera/device/3.7/ICameraDeviceSession.h>
7 #include <android/hardware/camera/device/3.7/types.h>
8
9 #include <android/hidl/manager/1.0/IServiceNotification.h>
10
11 #include <hidl/HidlSupport.h>
12 #include <hidl/MQDescriptor.h>
13 #include <hidl/Status.h>
14 #include <utils/NativeHandle.h>
15 #include <utils/misc.h>
16
17 namespace android {
18 namespace hardware {
19 namespace camera {
20 namespace device {
21 namespace V3_7 {
22
23 /**
24 * Injection camera device active session interface.
25 *
26 * Note that this is implemented on a special camera injection hal, if it is a
27 * general camera hal, it is not necessary to implement this interface.
28 *
29 * When an external camera is injected to replace the internal camera session, the
30 * injection session will be established in camera framework, and then
31 * configureInjectionStreams() will be called to ask the external camera to
32 * configure itself to match the stream configuration of the internal camera.
33 *
34 * Camera framework is responsible to close the injection session once the client
35 * switch back to internal camera streaming.
36 *
37 * If the external camera cannot support the configuration ILLEGAL_ARGUMENT will
38 * be returned.
39 */
40 struct ICameraInjectionSession : public ::android::hardware::camera::device::V3_7::ICameraDeviceSession {
41 /**
42 * Type tag for use in template logic that indicates this is a 'pure' class.
43 */
44 typedef ::android::hardware::details::i_tag _hidl_tag;
45
46 /**
47 * Fully qualified interface name: "[email protected]::ICameraInjectionSession"
48 */
49 static const char* descriptor;
50
51 /**
52 * Returns whether this object's implementation is outside of the current process.
53 */
isRemoteICameraInjectionSession54 virtual bool isRemote() const override { return false; }
55
56 /**
57 * Return callback for constructDefaultRequestSettings
58 */
59 using constructDefaultRequestSettings_cb = std::function<void(::android::hardware::camera::common::V1_0::Status status, const ::android::hardware::hidl_vec<uint8_t>& requestTemplate)>;
60 /**
61 * constructDefaultRequestSettings:
62 *
63 * Create capture settings for standard camera use cases.
64 *
65 * The device must return a settings buffer that is configured to meet the
66 * requested use case, which must be one of the CAMERA3_TEMPLATE_*
67 * enums. All request control fields must be included.
68 *
69 * Performance requirements:
70 *
71 * This must be a non-blocking call. The HAL should return from this call
72 * in 1ms, and must return from this call in 5ms.
73 *
74 * Return values:
75 * @return status Status code for the operation, one of:
76 * OK:
77 * On a successful construction of default settings.
78 * INTERNAL_ERROR:
79 * An unexpected internal error occurred, and the default settings
80 * are not available.
81 * ILLEGAL_ARGUMENT:
82 * The camera HAL does not support the input template type
83 * CAMERA_DISCONNECTED:
84 * An external camera device has been disconnected, and is no longer
85 * available. This camera device interface is now stale, and a new
86 * instance must be acquired if the device is reconnected. All
87 * subsequent calls on this interface must return
88 * CAMERA_DISCONNECTED.
89 * @return template The default capture request settings for the requested
90 * use case, or an empty metadata structure if status is not OK.
91 *
92 */
93 virtual ::android::hardware::Return<void> constructDefaultRequestSettings(::android::hardware::camera::device::V3_2::RequestTemplate type, constructDefaultRequestSettings_cb _hidl_cb) override = 0;
94
95 /**
96 * Return callback for configureStreams
97 */
98 using configureStreams_cb = std::function<void(::android::hardware::camera::common::V1_0::Status status, const ::android::hardware::camera::device::V3_2::HalStreamConfiguration& halConfiguration)>;
99 /**
100 * configureStreams:
101 *
102 * Reset the HAL camera device processing pipeline and set up new input and
103 * output streams. This call replaces any existing stream configuration with
104 * the streams defined in the streamList. This method must be called at
105 * least once before a request is submitted with processCaptureRequest().
106 *
107 * The streamList must contain at least one output-capable stream, and may
108 * not contain more than one input-capable stream.
109 *
110 * The streamList may contain streams that are also in the currently-active
111 * set of streams (from the previous call to configureStreams()). These
112 * streams must already have valid values for usage, maxBuffers, and the
113 * private pointer.
114 *
115 * If the HAL needs to change the stream configuration for an existing
116 * stream due to the new configuration, it may rewrite the values of usage
117 * and/or maxBuffers during the configure call.
118 *
119 * The framework must detect such a change, and may then reallocate the
120 * stream buffers before using buffers from that stream in a request.
121 *
122 * If a currently-active stream is not included in streamList, the HAL may
123 * safely remove any references to that stream. It must not be reused in a
124 * later configureStreams() call by the framework, and all the gralloc
125 * buffers for it must be freed after the configureStreams() call returns.
126 *
127 * If the stream is new, the client must set the consumer usage flags in
128 * requestedConfiguration. Upon return, the HAL device must set producerUsage,
129 * maxBuffers, and other fields in the configureStreams() return values. These
130 * fields are then used by the framework and the platform gralloc module to
131 * allocate the gralloc buffers for each stream.
132 *
133 * Newly allocated buffers may be included in a capture request at any time
134 * by the framework. Once a gralloc buffer is returned to the framework
135 * with processCaptureResult (and its respective releaseFence has been
136 * signaled) the framework may free or reuse it at any time.
137 *
138 * ------------------------------------------------------------------------
139 *
140 * Preconditions:
141 *
142 * The framework must only call this method when no captures are being
143 * processed. That is, all results have been returned to the framework, and
144 * all in-flight input and output buffers have been returned and their
145 * release sync fences have been signaled by the HAL. The framework must not
146 * submit new requests for capture while the configureStreams() call is
147 * underway.
148 *
149 * Postconditions:
150 *
151 * The HAL device must configure itself to provide maximum possible output
152 * frame rate given the sizes and formats of the output streams, as
153 * documented in the camera device's static metadata.
154 *
155 * Performance requirements:
156 *
157 * This call is expected to be heavyweight and possibly take several hundred
158 * milliseconds to complete, since it may require resetting and
159 * reconfiguring the image sensor and the camera processing pipeline.
160 * Nevertheless, the HAL device should attempt to minimize the
161 * reconfiguration delay to minimize the user-visible pauses during
162 * application operational mode changes (such as switching from still
163 * capture to video recording).
164 *
165 * The HAL should return from this call in 500ms, and must return from this
166 * call in 1000ms.
167 *
168 * @return Status Status code for the operation, one of:
169 * OK:
170 * On successful stream configuration.
171 * INTERNAL_ERROR:
172 * If there has been a fatal error and the device is no longer
173 * operational. Only close() can be called successfully by the
174 * framework after this error is returned.
175 * ILLEGAL_ARGUMENT:
176 * If the requested stream configuration is invalid. Some examples
177 * of invalid stream configurations include:
178 * - Including more than 1 INPUT stream
179 * - Not including any OUTPUT streams
180 * - Including streams with unsupported formats, or an unsupported
181 * size for that format.
182 * - Including too many output streams of a certain format.
183 * - Unsupported rotation configuration
184 * - Stream sizes/formats don't satisfy the
185 * StreamConfigurationMode requirements for non-NORMAL mode, or
186 * the requested operation_mode is not supported by the HAL.
187 * - Unsupported usage flag
188 * The camera service cannot filter out all possible illegal stream
189 * configurations, since some devices may support more simultaneous
190 * streams or larger stream resolutions than the minimum required
191 * for a given camera device hardware level. The HAL must return an
192 * ILLEGAL_ARGUMENT for any unsupported stream set, and then be
193 * ready to accept a future valid stream configuration in a later
194 * configureStreams call.
195 * @return finalConfiguration The stream parameters desired by the HAL for
196 * each stream, including maximum buffers, the usage flags, and the
197 * override format.
198 *
199 */
200 virtual ::android::hardware::Return<void> configureStreams(const ::android::hardware::camera::device::V3_2::StreamConfiguration& requestedConfiguration, configureStreams_cb _hidl_cb) override = 0;
201
202 /**
203 * Return callback for processCaptureRequest
204 */
205 using processCaptureRequest_cb = std::function<void(::android::hardware::camera::common::V1_0::Status status, uint32_t numRequestProcessed)>;
206 /**
207 * processCaptureRequest:
208 *
209 * Send a list of capture requests to the HAL. The HAL must not return from
210 * this call until it is ready to accept the next set of requests to
211 * process. Only one call to processCaptureRequest() must be made at a time
212 * by the framework, and the calls must all be from the same thread. The
213 * next call to processCaptureRequest() must be made as soon as a new
214 * request and its associated buffers are available. In a normal preview
215 * scenario, this means the function is generally called again by the
216 * framework almost instantly. If more than one request is provided by the
217 * client, the HAL must process the requests in order of lowest index to
218 * highest index.
219 *
220 * The cachesToRemove argument contains a list of buffer caches (see
221 * StreamBuffer document for more information on buffer cache) to be removed
222 * by camera HAL. Camera HAL must remove these cache entries whether or not
223 * this method returns OK.
224 *
225 * The actual request processing is asynchronous, with the results of
226 * capture being returned by the HAL through the processCaptureResult()
227 * call. This call requires the result metadata to be available, but output
228 * buffers may simply provide sync fences to wait on. Multiple requests are
229 * expected to be in flight at once, to maintain full output frame rate.
230 *
231 * The framework retains ownership of the request structure. It is only
232 * guaranteed to be valid during this call. The HAL device must make copies
233 * of the information it needs to retain for the capture processing. The HAL
234 * is responsible for waiting on and closing the buffers' fences and
235 * returning the buffer handles to the framework.
236 *
237 * The HAL must write the file descriptor for the input buffer's release
238 * sync fence into input_buffer->release_fence, if input_buffer is not
239 * valid. If the HAL returns -1 for the input buffer release sync fence, the
240 * framework is free to immediately reuse the input buffer. Otherwise, the
241 * framework must wait on the sync fence before refilling and reusing the
242 * input buffer.
243 *
244 * The input/output buffers provided by the framework in each request
245 * may be brand new (having never before seen by the HAL).
246 *
247 * ------------------------------------------------------------------------
248 * Performance considerations:
249 *
250 * Handling a new buffer should be extremely lightweight and there must be
251 * no frame rate degradation or frame jitter introduced.
252 *
253 * This call must return fast enough to ensure that the requested frame
254 * rate can be sustained, especially for streaming cases (post-processing
255 * quality settings set to FAST). The HAL should return this call in 1
256 * frame interval, and must return from this call in 4 frame intervals.
257 *
258 * @return status Status code for the operation, one of:
259 * OK:
260 * On a successful start to processing the capture request
261 * ILLEGAL_ARGUMENT:
262 * If the input is malformed (the settings are empty when not
263 * allowed, there are 0 output buffers, etc) and capture processing
264 * cannot start. Failures during request processing must be
265 * handled by calling ICameraDeviceCallback::notify(). In case of
266 * this error, the framework retains responsibility for the
267 * stream buffers' fences and the buffer handles; the HAL must not
268 * close the fences or return these buffers with
269 * ICameraDeviceCallback::processCaptureResult().
270 * INTERNAL_ERROR:
271 * If the camera device has encountered a serious error. After this
272 * error is returned, only the close() method can be successfully
273 * called by the framework.
274 * @return numRequestProcessed Number of requests successfully processed by
275 * camera HAL. When status is OK, this must be equal to the size of
276 * requests. When the call fails, this number is the number of requests
277 * that HAL processed successfully before HAL runs into an error.
278 *
279 */
280 virtual ::android::hardware::Return<void> processCaptureRequest(const ::android::hardware::hidl_vec<::android::hardware::camera::device::V3_2::CaptureRequest>& requests, const ::android::hardware::hidl_vec<::android::hardware::camera::device::V3_2::BufferCache>& cachesToRemove, processCaptureRequest_cb _hidl_cb) override = 0;
281
282 /**
283 * Return callback for getCaptureRequestMetadataQueue
284 */
285 using getCaptureRequestMetadataQueue_cb = std::function<void(const ::android::hardware::MQDescriptorSync<uint8_t>& queue)>;
286 /**
287 * getCaptureRequestMetadataQueue:
288 *
289 * Retrieves the queue used along with processCaptureRequest. If
290 * client decides to use fast message queue to pass request metadata,
291 * it must:
292 * - Call getCaptureRequestMetadataQueue to retrieve the fast message queue;
293 * - In each of the requests sent in processCaptureRequest, set
294 * fmqSettingsSize field of CaptureRequest to be the size to read from the
295 * fast message queue; leave settings field of CaptureRequest empty.
296 *
297 * @return queue the queue that client writes request metadata to.
298 */
299 virtual ::android::hardware::Return<void> getCaptureRequestMetadataQueue(getCaptureRequestMetadataQueue_cb _hidl_cb) override = 0;
300
301 /**
302 * Return callback for getCaptureResultMetadataQueue
303 */
304 using getCaptureResultMetadataQueue_cb = std::function<void(const ::android::hardware::MQDescriptorSync<uint8_t>& queue)>;
305 /**
306 * getCaptureResultMetadataQueue:
307 *
308 * Retrieves the queue used along with
309 * ICameraDeviceCallback.processCaptureResult.
310 *
311 * Clients to ICameraDeviceSession must:
312 * - Call getCaptureRequestMetadataQueue to retrieve the fast message queue;
313 * - In implementation of ICameraDeviceCallback, test whether
314 * .fmqResultSize field is zero.
315 * - If .fmqResultSize != 0, read result metadata from the fast message
316 * queue;
317 * - otherwise, read result metadata in CaptureResult.result.
318 *
319 * @return queue the queue that implementation writes result metadata to.
320 */
321 virtual ::android::hardware::Return<void> getCaptureResultMetadataQueue(getCaptureResultMetadataQueue_cb _hidl_cb) override = 0;
322
323 /**
324 * flush:
325 *
326 * Flush all currently in-process captures and all buffers in the pipeline
327 * on the given device. Generally, this method is used to dump all state as
328 * quickly as possible in order to prepare for a configure_streams() call.
329 *
330 * No buffers are required to be successfully returned, so every buffer
331 * held at the time of flush() (whether successfully filled or not) may be
332 * returned with CAMERA3_BUFFER_STATUS_ERROR. Note the HAL is still allowed
333 * to return valid (CAMERA3_BUFFER_STATUS_OK) buffers during this call,
334 * provided they are successfully filled.
335 *
336 * All requests currently in the HAL are expected to be returned as soon as
337 * possible. Not-in-process requests must return errors immediately. Any
338 * interruptible hardware blocks must be stopped, and any uninterruptible
339 * blocks must be waited on.
340 *
341 * flush() may be called concurrently to processCaptureRequest(), with the
342 * expectation that processCaptureRequest returns quickly and the
343 * request submitted in that processCaptureRequest call is treated like
344 * all other in-flight requests. Due to concurrency issues, it is possible
345 * that from the HAL's point of view, a processCaptureRequest() call may
346 * be started after flush has been invoked but has not returned yet. If such
347 * a call happens before flush() returns, the HAL must treat the new
348 * capture request like other in-flight pending requests (see #4 below).
349 *
350 * More specifically, the HAL must follow below requirements for various
351 * cases:
352 *
353 * 1. For captures that are too late for the HAL to cancel/stop, and must be
354 * completed normally by the HAL; i.e. the HAL can send shutter/notify
355 * and processCaptureResult and buffers as normal.
356 *
357 * 2. For pending requests that have not done any processing, the HAL must
358 * call notify CAMERA3_MSG_ERROR_REQUEST, and return all the output
359 * buffers with processCaptureResult in the error state
360 * (CAMERA3_BUFFER_STATUS_ERROR). The HAL must not place the release
361 * fence into an error state, instead, the release fences must be set to
362 * the acquire fences passed by the framework, or -1 if they have been
363 * waited on by the HAL already. This is also the path to follow for any
364 * captures for which the HAL already called notify() with
365 * CAMERA3_MSG_SHUTTER but won't be producing any metadata/valid buffers
366 * for. After CAMERA3_MSG_ERROR_REQUEST, for a given frame, only
367 * processCaptureResults with buffers in CAMERA3_BUFFER_STATUS_ERROR
368 * are allowed. No further notifys or processCaptureResult with
369 * non-empty metadata is allowed.
370 *
371 * 3. For partially completed pending requests that do not have all the
372 * output buffers or perhaps missing metadata, the HAL must follow
373 * below:
374 *
375 * 3.1. Call notify with CAMERA3_MSG_ERROR_RESULT if some of the expected
376 * result metadata (i.e. one or more partial metadata) won't be
377 * available for the capture.
378 *
379 * 3.2. Call notify with CAMERA3_MSG_ERROR_BUFFER for every buffer that
380 * won't be produced for the capture.
381 *
382 * 3.3. Call notify with CAMERA3_MSG_SHUTTER with the capture timestamp
383 * before any buffers/metadata are returned with
384 * processCaptureResult.
385 *
386 * 3.4. For captures that will produce some results, the HAL must not
387 * call CAMERA3_MSG_ERROR_REQUEST, since that indicates complete
388 * failure.
389 *
390 * 3.5. Valid buffers/metadata must be passed to the framework as
391 * normal.
392 *
393 * 3.6. Failed buffers must be returned to the framework as described
394 * for case 2. But failed buffers do not have to follow the strict
395 * ordering valid buffers do, and may be out-of-order with respect
396 * to valid buffers. For example, if buffers A, B, C, D, E are sent,
397 * D and E are failed, then A, E, B, D, C is an acceptable return
398 * order.
399 *
400 * 3.7. For fully-missing metadata, calling CAMERA3_MSG_ERROR_RESULT is
401 * sufficient, no need to call processCaptureResult with empty
402 * metadata or equivalent.
403 *
404 * 4. If a flush() is invoked while a processCaptureRequest() invocation
405 * is active, that process call must return as soon as possible. In
406 * addition, if a processCaptureRequest() call is made after flush()
407 * has been invoked but before flush() has returned, the capture request
408 * provided by the late processCaptureRequest call must be treated
409 * like a pending request in case #2 above.
410 *
411 * flush() must only return when there are no more outstanding buffers or
412 * requests left in the HAL. The framework may call configure_streams (as
413 * the HAL state is now quiesced) or may issue new requests.
414 *
415 * Note that it's sufficient to only support fully-succeeded and
416 * fully-failed result cases. However, it is highly desirable to support
417 * the partial failure cases as well, as it could help improve the flush
418 * call overall performance.
419 *
420 * Performance requirements:
421 *
422 * The HAL should return from this call in 100ms, and must return from this
423 * call in 1000ms. And this call must not be blocked longer than pipeline
424 * latency (see S7 for definition).
425 *
426 * @return status Status code for the operation, one of:
427 * OK:
428 * On a successful flush of the camera HAL.
429 * INTERNAL_ERROR:
430 * If the camera device has encountered a serious error. After this
431 * error is returned, only the close() method can be successfully
432 * called by the framework.
433 */
434 virtual ::android::hardware::Return<::android::hardware::camera::common::V1_0::Status> flush() override = 0;
435
436 /**
437 * close:
438 *
439 * Shut down the camera device.
440 *
441 * After this call, all calls to this session instance must return
442 * INTERNAL_ERROR.
443 *
444 * This method must always succeed, even if the device has encountered a
445 * serious error.
446 */
447 virtual ::android::hardware::Return<void> close() override = 0;
448
449 /**
450 * Return callback for configureStreams_3_3
451 */
452 using configureStreams_3_3_cb = std::function<void(::android::hardware::camera::common::V1_0::Status status, const ::android::hardware::camera::device::V3_3::HalStreamConfiguration& halConfiguration)>;
453 /**
454 * configureStreams_3_3:
455 *
456 * Identical to @3.2::ICameraDeviceSession.configureStreams, except that:
457 *
458 * - The output HalStreamConfiguration now contains an overrideDataspace
459 * field, to be used by the HAL to select a different dataspace for some
460 * use cases when dealing with the IMPLEMENTATION_DEFINED pixel format.
461 *
462 * Clients may invoke either this method or
463 * @3.2::ICameraDeviceSession.configureStreams() for stream configuration.
464 * This method is recommended for clients to use since it provides more
465 * flexibility.
466 */
467 virtual ::android::hardware::Return<void> configureStreams_3_3(const ::android::hardware::camera::device::V3_2::StreamConfiguration& requestedConfiguration, configureStreams_3_3_cb _hidl_cb) override = 0;
468
469 /**
470 * Return callback for configureStreams_3_4
471 */
472 using configureStreams_3_4_cb = std::function<void(::android::hardware::camera::common::V1_0::Status status, const ::android::hardware::camera::device::V3_4::HalStreamConfiguration& halConfiguration)>;
473 /**
474 * configureStreams_3_4:
475 *
476 * Identical to @3.3::ICameraDeviceSession.configureStreams, except that:
477 *
478 * - The requested configuration includes session parameters.
479 *
480 * @return Status Status code for the operation, one of:
481 * OK:
482 * On successful stream configuration.
483 * INTERNAL_ERROR:
484 * If there has been a fatal error and the device is no longer
485 * operational. Only close() can be called successfully by the
486 * framework after this error is returned.
487 * ILLEGAL_ARGUMENT:
488 * If the requested stream configuration is invalid. Some examples
489 * of invalid stream configurations include:
490 * - Including more than 1 INPUT stream
491 * - Not including any OUTPUT streams
492 * - Including streams with unsupported formats, or an unsupported
493 * size for that format.
494 * - Including too many output streams of a certain format.
495 * - Unsupported rotation configuration
496 * - Stream sizes/formats don't satisfy the
497 * StreamConfigurationMode requirements
498 * for non-NORMAL mode, or the requested operation_mode is not
499 * supported by the HAL.
500 * - Unsupported usage flag
501 * The camera service cannot filter out all possible illegal stream
502 * configurations, since some devices may support more simultaneous
503 * streams or larger stream resolutions than the minimum required
504 * for a given camera device hardware level. The HAL must return an
505 * ILLEGAL_ARGUMENT for any unsupported stream set, and then be
506 * ready to accept a future valid stream configuration in a later
507 * configureStreams call.
508 * @return halConfiguration The stream parameters desired by the HAL for
509 * each stream, including maximum buffers, the usage flags, and the
510 * override format.
511 */
512 virtual ::android::hardware::Return<void> configureStreams_3_4(const ::android::hardware::camera::device::V3_4::StreamConfiguration& requestedConfiguration, configureStreams_3_4_cb _hidl_cb) override = 0;
513
514 /**
515 * Return callback for processCaptureRequest_3_4
516 */
517 using processCaptureRequest_3_4_cb = std::function<void(::android::hardware::camera::common::V1_0::Status status, uint32_t numRequestProcessed)>;
518 /**
519 * processCaptureRequest_3_4:
520 *
521 * Identical to @3.2::ICameraDeviceSession.processCaptureRequest, except that:
522 *
523 * - The capture request can include individual settings for physical camera devices
524 * backing a logical multi-camera.
525 *
526 * @return status Status code for the operation, one of:
527 * OK:
528 * On a successful start to processing the capture request
529 * ILLEGAL_ARGUMENT:
530 * If the input is malformed (the settings are empty when not
531 * allowed, the physical camera settings are invalid, there are 0
532 * output buffers, etc) and capture processing
533 * cannot start. Failures during request processing must be
534 * handled by calling ICameraDeviceCallback::notify(). In case of
535 * this error, the framework retains responsibility for the
536 * stream buffers' fences and the buffer handles; the HAL must not
537 * close the fences or return these buffers with
538 * ICameraDeviceCallback::processCaptureResult().
539 * INTERNAL_ERROR:
540 * If the camera device has encountered a serious error. After this
541 * error is returned, only the close() method can be successfully
542 * called by the framework.
543 * @return numRequestProcessed Number of requests successfully processed by
544 * camera HAL. When status is OK, this must be equal to the size of
545 * requests. When the call fails, this number is the number of requests
546 * that HAL processed successfully before HAL runs into an error.
547 *
548 */
549 virtual ::android::hardware::Return<void> processCaptureRequest_3_4(const ::android::hardware::hidl_vec<::android::hardware::camera::device::V3_4::CaptureRequest>& requests, const ::android::hardware::hidl_vec<::android::hardware::camera::device::V3_2::BufferCache>& cachesToRemove, processCaptureRequest_3_4_cb _hidl_cb) override = 0;
550
551 /**
552 * Return callback for configureStreams_3_5
553 */
554 using configureStreams_3_5_cb = std::function<void(::android::hardware::camera::common::V1_0::Status status, const ::android::hardware::camera::device::V3_4::HalStreamConfiguration& halConfiguration)>;
555 /**
556 * configureStreams_3_5:
557 *
558 * Identical to @3.4::ICameraDeviceSession.configureStreams, except that:
559 *
560 * - a streamConfigCounter counter is provided to check for race condition
561 * between configureStreams_3_5 and signalStreamFlush call.
562 * - In case the HAL overrides dataspace or format for
563 * IMPLEMENTATION_DEFINED pixel format, camera framework must use original
564 * dataspace and format in subsequent configureStreams_3_5 calls for the same
565 * stream. HAL is allowed to change the overriding behavior of format or
566 * dataspace for reconfiguration of the same stream depending on the stream
567 * combination.
568 *
569 * @return status Status code for the operation, one of:
570 * OK:
571 * On successful stream configuration.
572 * INTERNAL_ERROR:
573 * If there has been a fatal error and the device is no longer
574 * operational. Only close() can be called successfully by the
575 * framework after this error is returned.
576 * ILLEGAL_ARGUMENT:
577 * If the requested stream configuration is invalid. Some examples
578 * of invalid stream configurations include:
579 * - Including more than 1 INPUT stream
580 * - Not including any OUTPUT streams
581 * - Including streams with unsupported formats, or an unsupported
582 * size for that format.
583 * - Including too many output streams of a certain format.
584 * - Unsupported rotation configuration
585 * - Stream sizes/formats don't satisfy the
586 * StreamConfigurationMode requirements
587 * for non-NORMAL mode, or the requested operation_mode is not
588 * supported by the HAL.
589 * - Unsupported usage flag
590 * The camera service cannot filter out all possible illegal stream
591 * configurations, since some devices may support more simultaneous
592 * streams or larger stream resolutions than the minimum required
593 * for a given camera device hardware level. The HAL must return an
594 * ILLEGAL_ARGUMENT for any unsupported stream set, and then be
595 * ready to accept a future valid stream configuration in a later
596 * configureStreams call.
597 * @return halConfiguration The stream parameters desired by the HAL for
598 * each stream, including maximum buffers, the usage flags, and the
599 * override format.
600 */
601 virtual ::android::hardware::Return<void> configureStreams_3_5(const ::android::hardware::camera::device::V3_5::StreamConfiguration& requestedConfiguration, configureStreams_3_5_cb _hidl_cb) override = 0;
602
603 /**
604 * signalStreamFlush:
605 *
606 * Signaling HAL camera service is about to perform configureStreams_3_5 and
607 * HAL must return all buffers of designated streams. HAL must finish
608 * inflight requests normally and return all buffers that belongs to the
609 * designated streams through processCaptureResult or returnStreamBuffer
610 * API in a timely manner, or camera service will run into a fatal error.
611 *
612 * Note that this call serves as an optional hint and camera service may
613 * skip sending this call if all buffers are already returned.
614 *
615 * @param streamIds The ID of streams camera service need all of its
616 * buffers returned.
617 *
618 * @param streamConfigCounter Note that due to concurrency nature, it is
619 * possible the signalStreamFlush call arrives later than the
620 * corresponding configureStreams_3_5 call, HAL must check
621 * streamConfigCounter for such race condition. If the counter is less
622 * than the counter in the last configureStreams_3_5 call HAL last
623 * received, the call is stale and HAL should just return this call.
624 */
625 virtual ::android::hardware::Return<void> signalStreamFlush(const ::android::hardware::hidl_vec<int32_t>& streamIds, uint32_t streamConfigCounter) override = 0;
626
627 /**
628 * Return callback for isReconfigurationRequired
629 */
630 using isReconfigurationRequired_cb = std::function<void(::android::hardware::camera::common::V1_0::Status status, bool reconfigurationNeeded)>;
631 /**
632 * isReconfigurationRequired:
633 *
634 * Check whether complete stream reconfiguration is required for possible new session
635 * parameter values.
636 *
637 * This method must be called by the camera framework in case the client changes
638 * the value of any advertised session parameters. Depending on the specific values
639 * the HAL can decide whether a complete stream reconfiguration is required. In case
640 * the HAL returns false, the camera framework must skip the internal reconfiguration.
641 * In case Hal returns true, the framework must reconfigure the streams and pass the
642 * new session parameter values accordingly.
643 * This call may be done by the framework some time before the request with new parameters
644 * is submitted to the HAL, and the request may be cancelled before it ever gets submitted.
645 * Therefore, the HAL must not use this query as an indication to change its behavior in any
646 * way.
647 * ------------------------------------------------------------------------
648 *
649 * Preconditions:
650 *
651 * The framework can call this method at any time after active
652 * session configuration. There must be no impact on the performance of
653 * pending camera requests in any way. In particular there must not be
654 * any glitches or delays during normal camera streaming.
655 *
656 * Performance requirements:
657 * HW and SW camera settings must not be changed and there must not be
658 * a user-visible impact on camera performance.
659 *
660 * @param oldSessionParams Before session parameters, usually the current session parameters.
661 * @param newSessionParams The new session parameters which may be set by client.
662 *
663 * @return Status Status code for the operation, one of:
664 * OK:
665 * On successful reconfiguration required query.
666 * METHOD_NOT_SUPPORTED:
667 * The camera device does not support the reconfiguration query.
668 * INTERNAL_ERROR:
669 * The reconfiguration query cannot complete due to internal
670 * error.
671 * @return true in case the stream reconfiguration is required, false otherwise.
672 */
673 virtual ::android::hardware::Return<void> isReconfigurationRequired(const ::android::hardware::hidl_vec<uint8_t>& oldSessionParams, const ::android::hardware::hidl_vec<uint8_t>& newSessionParams, isReconfigurationRequired_cb _hidl_cb) override = 0;
674
675 /**
676 * Return callback for configureStreams_3_6
677 */
678 using configureStreams_3_6_cb = std::function<void(::android::hardware::camera::common::V1_0::Status status, const ::android::hardware::camera::device::V3_6::HalStreamConfiguration& halConfiguration)>;
679 /**
680 * configureStreams_3_6:
681 *
682 * Identical to @3.5::ICameraDeviceSession.configureStreams, except that:
683 *
684 * - a boolean supportOffline is added to HalStreamConfiguration to indicate
685 * if this stream can be switched to offline mode later.
686 *
687 * @return status Status code for the operation, one of:
688 * OK:
689 * On successful stream configuration.
690 * INTERNAL_ERROR:
691 * If there has been a fatal error and the device is no longer
692 * operational. Only close() can be called successfully by the
693 * framework after this error is returned.
694 * ILLEGAL_ARGUMENT:
695 * If the requested stream configuration is invalid. Some examples
696 * of invalid stream configurations include:
697 * - Including more than 1 INPUT stream
698 * - Not including any OUTPUT streams
699 * - Including streams with unsupported formats, or an unsupported
700 * size for that format.
701 * - Including too many output streams of a certain format.
702 * - Unsupported rotation configuration
703 * - Stream sizes/formats don't satisfy the
704 * StreamConfigurationMode requirements
705 * for non-NORMAL mode, or the requested operation_mode is not
706 * supported by the HAL.
707 * - Unsupported usage flag
708 * The camera service cannot filter out all possible illegal stream
709 * configurations, since some devices may support more simultaneous
710 * streams or larger stream resolutions than the minimum required
711 * for a given camera device hardware level. The HAL must return an
712 * ILLEGAL_ARGUMENT for any unsupported stream set, and then be
713 * ready to accept a future valid stream configuration in a later
714 * configureStreams call.
715 * @return halConfiguration The stream parameters desired by the HAL for
716 * each stream, including maximum buffers, the usage flags, and the
717 * override format.
718 */
719 virtual ::android::hardware::Return<void> configureStreams_3_6(const ::android::hardware::camera::device::V3_5::StreamConfiguration& requestedConfiguration, configureStreams_3_6_cb _hidl_cb) override = 0;
720
721 /**
722 * Return callback for switchToOffline
723 */
724 using switchToOffline_cb = std::function<void(::android::hardware::camera::common::V1_0::Status status, const ::android::hardware::camera::device::V3_6::CameraOfflineSessionInfo& offlineSessionInfo, const ::android::sp<::android::hardware::camera::device::V3_6::ICameraOfflineSession>& offlineSession)>;
725 /**
726 * switchToOffline:
727 *
728 * Switch the current running session from actively streaming mode to the
729 * offline mode. See ICameraOfflineSession for more details.
730 *
731 * The streamsToKeep argument contains list of streams IDs where application
732 * still needs its output. For all streams application does not need anymore,
733 * camera HAL can send ERROR_BUFFER to speed up the transition, or even send
734 * ERROR_REQUEST if all output targets of a request is not needed. By the
735 * time this call returns, camera HAL must have returned all buffers coming
736 * from streams no longer needed and have erased buffer caches of such streams.
737 *
738 * For all requests that are going to be transferred to offline session,
739 * the ICameraDeviceSession is responsible to capture all input buffers from
740 * the image sensor before the switchToOffline call returns. Before
741 * switchToOffline returns, camera HAL must have completed all requests not
742 * switching to offline mode, and collected information on what streams and
743 * requests are going to continue in the offline session, in the
744 * offlineSessionInfo output argument.
745 *
746 * If there are no requests qualified to be transferred to offline session,
747 * the camera HAL must return a null ICameraOfflineSession object with OK
748 * status. In this scenario, the camera HAL still must flush all inflight
749 * requests and unconfigure all streams before returning this call.
750 *
751 * After switchToOffline returns, the ICameraDeviceSession must be back to
752 * unconfigured state as if it is just created and no streams are configured.
753 * Also, camera HAL must not call any methods in ICameraDeviceCallback since
754 * all unfinished requests are now transferred to the offline session.
755 * After the call returns, camera service may then call close to close
756 * the camera device, or call configureStream* again to reconfigure the
757 * camera and then send new capture requests with processCaptureRequest. In
758 * the latter case, it is legitimate for camera HAL to call methods in
759 * ICameraDeviceCallback again in response to the newly submitted capture
760 * requests.
761 *
762 * @return status Status code for the operation, one of:
763 * OK:
764 * On switching to offline session and unconfiguring streams
765 * successfully.
766 * ILLEGAL_ARGUMENT:
767 * If camera does not support offline mode in any one of streams
768 * in streamsToKeep argument. Note that the camera HAL must report
769 * if a stream supports offline mode in HalStreamConfiguration
770 * output of configureStreams_3_6 method. If all streams in
771 * streamsToKeep argument support offline mode, then the camera HAL
772 * must not return this error.
773 *
774 *
775 * @return offlineSessionInfo Information on what streams and requests will
776 * be transferred to offline session to continue processing.
777 *
778 * @return offlineSession The offline session object camera service will use
779 * to interact with.
780 */
781 virtual ::android::hardware::Return<void> switchToOffline(const ::android::hardware::hidl_vec<int32_t>& streamsToKeep, switchToOffline_cb _hidl_cb) override = 0;
782
783 /**
784 * Return callback for configureStreams_3_7
785 */
786 using configureStreams_3_7_cb = std::function<void(::android::hardware::camera::common::V1_0::Status status, const ::android::hardware::camera::device::V3_6::HalStreamConfiguration& halConfiguration)>;
787 /**
788 * configureStreams_3_7:
789 *
790 * Identical to @3.6::ICameraDeviceSession.configureStreams_3_6, except that:
791 *
792 * - The requestedConfiguration allows the camera framework to configure
793 * stream groups.
794 * - For requested configurations of streams within the same group, the
795 * corresponding halConfiguration must have the same usage flags and
796 * maxBuffers.
797 * - Within a CaptureRequest, the application is guaranteed not to request
798 * more than one streams within the same stream group. When one of the
799 * stream within a stream group is requested, the camera HAL can either
800 * produce output on that stream, or any other stream within the same
801 * stream group.
802 * - The requestedConfiguration allows the camera framework to indicate that
803 * input images of different sizes may be submitted within capture
804 * requests.
805 *
806 * @return status Status code for the operation, one of:
807 * OK:
808 * On successful stream configuration.
809 * INTERNAL_ERROR:
810 * If there has been a fatal error and the device is no longer
811 * operational. Only close() can be called successfully by the
812 * framework after this error is returned.
813 * ILLEGAL_ARGUMENT:
814 * If the requested stream configuration is invalid. Some examples
815 * of invalid stream configurations include:
816 * - Including more than 1 INPUT stream
817 * - Not including any OUTPUT streams
818 * - Including streams with unsupported formats, or an unsupported
819 * size for that format.
820 * - Including too many output streams of a certain format.
821 * - Unsupported rotation configuration
822 * - Stream sizes/formats don't satisfy the
823 * StreamConfigurationMode requirements
824 * for non-NORMAL mode, or the requested operation_mode is not
825 * supported by the HAL.
826 * - Unsupported usage flag
827 * - Unsupported stream groupIds, or unsupported multi-resolution
828 * input stream.
829 * The camera service cannot filter out all possible illegal stream
830 * configurations, since some devices may support more simultaneous
831 * streams or larger stream resolutions than the minimum required
832 * for a given camera device hardware level. The HAL must return an
833 * ILLEGAL_ARGUMENT for any unsupported stream set, and then be
834 * ready to accept a future valid stream configuration in a later
835 * configureStreams call.
836 * @return halConfiguration The stream parameters desired by the HAL for
837 * each stream, including maximum buffers, the usage flags, and the
838 * override format.
839 */
840 virtual ::android::hardware::Return<void> configureStreams_3_7(const ::android::hardware::camera::device::V3_7::StreamConfiguration& requestedConfiguration, configureStreams_3_7_cb _hidl_cb) override = 0;
841
842 /**
843 * Return callback for processCaptureRequest_3_7
844 */
845 using processCaptureRequest_3_7_cb = std::function<void(::android::hardware::camera::common::V1_0::Status status, uint32_t numRequestProcessed)>;
846 /**
847 * processCaptureRequest_3_7:
848 *
849 * Identical to @3.4::ICameraDeviceSession.processCaptureRequest, except that:
850 *
851 * - The capture request can include width and height of the input buffer for
852 * a reprocessing request.
853 *
854 * @return status Status code for the operation, one of:
855 * OK:
856 * On a successful start to processing the capture request
857 * ILLEGAL_ARGUMENT:
858 * If the input is malformed (the settings are empty when not
859 * allowed, the physical camera settings are invalid, there are 0
860 * output buffers, etc) and capture processing
861 * cannot start. Failures during request processing must be
862 * handled by calling ICameraDeviceCallback::notify(). In case of
863 * this error, the framework retains responsibility for the
864 * stream buffers' fences and the buffer handles; the HAL must not
865 * close the fences or return these buffers with
866 * ICameraDeviceCallback::processCaptureResult().
867 * In case of multi-resolution input image, this error must be returned
868 * if the caller passes in a CaptureRequest with an invalid
869 * [inputWith, inputHeight].
870 * INTERNAL_ERROR:
871 * If the camera device has encountered a serious error. After this
872 * error is returned, only the close() method can be successfully
873 * called by the framework.
874 * @return numRequestProcessed Number of requests successfully processed by
875 * camera HAL. When status is OK, this must be equal to the size of
876 * requests. When the call fails, this number is the number of requests
877 * that HAL processed successfully before HAL runs into an error.
878 *
879 */
880 virtual ::android::hardware::Return<void> processCaptureRequest_3_7(const ::android::hardware::hidl_vec<::android::hardware::camera::device::V3_7::CaptureRequest>& requests, const ::android::hardware::hidl_vec<::android::hardware::camera::device::V3_2::BufferCache>& cachesToRemove, processCaptureRequest_3_7_cb _hidl_cb) override = 0;
881
882 /**
883 * configureInjectionStreams:
884 *
885 * Identical to @3.7::ICameraDeviceSession.configureStreams_3_7, except that:
886 *
887 * @param requestedConfiguration
888 * The current stream configuration of the internal camera session and
889 * the injection camera must follow the configuration without overriding
890 * any part of it.
891 * @param characteristics
892 * The characteristics of internal camera contains a list of keys so that
893 * the stream continuity can be maintained after the external camera is
894 * injected.
895 *
896 * @return status Status code for the operation, one of:
897 * OK:
898 * On successful stream configuration.
899 * INTERNAL_ERROR:
900 * If there has been a fatal error and the device is no longer
901 * operational. Only close() can be called successfully by the
902 * framework after this error is returned.
903 * ILLEGAL_ARGUMENT:
904 * If the requested stream configuration is invalid. Some examples
905 * of invalid stream configurations include:
906 * - Not including any OUTPUT streams
907 * - Including streams with unsupported formats, or an unsupported
908 * size for that format.
909 * - Including too many output streams of a certain format.
910 * - Unsupported rotation configuration
911 * - Stream sizes/formats don't satisfy the
912 * StreamConfigurationMode requirements
913 * for non-NORMAL mode, or the requested operation_mode is not
914 * supported by the HAL.
915 * - Unsupported usage flag
916 * The camera service cannot filter out all possible illegal stream
917 * configurations, since some devices may support more simultaneous
918 * streams or larger stream resolutions than the minimum required
919 * for a given camera device hardware level. The HAL must return an
920 * ILLEGAL_ARGUMENT for any unsupported stream set, and then be
921 * ready to accept a future valid stream configuration in a later
922 * configureInjectionStreams call.
923 */
924 virtual ::android::hardware::Return<::android::hardware::camera::common::V1_0::Status> configureInjectionStreams(const ::android::hardware::camera::device::V3_7::StreamConfiguration& requestedConfiguration, const ::android::hardware::hidl_vec<uint8_t>& characteristics) = 0;
925
926 /**
927 * Return callback for interfaceChain
928 */
929 using interfaceChain_cb = std::function<void(const ::android::hardware::hidl_vec<::android::hardware::hidl_string>& descriptors)>;
930 /*
931 * Provides run-time type information for this object.
932 * For example, for the following interface definition:
933 * package [email protected];
934 * interface IParent {};
935 * interface IChild extends IParent {};
936 * Calling interfaceChain on an IChild object must yield the following:
937 * ["[email protected]::IChild",
938 * "[email protected]::IParent"
939 * "[email protected]::IBase"]
940 *
941 * @return descriptors a vector of descriptors of the run-time type of the
942 * object.
943 */
944 virtual ::android::hardware::Return<void> interfaceChain(interfaceChain_cb _hidl_cb) override;
945
946 /*
947 * Emit diagnostic information to the given file.
948 *
949 * Optionally overriden.
950 *
951 * @param fd File descriptor to dump data to.
952 * Must only be used for the duration of this call.
953 * @param options Arguments for debugging.
954 * Must support empty for default debug information.
955 */
956 virtual ::android::hardware::Return<void> debug(const ::android::hardware::hidl_handle& fd, const ::android::hardware::hidl_vec<::android::hardware::hidl_string>& options) override;
957
958 /**
959 * Return callback for interfaceDescriptor
960 */
961 using interfaceDescriptor_cb = std::function<void(const ::android::hardware::hidl_string& descriptor)>;
962 /*
963 * Provides run-time type information for this object.
964 * For example, for the following interface definition:
965 * package [email protected];
966 * interface IParent {};
967 * interface IChild extends IParent {};
968 * Calling interfaceDescriptor on an IChild object must yield
969 * "[email protected]::IChild"
970 *
971 * @return descriptor a descriptor of the run-time type of the
972 * object (the first element of the vector returned by
973 * interfaceChain())
974 */
975 virtual ::android::hardware::Return<void> interfaceDescriptor(interfaceDescriptor_cb _hidl_cb) override;
976
977 /**
978 * Return callback for getHashChain
979 */
980 using getHashChain_cb = std::function<void(const ::android::hardware::hidl_vec<::android::hardware::hidl_array<uint8_t, 32>>& hashchain)>;
981 /*
982 * Returns hashes of the source HAL files that define the interfaces of the
983 * runtime type information on the object.
984 * For example, for the following interface definition:
985 * package [email protected];
986 * interface IParent {};
987 * interface IChild extends IParent {};
988 * Calling interfaceChain on an IChild object must yield the following:
989 * [(hash of IChild.hal),
990 * (hash of IParent.hal)
991 * (hash of IBase.hal)].
992 *
993 * SHA-256 is used as the hashing algorithm. Each hash has 32 bytes
994 * according to SHA-256 standard.
995 *
996 * @return hashchain a vector of SHA-1 digests
997 */
998 virtual ::android::hardware::Return<void> getHashChain(getHashChain_cb _hidl_cb) override;
999
1000 /*
1001 * This method trigger the interface to enable/disable instrumentation based
1002 * on system property hal.instrumentation.enable.
1003 */
1004 virtual ::android::hardware::Return<void> setHALInstrumentation() override;
1005
1006 /*
1007 * Registers a death recipient, to be called when the process hosting this
1008 * interface dies.
1009 *
1010 * @param recipient a hidl_death_recipient callback object
1011 * @param cookie a cookie that must be returned with the callback
1012 * @return success whether the death recipient was registered successfully.
1013 */
1014 virtual ::android::hardware::Return<bool> linkToDeath(const ::android::sp<::android::hardware::hidl_death_recipient>& recipient, uint64_t cookie) override;
1015
1016 /*
1017 * Provides way to determine if interface is running without requesting
1018 * any functionality.
1019 */
1020 virtual ::android::hardware::Return<void> ping() override;
1021
1022 /**
1023 * Return callback for getDebugInfo
1024 */
1025 using getDebugInfo_cb = std::function<void(const ::android::hidl::base::V1_0::DebugInfo& info)>;
1026 /*
1027 * Get debug information on references on this interface.
1028 * @return info debugging information. See comments of DebugInfo.
1029 */
1030 virtual ::android::hardware::Return<void> getDebugInfo(getDebugInfo_cb _hidl_cb) override;
1031
1032 /*
1033 * This method notifies the interface that one or more system properties
1034 * have changed. The default implementation calls
1035 * (C++) report_sysprop_change() in libcutils or
1036 * (Java) android.os.SystemProperties.reportSyspropChanged,
1037 * which in turn calls a set of registered callbacks (eg to update trace
1038 * tags).
1039 */
1040 virtual ::android::hardware::Return<void> notifySyspropsChanged() override;
1041
1042 /*
1043 * Unregisters the registered death recipient. If this service was registered
1044 * multiple times with the same exact death recipient, this unlinks the most
1045 * recently registered one.
1046 *
1047 * @param recipient a previously registered hidl_death_recipient callback
1048 * @return success whether the death recipient was unregistered successfully.
1049 */
1050 virtual ::android::hardware::Return<bool> unlinkToDeath(const ::android::sp<::android::hardware::hidl_death_recipient>& recipient) override;
1051
1052 // cast static functions
1053 /**
1054 * This performs a checked cast based on what the underlying implementation actually is.
1055 */
1056 static ::android::hardware::Return<::android::sp<::android::hardware::camera::device::V3_7::ICameraInjectionSession>> castFrom(const ::android::sp<::android::hardware::camera::device::V3_7::ICameraInjectionSession>& parent, bool emitError = false);
1057 /**
1058 * This performs a checked cast based on what the underlying implementation actually is.
1059 */
1060 static ::android::hardware::Return<::android::sp<::android::hardware::camera::device::V3_7::ICameraInjectionSession>> castFrom(const ::android::sp<::android::hardware::camera::device::V3_7::ICameraDeviceSession>& parent, bool emitError = false);
1061 /**
1062 * This performs a checked cast based on what the underlying implementation actually is.
1063 */
1064 static ::android::hardware::Return<::android::sp<::android::hardware::camera::device::V3_7::ICameraInjectionSession>> castFrom(const ::android::sp<::android::hardware::camera::device::V3_6::ICameraDeviceSession>& parent, bool emitError = false);
1065 /**
1066 * This performs a checked cast based on what the underlying implementation actually is.
1067 */
1068 static ::android::hardware::Return<::android::sp<::android::hardware::camera::device::V3_7::ICameraInjectionSession>> castFrom(const ::android::sp<::android::hardware::camera::device::V3_5::ICameraDeviceSession>& parent, bool emitError = false);
1069 /**
1070 * This performs a checked cast based on what the underlying implementation actually is.
1071 */
1072 static ::android::hardware::Return<::android::sp<::android::hardware::camera::device::V3_7::ICameraInjectionSession>> castFrom(const ::android::sp<::android::hardware::camera::device::V3_4::ICameraDeviceSession>& parent, bool emitError = false);
1073 /**
1074 * This performs a checked cast based on what the underlying implementation actually is.
1075 */
1076 static ::android::hardware::Return<::android::sp<::android::hardware::camera::device::V3_7::ICameraInjectionSession>> castFrom(const ::android::sp<::android::hardware::camera::device::V3_3::ICameraDeviceSession>& parent, bool emitError = false);
1077 /**
1078 * This performs a checked cast based on what the underlying implementation actually is.
1079 */
1080 static ::android::hardware::Return<::android::sp<::android::hardware::camera::device::V3_7::ICameraInjectionSession>> castFrom(const ::android::sp<::android::hardware::camera::device::V3_2::ICameraDeviceSession>& parent, bool emitError = false);
1081 /**
1082 * This performs a checked cast based on what the underlying implementation actually is.
1083 */
1084 static ::android::hardware::Return<::android::sp<::android::hardware::camera::device::V3_7::ICameraInjectionSession>> castFrom(const ::android::sp<::android::hidl::base::V1_0::IBase>& parent, bool emitError = false);
1085
1086 // helper methods for interactions with the hwservicemanager
1087 /**
1088 * This gets the service of this type with the specified instance name. If the
1089 * service is currently not available or not in the VINTF manifest on a Trebilized
1090 * device, this will return nullptr. This is useful when you don't want to block
1091 * during device boot. If getStub is true, this will try to return an unwrapped
1092 * passthrough implementation in the same process. This is useful when getting an
1093 * implementation from the same partition/compilation group.
1094 *
1095 * In general, prefer getService(std::string,bool)
1096 */
1097 static ::android::sp<ICameraInjectionSession> tryGetService(const std::string &serviceName="default", bool getStub=false);
1098 /**
1099 * Deprecated. See tryGetService(std::string, bool)
1100 */
1101 static ::android::sp<ICameraInjectionSession> tryGetService(const char serviceName[], bool getStub=false) { std::string str(serviceName ? serviceName : ""); return tryGetService(str, getStub); }
1102 /**
1103 * Deprecated. See tryGetService(std::string, bool)
1104 */
1105 static ::android::sp<ICameraInjectionSession> tryGetService(const ::android::hardware::hidl_string& serviceName, bool getStub=false) { std::string str(serviceName.c_str()); return tryGetService(str, getStub); }
1106 /**
1107 * Calls tryGetService("default", bool). This is the recommended instance name for singleton services.
1108 */
tryGetServiceICameraInjectionSession1109 static ::android::sp<ICameraInjectionSession> tryGetService(bool getStub) { return tryGetService("default", getStub); }
1110 /**
1111 * This gets the service of this type with the specified instance name. If the
1112 * service is not in the VINTF manifest on a Trebilized device, this will return
1113 * nullptr. If the service is not available, this will wait for the service to
1114 * become available. If the service is a lazy service, this will start the service
1115 * and return when it becomes available. If getStub is true, this will try to
1116 * return an unwrapped passthrough implementation in the same process. This is
1117 * useful when getting an implementation from the same partition/compilation group.
1118 */
1119 static ::android::sp<ICameraInjectionSession> getService(const std::string &serviceName="default", bool getStub=false);
1120 /**
1121 * Deprecated. See getService(std::string, bool)
1122 */
1123 static ::android::sp<ICameraInjectionSession> getService(const char serviceName[], bool getStub=false) { std::string str(serviceName ? serviceName : ""); return getService(str, getStub); }
1124 /**
1125 * Deprecated. See getService(std::string, bool)
1126 */
1127 static ::android::sp<ICameraInjectionSession> getService(const ::android::hardware::hidl_string& serviceName, bool getStub=false) { std::string str(serviceName.c_str()); return getService(str, getStub); }
1128 /**
1129 * Calls getService("default", bool). This is the recommended instance name for singleton services.
1130 */
getServiceICameraInjectionSession1131 static ::android::sp<ICameraInjectionSession> getService(bool getStub) { return getService("default", getStub); }
1132 /**
1133 * Registers a service with the service manager. For Trebilized devices, the service
1134 * must also be in the VINTF manifest.
1135 */
1136 __attribute__ ((warn_unused_result))::android::status_t registerAsService(const std::string &serviceName="default");
1137 /**
1138 * Registers for notifications for when a service is registered.
1139 */
1140 static bool registerForNotifications(
1141 const std::string &serviceName,
1142 const ::android::sp<::android::hidl::manager::V1_0::IServiceNotification> ¬ification);
1143 };
1144
1145 //
1146 // type declarations for package
1147 //
1148
1149 static inline std::string toString(const ::android::sp<::android::hardware::camera::device::V3_7::ICameraInjectionSession>& o);
1150
1151 //
1152 // type header definitions for package
1153 //
1154
toString(const::android::sp<::android::hardware::camera::device::V3_7::ICameraInjectionSession> & o)1155 static inline std::string toString(const ::android::sp<::android::hardware::camera::device::V3_7::ICameraInjectionSession>& o) {
1156 std::string os = "[class or subclass of ";
1157 os += ::android::hardware::camera::device::V3_7::ICameraInjectionSession::descriptor;
1158 os += "]";
1159 os += o->isRemote() ? "@remote" : "@local";
1160 return os;
1161 }
1162
1163
1164 } // namespace V3_7
1165 } // namespace device
1166 } // namespace camera
1167 } // namespace hardware
1168 } // namespace android
1169
1170 //
1171 // global type declarations for package
1172 //
1173
1174
1175 #endif // HIDL_GENERATED_ANDROID_HARDWARE_CAMERA_DEVICE_V3_7_ICAMERAINJECTIONSESSION_H
1176