IRemoteDisplayClient.h revision 2013a54981d4ffb036dff279b88cc9f08c0ee1c2
1/* 2 * Copyright (C) 2012 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_IREMOTEDISPLAYCLIENT_H 18#define ANDROID_IREMOTEDISPLAYCLIENT_H 19 20#include <stdint.h> 21#include <sys/types.h> 22 23#include <utils/RefBase.h> 24#include <binder/IInterface.h> 25#include <binder/Parcel.h> 26 27namespace android { 28 29class ISurfaceTexture; 30 31class IRemoteDisplayClient : public IInterface 32{ 33public: 34 DECLARE_META_INTERFACE(RemoteDisplayClient); 35 36 enum { 37 // Flag: The remote display is using a secure transport protocol such as HDCP. 38 kDisplayFlagSecure = 1 << 0, 39 }; 40 41 enum { 42 // Error: An unknown / generic error occurred. 43 kErrorUnknown = 0, 44 // Error: The connection was dropped unexpectedly. 45 kErrorConnectionDropped = 1, 46 }; 47 48 // Indicates that the remote display has been connected successfully. 49 // Provides a surface texture that the client should use to stream buffers to 50 // the remote display. 51 virtual void onDisplayConnected(const sp<ISurfaceTexture>& surfaceTexture, 52 uint32_t width, uint32_t height, uint32_t flags) = 0; // one-way 53 54 // Indicates that the remote display has been disconnected normally. 55 // This method should only be called once the client has called 'disconnect()'. 56 // It is currently an error for the display to disconnect for any other reason. 57 virtual void onDisplayDisconnected() = 0; // one-way 58 59 // Indicates that a connection could not be established to the remote display 60 // or an unrecoverable error occurred and the connection was severed. 61 // The media server should continue listening for connection attempts from the 62 // remote display. 63 virtual void onDisplayError(int32_t error) = 0; // one-way 64}; 65 66 67// ---------------------------------------------------------------------------- 68 69class BnRemoteDisplayClient : public BnInterface<IRemoteDisplayClient> 70{ 71public: 72 virtual status_t onTransact( uint32_t code, 73 const Parcel& data, 74 Parcel* reply, 75 uint32_t flags = 0); 76}; 77 78}; // namespace android 79 80#endif // ANDROID_IREMOTEDISPLAYCLIENT_H 81