1/*
2 * Copyright (C) 2016 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
17package [email protected];
18
19import IEvsCamera;
20import IEvsDisplay;
21
22
23/**
24 * Provides the mechanism for EVS camera discovery
25 */
26interface IEvsEnumerator {
27
28    /**
29     * Returns a list of all EVS cameras available to the system
30     *
31     * @return cameras A list of cameras availale for EVS service.
32     */
33    getCameraList() generates (vec<CameraDesc> cameras);
34
35    /**
36     * Get the IEvsCamera associated with a cameraId from a CameraDesc
37     *
38     * Given a camera's unique cameraId from CameraDesc, returns the
39     * IEvsCamera interface associated with the specified camera. When
40     * done using the camera, the caller may release it by calling closeCamera().
41     *
42     * @param  cameraId  A unique identifier of the camera.
43     * @return carCamera EvsCamera object associated with a given cameraId.
44     */
45    openCamera(string cameraId) generates (IEvsCamera carCamera);
46
47    /**
48     * Return the specified IEvsCamera interface as no longer in use
49     *
50     * When the IEvsCamera object is no longer required, it must be released.
51     * NOTE: Video streaming must be cleanly stopped before making this call.
52     *
53     * @param  carCamera EvsCamera object to be closed.
54     */
55    closeCamera(IEvsCamera carCamera);
56
57
58    /**
59     * Get exclusive access to IEvsDisplay for the system
60     *
61     * There can be at most one EVS display object for the system and this function
62     * requests access to it. If the EVS display is not available or is already in use,
63     * the old instance shall be closed and give the new caller exclusive
64     * access.
65     * When done using the display, the caller may release it by calling closeDisplay().
66     *
67     * @return display EvsDisplay object to be used.
68     */
69    openDisplay() generates (IEvsDisplay display);
70
71    /**
72     * Return the specified IEvsDisplay interface as no longer in use
73     *
74     * When the IEvsDisplay object is no longer required, it must be released.
75     * NOTE: All buffers must have been returned to the display before making this call.
76     *
77     * @param  display EvsDisplay object to be closed.
78     */
79    closeDisplay(IEvsDisplay display);
80
81    /**
82     * This call requests the current state of the display
83     *
84     * If there is no open display, this returns DisplayState::NOT_OPEN. otherwise, it returns
85     * the actual state of the active display.  This call is replicated on the IEvsEnumerator
86     * interface in order to allow secondary clients to monitor the state of the EVS display
87     * without acquiring exclusive ownership of the display.
88     *
89     * @return state Current DisplayState of this Display.
90     */
91    getDisplayState() generates (DisplayState state);
92};
93
94