blob: ff031d5c870be9ae6ac4bd193d5d51918f0d7b3a [file] [log] [blame]
The Android Open Source Project7c1b96a2008-10-21 07:00:00 -07001/*
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
17#ifndef ANDROID_ISURFACE_H
18#define ANDROID_ISURFACE_H
19
20#include <stdint.h>
21#include <sys/types.h>
22
23#include <utils/Errors.h>
24#include <utils/IInterface.h>
25#include <utils/RefBase.h>
26#include <ui/PixelFormat.h>
27
28namespace android {
29
30typedef int32_t SurfaceID;
31
32class IMemoryHeap;
The Android Open Source Projecte09fd9e2008-12-17 18:05:43 -080033class Overlay;
The Android Open Source Project7c1b96a2008-10-21 07:00:00 -070034
35class ISurface : public IInterface
36{
37public:
38 DECLARE_META_INTERFACE(Surface);
39
40 virtual status_t registerBuffers(int w, int h, int hstride, int vstride,
41 PixelFormat format, const sp<IMemoryHeap>& heap) = 0;
42
43 virtual void postBuffer(ssize_t offset) = 0; // one-way
44
45 virtual void unregisterBuffers() = 0;
The Android Open Source Projecte09fd9e2008-12-17 18:05:43 -080046
47 virtual sp<Overlay> createOverlay(
48 uint32_t w, uint32_t h, int32_t format) = 0;
The Android Open Source Project7c1b96a2008-10-21 07:00:00 -070049};
50
51// ----------------------------------------------------------------------------
52
53class BnSurface : public BnInterface<ISurface>
54{
55public:
56 virtual status_t onTransact( uint32_t code,
57 const Parcel& data,
58 Parcel* reply,
59 uint32_t flags = 0);
60};
61
62// ----------------------------------------------------------------------------
63
64}; // namespace android
65
66#endif // ANDROID_ISURFACE_H