1*4d7e907cSAndroid Build Coastguard Worker/* 2*4d7e907cSAndroid Build Coastguard Worker * Copyright (C) 2016 The Android Open Source Project 3*4d7e907cSAndroid Build Coastguard Worker * 4*4d7e907cSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*4d7e907cSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*4d7e907cSAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*4d7e907cSAndroid Build Coastguard Worker * 8*4d7e907cSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*4d7e907cSAndroid Build Coastguard Worker * 10*4d7e907cSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*4d7e907cSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*4d7e907cSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*4d7e907cSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*4d7e907cSAndroid Build Coastguard Worker * limitations under the License. 15*4d7e907cSAndroid Build Coastguard Worker */ 16*4d7e907cSAndroid Build Coastguard Worker 17*4d7e907cSAndroid Build Coastguard Workerpackage [email protected]; 18*4d7e907cSAndroid Build Coastguard Worker 19*4d7e907cSAndroid Build Coastguard Workerimport ITvInputCallback; 20*4d7e907cSAndroid Build Coastguard Worker 21*4d7e907cSAndroid Build Coastguard Workerinterface ITvInput { 22*4d7e907cSAndroid Build Coastguard Worker /** 23*4d7e907cSAndroid Build Coastguard Worker * Sets a callback for events. 24*4d7e907cSAndroid Build Coastguard Worker * 25*4d7e907cSAndroid Build Coastguard Worker * Note that initially no device is available in the client side, so the 26*4d7e907cSAndroid Build Coastguard Worker * implementation must notify all the currently available devices including 27*4d7e907cSAndroid Build Coastguard Worker * static devices via callback once callback is set. 28*4d7e907cSAndroid Build Coastguard Worker * 29*4d7e907cSAndroid Build Coastguard Worker * @param callback Callback object to pass events. 30*4d7e907cSAndroid Build Coastguard Worker */ 31*4d7e907cSAndroid Build Coastguard Worker @entry 32*4d7e907cSAndroid Build Coastguard Worker @exit 33*4d7e907cSAndroid Build Coastguard Worker @callflow(next={"getStreamConfigurations"}) 34*4d7e907cSAndroid Build Coastguard Worker setCallback(ITvInputCallback callback); 35*4d7e907cSAndroid Build Coastguard Worker 36*4d7e907cSAndroid Build Coastguard Worker /** 37*4d7e907cSAndroid Build Coastguard Worker * Gets stream configurations for a specific device. 38*4d7e907cSAndroid Build Coastguard Worker * 39*4d7e907cSAndroid Build Coastguard Worker * The configs object is valid only until the next 40*4d7e907cSAndroid Build Coastguard Worker * STREAM_CONFIGURATIONS_CHANGED event. 41*4d7e907cSAndroid Build Coastguard Worker * 42*4d7e907cSAndroid Build Coastguard Worker * @param deviceId Device ID for the configurations. 43*4d7e907cSAndroid Build Coastguard Worker * @return result OK upon success. Otherwise, 44*4d7e907cSAndroid Build Coastguard Worker * INVALID_ARGUMENTS if the given device ID is not valid. 45*4d7e907cSAndroid Build Coastguard Worker * @return configurations An array of available configurations. 46*4d7e907cSAndroid Build Coastguard Worker */ 47*4d7e907cSAndroid Build Coastguard Worker @callflow(next={"openStream", "getStreamConfigurations", "closeStream"}) 48*4d7e907cSAndroid Build Coastguard Worker getStreamConfigurations(int32_t deviceId) 49*4d7e907cSAndroid Build Coastguard Worker generates (Result result, vec<TvStreamConfig> configurations); 50*4d7e907cSAndroid Build Coastguard Worker 51*4d7e907cSAndroid Build Coastguard Worker /** 52*4d7e907cSAndroid Build Coastguard Worker * Opens a specific stream in a device. 53*4d7e907cSAndroid Build Coastguard Worker * 54*4d7e907cSAndroid Build Coastguard Worker * @param deviceId Device ID for the steam to open. 55*4d7e907cSAndroid Build Coastguard Worker * @param streamId Steam ID for the steam to open. Must be one of the 56*4d7e907cSAndroid Build Coastguard Worker * stream IDs returned from getStreamConfigurations(). 57*4d7e907cSAndroid Build Coastguard Worker * @return result OK upon success. Otherwise, 58*4d7e907cSAndroid Build Coastguard Worker * INVALID_ARGUMENTS if any of given IDs are not valid; 59*4d7e907cSAndroid Build Coastguard Worker * INVALID_STATE if the stream with the given ID is already open; 60*4d7e907cSAndroid Build Coastguard Worker * NO_RESOURCE if the client must close other streams to open the 61*4d7e907cSAndroid Build Coastguard Worker * stream. 62*4d7e907cSAndroid Build Coastguard Worker * @return sidebandStream handle for sideband stream. 63*4d7e907cSAndroid Build Coastguard Worker */ 64*4d7e907cSAndroid Build Coastguard Worker @callflow(next={"closeStream", "getStreamConfigurations", "openStream"}) 65*4d7e907cSAndroid Build Coastguard Worker openStream(int32_t deviceId, int32_t streamId) 66*4d7e907cSAndroid Build Coastguard Worker generates (Result result, handle sidebandStream); 67*4d7e907cSAndroid Build Coastguard Worker 68*4d7e907cSAndroid Build Coastguard Worker /** 69*4d7e907cSAndroid Build Coastguard Worker * Closes a specific stream in a device. 70*4d7e907cSAndroid Build Coastguard Worker * 71*4d7e907cSAndroid Build Coastguard Worker * @param deviceId Device ID for the steam to open. 72*4d7e907cSAndroid Build Coastguard Worker * @param streamId Steam ID for the steam to open. 73*4d7e907cSAndroid Build Coastguard Worker * @return result OK upon success. Otherwise, 74*4d7e907cSAndroid Build Coastguard Worker * INVALID_ARGUMENTS if any of given IDs are not valid; 75*4d7e907cSAndroid Build Coastguard Worker * INVALID_STATE if the stream with the given ID is not open. 76*4d7e907cSAndroid Build Coastguard Worker */ 77*4d7e907cSAndroid Build Coastguard Worker @callflow(next={"getStreamConfigurations", "openStream", "closeStream"}) 78*4d7e907cSAndroid Build Coastguard Worker closeStream(int32_t deviceId, int32_t streamId) generates (Result result); 79*4d7e907cSAndroid Build Coastguard Worker}; 80