18ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis/* 28ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis * Copyright (C) 2010 The Android Open Source Project 38ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis * 48ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis * Licensed under the Apache License, Version 2.0 (the "License"); 58ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis * you may not use this file except in compliance with the License. 68ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis * You may obtain a copy of the License at 78ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis * 88ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis * http://www.apache.org/licenses/LICENSE-2.0 98ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis * 108ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis * Unless required by applicable law or agreed to in writing, software 118ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis * distributed under the License is distributed on an "AS IS" BASIS, 128ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 138ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis * See the License for the specific language governing permissions and 148ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis * limitations under the License. 158ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis */ 168ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis 172adaf04fab35cf47c824d74d901b54094e01ccd3Andy McFadden#ifndef ANDROID_GUI_IGRAPHICBUFFERPRODUCER_H 182adaf04fab35cf47c824d74d901b54094e01ccd3Andy McFadden#define ANDROID_GUI_IGRAPHICBUFFERPRODUCER_H 198ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis 208ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis#include <stdint.h> 218ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis#include <sys/types.h> 228ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis 238ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis#include <utils/Errors.h> 248ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis#include <utils/RefBase.h> 258ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis 268ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis#include <binder/IInterface.h> 278ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis 28f78575400977f644cf0b12beb2fa5fc278b6ed4cJesse Hall#include <ui/Fence.h> 298ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis#include <ui/GraphicBuffer.h> 308ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis#include <ui/Rect.h> 318ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis 328ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennisnamespace android { 338ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis// ---------------------------------------------------------------------------- 348ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis 35e3c697fb929c856b59fa56a8e05a2a7eba187c3dMathias Agopianclass Surface; 36eafabcdc1639fb96062d9e3c39b0ae27b0238ae1Mathias Agopian 370273adbf0bc202eda2ca579ae0773464ea9c701fAndy McFadden/* 38466a192d2088f9238d34597d1aa28da41367c1caAndy McFadden * This class defines the Binder IPC interface for the producer side of 39466a192d2088f9238d34597d1aa28da41367c1caAndy McFadden * a queue of graphics buffers. It's used to send graphics data from one 40466a192d2088f9238d34597d1aa28da41367c1caAndy McFadden * component to another. For example, a class that decodes video for 41466a192d2088f9238d34597d1aa28da41367c1caAndy McFadden * playback might use this to provide frames. This is typically done 42e3c697fb929c856b59fa56a8e05a2a7eba187c3dMathias Agopian * indirectly, through Surface. 430273adbf0bc202eda2ca579ae0773464ea9c701fAndy McFadden * 44466a192d2088f9238d34597d1aa28da41367c1caAndy McFadden * The underlying mechanism is a BufferQueue, which implements 45466a192d2088f9238d34597d1aa28da41367c1caAndy McFadden * BnGraphicBufferProducer. In normal operation, the producer calls 46466a192d2088f9238d34597d1aa28da41367c1caAndy McFadden * dequeueBuffer() to get an empty buffer, fills it with data, then 47466a192d2088f9238d34597d1aa28da41367c1caAndy McFadden * calls queueBuffer() to make it available to the consumer. 480273adbf0bc202eda2ca579ae0773464ea9c701fAndy McFadden * 492adaf04fab35cf47c824d74d901b54094e01ccd3Andy McFadden * This class was previously called ISurfaceTexture. 500273adbf0bc202eda2ca579ae0773464ea9c701fAndy McFadden */ 512adaf04fab35cf47c824d74d901b54094e01ccd3Andy McFaddenclass IGraphicBufferProducer : public IInterface 528ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis{ 538ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennispublic: 542adaf04fab35cf47c824d74d901b54094e01ccd3Andy McFadden DECLARE_META_INTERFACE(GraphicBufferProducer); 558ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis 568072711307aa98ee5ee6f7369860ae38c3e19656Mathias Agopian enum { 578072711307aa98ee5ee6f7369860ae38c3e19656Mathias Agopian BUFFER_NEEDS_REALLOCATION = 0x1, 588072711307aa98ee5ee6f7369860ae38c3e19656Mathias Agopian RELEASE_ALL_BUFFERS = 0x2, 598072711307aa98ee5ee6f7369860ae38c3e19656Mathias Agopian }; 60a5c75c01620179ce00812354778a29a80d76e71fMathias Agopian 618ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis // requestBuffer requests a new buffer for the given index. The server (i.e. 622adaf04fab35cf47c824d74d901b54094e01ccd3Andy McFadden // the IGraphicBufferProducer implementation) assigns the newly created 632adaf04fab35cf47c824d74d901b54094e01ccd3Andy McFadden // buffer to the given slot index, and the client is expected to mirror the 648ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis // slot->buffer mapping so that it's not necessary to transfer a 658ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis // GraphicBuffer for every dequeue operation. 667b305fffc39d0fe0926e7fd2d7f6a524fbce62b7Jamie Gennis virtual status_t requestBuffer(int slot, sp<GraphicBuffer>* buf) = 0; 678ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis 688ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis // setBufferCount sets the number of buffer slots available. Calling this 698ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis // will also cause all buffer slots to be emptied. The caller should empty 708ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis // its mirrored copy of the buffer slots when calling this method. 718ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis virtual status_t setBufferCount(int bufferCount) = 0; 728ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis 738ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis // dequeueBuffer requests a new buffer slot for the client to use. Ownership 748ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis // of the slot is transfered to the client, meaning that the server will not 758ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis // use the contents of the buffer associated with that slot. The slot index 768ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis // returned may or may not contain a buffer. If the slot is empty the client 778ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis // should call requestBuffer to assign a new buffer to that slot. The client 788ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis // is expected to either call cancelBuffer on the dequeued slot or to fill 798ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis // in the contents of its associated buffer contents and call queueBuffer. 80a5c75c01620179ce00812354778a29a80d76e71fMathias Agopian // If dequeueBuffer return BUFFER_NEEDS_REALLOCATION, the client is 81a5c75c01620179ce00812354778a29a80d76e71fMathias Agopian // expected to call requestBuffer immediately. 82f78575400977f644cf0b12beb2fa5fc278b6ed4cJesse Hall // 83f78575400977f644cf0b12beb2fa5fc278b6ed4cJesse Hall // The fence parameter will be updated to hold the fence associated with 84f78575400977f644cf0b12beb2fa5fc278b6ed4cJesse Hall // the buffer. The contents of the buffer must not be overwritten until the 85f78575400977f644cf0b12beb2fa5fc278b6ed4cJesse Hall // fence signals. If the fence is NULL, the buffer may be written 86f78575400977f644cf0b12beb2fa5fc278b6ed4cJesse Hall // immediately. 877cdd786fa80cf03551291ae8feca7b77583be1c5Mathias Agopian // 887cdd786fa80cf03551291ae8feca7b77583be1c5Mathias Agopian // The async parameter sets whether we're in asynchrnous mode for this 897cdd786fa80cf03551291ae8feca7b77583be1c5Mathias Agopian // deququeBuffer() call. 907cdd786fa80cf03551291ae8feca7b77583be1c5Mathias Agopian virtual status_t dequeueBuffer(int *slot, sp<Fence>* fence, bool async, 91f78575400977f644cf0b12beb2fa5fc278b6ed4cJesse Hall uint32_t w, uint32_t h, uint32_t format, uint32_t usage) = 0; 928ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis 938ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis // queueBuffer indicates that the client has finished filling in the 948ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis // contents of the buffer associated with slot and transfers ownership of 958ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis // that slot back to the server. It is not valid to call queueBuffer on a 968ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis // slot that is not owned by the client or one for which a buffer associated 971d01a12e7150be569557b64da9b8663c62c13594Eino-Ville Talvala // via requestBuffer. In addition, a timestamp must be provided by the 981d01a12e7150be569557b64da9b8663c62c13594Eino-Ville Talvala // client for this buffer. The timestamp is measured in nanoseconds, and 991d01a12e7150be569557b64da9b8663c62c13594Eino-Ville Talvala // must be monotonically increasing. Its other properties (zero point, etc) 1001d01a12e7150be569557b64da9b8663c62c13594Eino-Ville Talvala // are client-dependent, and should be documented by the client. 10197c602c5af5f3ffd69009bf496d86347b71a2b4cMathias Agopian // 1027cdd786fa80cf03551291ae8feca7b77583be1c5Mathias Agopian // The async parameter sets whether we're queuing a buffer in asynchronous mode. 1037cdd786fa80cf03551291ae8feca7b77583be1c5Mathias Agopian // 104c10d9d90b2088a3304076e0dc4bf05cdbb5d45abMathias Agopian // outWidth, outHeight and outTransform are filled with the default width 105c10d9d90b2088a3304076e0dc4bf05cdbb5d45abMathias Agopian // and height of the window and current transform applied to buffers, 10697c602c5af5f3ffd69009bf496d86347b71a2b4cMathias Agopian // respectively. 107f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian 108e142428a9c8b9d2380032cd4d7b55ee440fe8770Mathias Agopian struct QueueBufferInput : public Flattenable<QueueBufferInput> { 109e142428a9c8b9d2380032cd4d7b55ee440fe8770Mathias Agopian friend class Flattenable<QueueBufferInput>; 110c777b0b3b9b0ea5d8e378fccde6935765e28e329Jesse Hall inline QueueBufferInput(const Parcel& parcel); 1113c25621ad7d13f64d3ab95a27fa970fbc9998f73Andy McFadden inline QueueBufferInput(int64_t timestamp, bool isAutoTimestamp, 1127cdd786fa80cf03551291ae8feca7b77583be1c5Mathias Agopian const Rect& crop, int scalingMode, uint32_t transform, bool async, 1137cdd786fa80cf03551291ae8feca7b77583be1c5Mathias Agopian const sp<Fence>& fence) 1143c25621ad7d13f64d3ab95a27fa970fbc9998f73Andy McFadden : timestamp(timestamp), isAutoTimestamp(isAutoTimestamp), crop(crop), 1153c25621ad7d13f64d3ab95a27fa970fbc9998f73Andy McFadden scalingMode(scalingMode), transform(transform), async(async), 1163c25621ad7d13f64d3ab95a27fa970fbc9998f73Andy McFadden fence(fence) { } 1173c25621ad7d13f64d3ab95a27fa970fbc9998f73Andy McFadden inline void deflate(int64_t* outTimestamp, bool* outIsAutoTimestamp, 1183c25621ad7d13f64d3ab95a27fa970fbc9998f73Andy McFadden Rect* outCrop, int* outScalingMode, uint32_t* outTransform, 1193c25621ad7d13f64d3ab95a27fa970fbc9998f73Andy McFadden bool* outAsync, sp<Fence>* outFence) const { 120f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian *outTimestamp = timestamp; 1213c25621ad7d13f64d3ab95a27fa970fbc9998f73Andy McFadden *outIsAutoTimestamp = bool(isAutoTimestamp); 122f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian *outCrop = crop; 123f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian *outScalingMode = scalingMode; 124f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian *outTransform = transform; 1257cdd786fa80cf03551291ae8feca7b77583be1c5Mathias Agopian *outAsync = bool(async); 126c777b0b3b9b0ea5d8e378fccde6935765e28e329Jesse Hall *outFence = fence; 127f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian } 128c777b0b3b9b0ea5d8e378fccde6935765e28e329Jesse Hall 129e142428a9c8b9d2380032cd4d7b55ee440fe8770Mathias Agopian // Flattenable protocol 130e142428a9c8b9d2380032cd4d7b55ee440fe8770Mathias Agopian size_t getFlattenedSize() const; 131e142428a9c8b9d2380032cd4d7b55ee440fe8770Mathias Agopian size_t getFdCount() const; 132e142428a9c8b9d2380032cd4d7b55ee440fe8770Mathias Agopian status_t flatten(void*& buffer, size_t& size, int*& fds, size_t& count) const; 133e142428a9c8b9d2380032cd4d7b55ee440fe8770Mathias Agopian status_t unflatten(void const*& buffer, size_t& size, int const*& fds, size_t& count); 134c777b0b3b9b0ea5d8e378fccde6935765e28e329Jesse Hall 135f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian private: 136f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian int64_t timestamp; 1373c25621ad7d13f64d3ab95a27fa970fbc9998f73Andy McFadden int isAutoTimestamp; 138f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian Rect crop; 139f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian int scalingMode; 140f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian uint32_t transform; 1417cdd786fa80cf03551291ae8feca7b77583be1c5Mathias Agopian int async; 142c777b0b3b9b0ea5d8e378fccde6935765e28e329Jesse Hall sp<Fence> fence; 143f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian }; 144f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian 145f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian // QueueBufferOutput must be a POD structure 146f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian struct QueueBufferOutput { 147f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian inline QueueBufferOutput() { } 148f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian inline void deflate(uint32_t* outWidth, 1492488b20aec097accb20a853d9876bb0a5dc04636Mathias Agopian uint32_t* outHeight, 1502488b20aec097accb20a853d9876bb0a5dc04636Mathias Agopian uint32_t* outTransformHint, 1512488b20aec097accb20a853d9876bb0a5dc04636Mathias Agopian uint32_t* outNumPendingBuffers) const { 152f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian *outWidth = width; 153f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian *outHeight = height; 154f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian *outTransformHint = transformHint; 1552488b20aec097accb20a853d9876bb0a5dc04636Mathias Agopian *outNumPendingBuffers = numPendingBuffers; 156f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian } 157f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian inline void inflate(uint32_t inWidth, uint32_t inHeight, 1582488b20aec097accb20a853d9876bb0a5dc04636Mathias Agopian uint32_t inTransformHint, uint32_t inNumPendingBuffers) { 159f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian width = inWidth; 160f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian height = inHeight; 161f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian transformHint = inTransformHint; 1622488b20aec097accb20a853d9876bb0a5dc04636Mathias Agopian numPendingBuffers = inNumPendingBuffers; 163f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian } 164f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian private: 165f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian uint32_t width; 166f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian uint32_t height; 167f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian uint32_t transformHint; 1682488b20aec097accb20a853d9876bb0a5dc04636Mathias Agopian uint32_t numPendingBuffers; 169f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian }; 170f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian 171f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian virtual status_t queueBuffer(int slot, 172f0bc2f1d8d37977bd3aef3d3326a70e9e69d4246Mathias Agopian const QueueBufferInput& input, QueueBufferOutput* output) = 0; 1738ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis 1748ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis // cancelBuffer indicates that the client does not wish to fill in the 1758ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis // buffer associated with slot and transfers ownership of the slot back to 1768ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis // the server. 1774c00cc11141da7d159eb2323b186ed344115c0f1Jesse Hall virtual void cancelBuffer(int slot, const sp<Fence>& fence) = 0; 1788ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis 179eafabcdc1639fb96062d9e3c39b0ae27b0238ae1Mathias Agopian // query retrieves some information for this surface 180eafabcdc1639fb96062d9e3c39b0ae27b0238ae1Mathias Agopian // 'what' tokens allowed are that of android_natives.h 181eafabcdc1639fb96062d9e3c39b0ae27b0238ae1Mathias Agopian virtual int query(int what, int* value) = 0; 1828072711307aa98ee5ee6f7369860ae38c3e19656Mathias Agopian 1832adaf04fab35cf47c824d74d901b54094e01ccd3Andy McFadden // connect attempts to connect a client API to the IGraphicBufferProducer. 1842adaf04fab35cf47c824d74d901b54094e01ccd3Andy McFadden // This must be called before any other IGraphicBufferProducer methods are 1852adaf04fab35cf47c824d74d901b54094e01ccd3Andy McFadden // called except for getAllocator. 186fe0a87b54654a1392650e7f1862df473287d8332Jamie Gennis // 187fe0a87b54654a1392650e7f1862df473287d8332Jamie Gennis // This method will fail if the connect was previously called on the 1882adaf04fab35cf47c824d74d901b54094e01ccd3Andy McFadden // IGraphicBufferProducer and no corresponding disconnect call was made. 1895bfc24515bb5c8ea7975f72d538df37753733a2fMathias Agopian // 1905bfc24515bb5c8ea7975f72d538df37753733a2fMathias Agopian // outWidth, outHeight and outTransform are filled with the default width 1915bfc24515bb5c8ea7975f72d538df37753733a2fMathias Agopian // and height of the window and current transform applied to buffers, 192365857df8b94c959dea984a63013f6e7730ef976Mathias Agopian // respectively. The token needs to be any binder object that lives in the 193365857df8b94c959dea984a63013f6e7730ef976Mathias Agopian // producer process -- it is solely used for obtaining a death notification 194365857df8b94c959dea984a63013f6e7730ef976Mathias Agopian // when the producer is killed. 195365857df8b94c959dea984a63013f6e7730ef976Mathias Agopian virtual status_t connect(const sp<IBinder>& token, 196365857df8b94c959dea984a63013f6e7730ef976Mathias Agopian int api, bool producerControlledByApp, QueueBufferOutput* output) = 0; 197fe0a87b54654a1392650e7f1862df473287d8332Jamie Gennis 1982adaf04fab35cf47c824d74d901b54094e01ccd3Andy McFadden // disconnect attempts to disconnect a client API from the 1992adaf04fab35cf47c824d74d901b54094e01ccd3Andy McFadden // IGraphicBufferProducer. Calling this method will cause any subsequent 2002adaf04fab35cf47c824d74d901b54094e01ccd3Andy McFadden // calls to other IGraphicBufferProducer methods to fail except for 2012adaf04fab35cf47c824d74d901b54094e01ccd3Andy McFadden // getAllocator and connect. Successfully calling connect after this will 2022adaf04fab35cf47c824d74d901b54094e01ccd3Andy McFadden // allow the other methods to succeed again. 203fe0a87b54654a1392650e7f1862df473287d8332Jamie Gennis // 2042adaf04fab35cf47c824d74d901b54094e01ccd3Andy McFadden // This method will fail if the the IGraphicBufferProducer is not currently 205fe0a87b54654a1392650e7f1862df473287d8332Jamie Gennis // connected to the specified client API. 206fe0a87b54654a1392650e7f1862df473287d8332Jamie Gennis virtual status_t disconnect(int api) = 0; 2078ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis}; 2088ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis 2098ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis// ---------------------------------------------------------------------------- 2108ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis 2112adaf04fab35cf47c824d74d901b54094e01ccd3Andy McFaddenclass BnGraphicBufferProducer : public BnInterface<IGraphicBufferProducer> 2128ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis{ 2138ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennispublic: 2148ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis virtual status_t onTransact( uint32_t code, 2158ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis const Parcel& data, 2168ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis Parcel* reply, 2178ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis uint32_t flags = 0); 2188ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis}; 2198ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis 2208ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis// ---------------------------------------------------------------------------- 2218ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis}; // namespace android 2228ba32fade11abb73f3fd47ea0953c9528eb5b91fJamie Gennis 2232adaf04fab35cf47c824d74d901b54094e01ccd3Andy McFadden#endif // ANDROID_GUI_IGRAPHICBUFFERPRODUCER_H 224