update the binder protocol for connect to match that of queueBuffer
indeed, connect and queueBuffer return the same data, so it's easier to have them use the same protocol. Change-Id: I4f9fa3be0a80c9ab0a7a4039b282ae843aab02e1
This commit is contained in:
parent
a0db308c3d
commit
24202f5676
|
@ -143,8 +143,7 @@ public:
|
|||
//
|
||||
// This method will fail if the connect was previously called on the
|
||||
// BufferQueue and no corresponding disconnect call was made.
|
||||
virtual status_t connect(int api,
|
||||
uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform);
|
||||
virtual status_t connect(int api, QueueBufferOutput* output);
|
||||
|
||||
// disconnect attempts to disconnect a producer client API from the
|
||||
// BufferQueue. Calling this method will cause any subsequent calls to other
|
||||
|
|
|
@ -153,8 +153,7 @@ protected:
|
|||
// outWidth, outHeight and outTransform are filled with the default width
|
||||
// and height of the window and current transform applied to buffers,
|
||||
// respectively.
|
||||
virtual status_t connect(int api,
|
||||
uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform) = 0;
|
||||
virtual status_t connect(int api, QueueBufferOutput* output) = 0;
|
||||
|
||||
// disconnect attempts to disconnect a client API from the SurfaceTexture.
|
||||
// Calling this method will cause any subsequent calls to other
|
||||
|
|
|
@ -651,8 +651,7 @@ void BufferQueue::cancelBuffer(int buf) {
|
|||
mDequeueCondition.broadcast();
|
||||
}
|
||||
|
||||
status_t BufferQueue::connect(int api,
|
||||
uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform) {
|
||||
status_t BufferQueue::connect(int api, QueueBufferOutput* output) {
|
||||
ATRACE_CALL();
|
||||
ST_LOGV("connect: api=%d", api);
|
||||
Mutex::Autolock lock(mMutex);
|
||||
|
@ -679,9 +678,7 @@ status_t BufferQueue::connect(int api,
|
|||
err = -EINVAL;
|
||||
} else {
|
||||
mConnectedApi = api;
|
||||
*outWidth = mDefaultWidth;
|
||||
*outHeight = mDefaultHeight;
|
||||
*outTransform = mTransformHint;
|
||||
output->inflate(mDefaultWidth, mDefaultHeight, mDefaultHeight);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -145,8 +145,7 @@ public:
|
|||
return result;
|
||||
}
|
||||
|
||||
virtual status_t connect(int api,
|
||||
uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform) {
|
||||
virtual status_t connect(int api, QueueBufferOutput* output) {
|
||||
Parcel data, reply;
|
||||
data.writeInterfaceToken(ISurfaceTexture::getInterfaceDescriptor());
|
||||
data.writeInt32(api);
|
||||
|
@ -154,9 +153,7 @@ public:
|
|||
if (result != NO_ERROR) {
|
||||
return result;
|
||||
}
|
||||
*outWidth = reply.readInt32();
|
||||
*outHeight = reply.readInt32();
|
||||
*outTransform = reply.readInt32();
|
||||
memcpy(output, reply.readInplace(sizeof(*output)), sizeof(*output));
|
||||
result = reply.readInt32();
|
||||
return result;
|
||||
}
|
||||
|
@ -251,12 +248,10 @@ status_t BnSurfaceTexture::onTransact(
|
|||
case CONNECT: {
|
||||
CHECK_INTERFACE(ISurfaceTexture, data, reply);
|
||||
int api = data.readInt32();
|
||||
uint32_t outWidth, outHeight, outTransform;
|
||||
status_t res = connect(api,
|
||||
&outWidth, &outHeight, &outTransform);
|
||||
reply->writeInt32(outWidth);
|
||||
reply->writeInt32(outHeight);
|
||||
reply->writeInt32(outTransform);
|
||||
QueueBufferOutput* const output =
|
||||
reinterpret_cast<QueueBufferOutput *>(
|
||||
reply->writeInplace(sizeof(QueueBufferOutput)));
|
||||
status_t res = connect(api, output);
|
||||
reply->writeInt32(res);
|
||||
return NO_ERROR;
|
||||
} break;
|
||||
|
|
|
@ -429,8 +429,9 @@ int SurfaceTextureClient::connect(int api) {
|
|||
ATRACE_CALL();
|
||||
ALOGV("SurfaceTextureClient::connect");
|
||||
Mutex::Autolock lock(mMutex);
|
||||
int err = mSurfaceTexture->connect(api,
|
||||
&mDefaultWidth, &mDefaultHeight, &mTransformHint);
|
||||
ISurfaceTexture::QueueBufferOutput output;
|
||||
int err = mSurfaceTexture->connect(api, &output);
|
||||
output.deflate(&mDefaultWidth, &mDefaultHeight, &mTransformHint);
|
||||
if (!err && api == NATIVE_WINDOW_API_CPU) {
|
||||
mConnectedToCpu = true;
|
||||
}
|
||||
|
|
|
@ -34,10 +34,8 @@ SurfaceTextureLayer::SurfaceTextureLayer()
|
|||
SurfaceTextureLayer::~SurfaceTextureLayer() {
|
||||
}
|
||||
|
||||
status_t SurfaceTextureLayer::connect(int api,
|
||||
uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform) {
|
||||
status_t err = BufferQueue::connect(api,
|
||||
outWidth, outHeight, outTransform);
|
||||
status_t SurfaceTextureLayer::connect(int api, QueueBufferOutput* output) {
|
||||
status_t err = BufferQueue::connect(api, output);
|
||||
if (err == NO_ERROR) {
|
||||
switch(api) {
|
||||
case NATIVE_WINDOW_API_MEDIA:
|
||||
|
|
|
@ -37,8 +37,7 @@ public:
|
|||
SurfaceTextureLayer();
|
||||
~SurfaceTextureLayer();
|
||||
|
||||
virtual status_t connect(int api,
|
||||
uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform);
|
||||
virtual status_t connect(int api, QueueBufferOutput* output);
|
||||
};
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue