blob: 8caa7651a5f2b9e9fbd2208b760fb1fe7fda9226 [file] [log] [blame]
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -08001/*
2 * Copyright (C) 2007 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
Mathias Agopian90ac7992012-02-25 18:48:35 -080017#ifndef ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H
18#define ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080019
20#include <stdint.h>
21#include <sys/types.h>
22
23#include <utils/Errors.h>
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080024#include <utils/RefBase.h>
25
Mathias Agopian9cce3252010-02-09 17:46:37 -080026#include <binder/IInterface.h>
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080027
28#include <ui/PixelFormat.h>
Mathias Agopian7e27f052010-05-28 14:22:23 -070029
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080030namespace android {
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080031// ----------------------------------------------------------------------------
32
Mathias Agopian4d9b8222013-03-12 17:11:48 -070033class IGraphicBufferProducer;
34
Mathias Agopian7e27f052010-05-28 14:22:23 -070035class ISurfaceComposerClient : public IInterface
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080036{
Mathias Agopian7e27f052010-05-28 14:22:23 -070037public:
38 DECLARE_META_INTERFACE(SurfaceComposerClient);
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080039
Mathias Agopian3165cc22012-08-08 19:42:09 -070040 // flags for createSurface()
41 enum { // (keep in sync with Surface.java)
42 eHidden = 0x00000004,
43 eDestroyBackbuffer = 0x00000020,
44 eSecure = 0x00000080,
45 eNonPremultiplied = 0x00000100,
46 eOpaque = 0x00000400,
47 eProtectedByApp = 0x00000800,
48 eProtectedByDRM = 0x00001000,
49
50 eFXSurfaceNormal = 0x00000000,
Mathias Agopian3165cc22012-08-08 19:42:09 -070051 eFXSurfaceDim = 0x00020000,
Wonsik Kimf837c932014-02-24 14:20:35 +090052 eFXSurfaceVideoPlane= 0x00040000,
Mathias Agopian3165cc22012-08-08 19:42:09 -070053 eFXSurfaceMask = 0x000F0000,
54 };
55
Mathias Agopiancc08e682010-04-15 18:48:26 -070056 /*
57 * Requires ACCESS_SURFACE_FLINGER permission
58 */
Mathias Agopian4d9b8222013-03-12 17:11:48 -070059 virtual status_t createSurface(
Jeff Brown9d4e3d22012-08-24 20:00:51 -070060 const String8& name, uint32_t w, uint32_t h,
Mathias Agopian4d9b8222013-03-12 17:11:48 -070061 PixelFormat format, uint32_t flags,
62 sp<IBinder>* handle,
63 sp<IGraphicBufferProducer>* gbp) = 0;
Mathias Agopian7e27f052010-05-28 14:22:23 -070064
Mathias Agopiancc08e682010-04-15 18:48:26 -070065 /*
66 * Requires ACCESS_SURFACE_FLINGER permission
67 */
Mathias Agopianac9fa422013-02-11 16:40:36 -080068 virtual status_t destroySurface(const sp<IBinder>& handle) = 0;
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080069};
70
71// ----------------------------------------------------------------------------
72
Mathias Agopian3165cc22012-08-08 19:42:09 -070073class BnSurfaceComposerClient: public BnInterface<ISurfaceComposerClient> {
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080074public:
Mathias Agopian3165cc22012-08-08 19:42:09 -070075 virtual status_t onTransact(uint32_t code, const Parcel& data,
76 Parcel* reply, uint32_t flags = 0);
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080077};
78
79// ----------------------------------------------------------------------------
80
81}; // namespace android
82
Mathias Agopian90ac7992012-02-25 18:48:35 -080083#endif // ANDROID_GUI_ISURFACE_COMPOSER_CLIENT_H