blob: ca691f518c94245e2ccf47648dc645e48acb45db [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;
33
34class ISurface : public IInterface
35{
36public:
37 DECLARE_META_INTERFACE(Surface);
38
39 virtual status_t registerBuffers(int w, int h, int hstride, int vstride,
40 PixelFormat format, const sp<IMemoryHeap>& heap) = 0;
41
42 virtual void postBuffer(ssize_t offset) = 0; // one-way
43
44 virtual void unregisterBuffers() = 0;
45};
46
47// ----------------------------------------------------------------------------
48
49class BnSurface : public BnInterface<ISurface>
50{
51public:
52 virtual status_t onTransact( uint32_t code,
53 const Parcel& data,
54 Parcel* reply,
55 uint32_t flags = 0);
56};
57
58// ----------------------------------------------------------------------------
59
60}; // namespace android
61
62#endif // ANDROID_ISURFACE_H