blob: 05cee910fde8cd0aff29ce17b0a54391dabdf76a [file] [log] [blame]
Henry Fangec766142019-08-01 16:28:33 -07001/*
2 * Copyright (C) 2019 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 */
16package android.hardware.tv.tuner@1.0;
17
18import IFrontendCallback;
19
20/**
21 * A Tuner Frontend is used to tune to a frequency and lock signal. It provide
22 * live data feed to Tuner Demux interface.
23 */
24interface IFrontend {
25 /**
26 * Set the callback
27 *
28 * It is used by the client to receive events from the Frontend.
29 * Only one callback for one Frontend instance is supported. The callback
30 * will be replaced if it's set again.
31 *
32 * @param callback Callback object to pass Frontend events to the system.
33 * The previously registered callback must be replaced with this one.
34 * It can be null.
35 * @return result Result status of the operation.
36 * SUCCESS if successful,
37 * INVALID_STATE if callback can't be set at current stage,
38 * UNKNOWN_ERROR if callback setting failed for other reasons.
39 */
40 setCallback(IFrontendCallback callback) generates (Result result);
41
42 /**
43 * Tuning Frontend
44 *
45 * It is used by the client to lock a frequency by providing signal
46 * delivery information. If previous tuning isn't completed, this call must
47 * stop previous tuning, and start a new tuning. Tune is a async call.
48 * LOCKED or NO_SIGNAL eventi is sent back to caller through callback.
49 *
50 * @param settings Signal delivery information which frontend can use to
51 * search and lock the signal.
52 *
53 * @return result Result status of the operation.
54 * SUCCESS if successful,
55 * INVALID_STATE if tuning can't be applied at current stage,
56 * UNKNOWN_ERROR if tuning failed for other reasons.
57 */
58 tune(FrontendSettings settings) generates (Result result);
59
60 /**
61 * Stop the tuning
62 *
63 * It is used by the client to stop a previous tuning.
64 *
65 * @return result Result status of the operation.
66 * SUCCESS if successfully stop tuning.
67 * UNKNOWN_ERROR if failed for other reasons.
68 */
69 stopTune() generates (Result result);
70
71 /**
72 * Release the Frontend instance
73 *
74 * It is used by the client to release the frontend instance. HAL clear
75 * underneath resource. client mustn't access the instance any more.
76 *
77 * @return result Result status of the operation.
78 * SUCCESS if successful,
79 * UNKNOWN_ERROR if failed for other reasons.
80 */
81 close() generates (Result result);
82};