Loading include/gui/ISurfaceTexture.h +6 −1 Original line number Diff line number Diff line Loading @@ -78,7 +78,12 @@ protected: // client for this buffer. The timestamp is measured in nanoseconds, and // must be monotonically increasing. Its other properties (zero point, etc) // are client-dependent, and should be documented by the client. virtual status_t queueBuffer(int slot, int64_t timestamp) = 0; // // outWidth, outHeight and outTransform are filed with the default width // default height of the window and current transform applied to buffers, // respectively. virtual status_t queueBuffer(int slot, int64_t timestamp, uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform) = 0; // cancelBuffer indicates that the client does not wish to fill in the // buffer associated with slot and transfers ownership of the slot back to Loading include/gui/SurfaceTexture.h +2 −1 Original line number Diff line number Diff line Loading @@ -84,7 +84,8 @@ public: // nanoseconds, and must be monotonically increasing. Its other semantics // (zero point, etc) are client-dependent and should be documented by the // client. virtual status_t queueBuffer(int buf, int64_t timestamp); virtual status_t queueBuffer(int buf, int64_t timestamp, uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform); virtual void cancelBuffer(int buf); virtual status_t setCrop(const Rect& reg); virtual status_t setTransform(uint32_t transform); Loading include/gui/SurfaceTextureClient.h +12 −0 Original line number Diff line number Diff line Loading @@ -151,6 +151,18 @@ private: // dequeued format or to mReqFormat if no buffer was dequeued. uint32_t mQueryFormat; // mDefaultWidth is default width of the window, regardless of the // set_dimension call uint32_t mDefaultWidth; // mDefaultHeight is default width of the window, regardless of the // set_dimension call uint32_t mDefaultHeight; // mTransformHint is the transform probably applied to buffers of this // window. this is only a hint, actual transform may differ. uint32_t mTransformHint; // mMutex is the mutex used to prevent concurrent access to the member // variables of SurfaceTexture objects. It must be locked whenever the // member variables are accessed. Loading libs/gui/ISurfaceTexture.cpp +11 −2 Original line number Diff line number Diff line Loading @@ -93,12 +93,16 @@ public: return result; } virtual status_t queueBuffer(int buf, int64_t timestamp) { virtual status_t queueBuffer(int buf, int64_t timestamp, uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform) { Parcel data, reply; data.writeInterfaceToken(ISurfaceTexture::getInterfaceDescriptor()); data.writeInt32(buf); data.writeInt64(timestamp); remote()->transact(QUEUE_BUFFER, data, &reply); *outWidth = reply.readInt32(); *outHeight = reply.readInt32(); *outTransform = reply.readInt32(); status_t result = reply.readInt32(); return result; } Loading Loading @@ -226,7 +230,12 @@ status_t BnSurfaceTexture::onTransact( CHECK_INTERFACE(ISurfaceTexture, data, reply); int buf = data.readInt32(); int64_t timestamp = data.readInt64(); status_t result = queueBuffer(buf, timestamp); uint32_t outWidth, outHeight, outTransform; status_t result = queueBuffer(buf, timestamp, &outWidth, &outHeight, &outTransform); reply->writeInt32(outWidth); reply->writeInt32(outHeight); reply->writeInt32(outTransform); reply->writeInt32(result); return NO_ERROR; } break; Loading libs/gui/SurfaceTexture.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -402,7 +402,8 @@ status_t SurfaceTexture::setSynchronousMode(bool enabled) { return err; } status_t SurfaceTexture::queueBuffer(int buf, int64_t timestamp) { status_t SurfaceTexture::queueBuffer(int buf, int64_t timestamp, uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform) { LOGV("SurfaceTexture::queueBuffer"); sp<FrameAvailableListener> listener; Loading Loading @@ -463,6 +464,11 @@ status_t SurfaceTexture::queueBuffer(int buf, int64_t timestamp) { if (listener != 0) { listener->onFrameAvailable(); } *outWidth = mDefaultWidth; *outHeight = mDefaultHeight; *outTransform = 0; return OK; } Loading Loading
include/gui/ISurfaceTexture.h +6 −1 Original line number Diff line number Diff line Loading @@ -78,7 +78,12 @@ protected: // client for this buffer. The timestamp is measured in nanoseconds, and // must be monotonically increasing. Its other properties (zero point, etc) // are client-dependent, and should be documented by the client. virtual status_t queueBuffer(int slot, int64_t timestamp) = 0; // // outWidth, outHeight and outTransform are filed with the default width // default height of the window and current transform applied to buffers, // respectively. virtual status_t queueBuffer(int slot, int64_t timestamp, uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform) = 0; // cancelBuffer indicates that the client does not wish to fill in the // buffer associated with slot and transfers ownership of the slot back to Loading
include/gui/SurfaceTexture.h +2 −1 Original line number Diff line number Diff line Loading @@ -84,7 +84,8 @@ public: // nanoseconds, and must be monotonically increasing. Its other semantics // (zero point, etc) are client-dependent and should be documented by the // client. virtual status_t queueBuffer(int buf, int64_t timestamp); virtual status_t queueBuffer(int buf, int64_t timestamp, uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform); virtual void cancelBuffer(int buf); virtual status_t setCrop(const Rect& reg); virtual status_t setTransform(uint32_t transform); Loading
include/gui/SurfaceTextureClient.h +12 −0 Original line number Diff line number Diff line Loading @@ -151,6 +151,18 @@ private: // dequeued format or to mReqFormat if no buffer was dequeued. uint32_t mQueryFormat; // mDefaultWidth is default width of the window, regardless of the // set_dimension call uint32_t mDefaultWidth; // mDefaultHeight is default width of the window, regardless of the // set_dimension call uint32_t mDefaultHeight; // mTransformHint is the transform probably applied to buffers of this // window. this is only a hint, actual transform may differ. uint32_t mTransformHint; // mMutex is the mutex used to prevent concurrent access to the member // variables of SurfaceTexture objects. It must be locked whenever the // member variables are accessed. Loading
libs/gui/ISurfaceTexture.cpp +11 −2 Original line number Diff line number Diff line Loading @@ -93,12 +93,16 @@ public: return result; } virtual status_t queueBuffer(int buf, int64_t timestamp) { virtual status_t queueBuffer(int buf, int64_t timestamp, uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform) { Parcel data, reply; data.writeInterfaceToken(ISurfaceTexture::getInterfaceDescriptor()); data.writeInt32(buf); data.writeInt64(timestamp); remote()->transact(QUEUE_BUFFER, data, &reply); *outWidth = reply.readInt32(); *outHeight = reply.readInt32(); *outTransform = reply.readInt32(); status_t result = reply.readInt32(); return result; } Loading Loading @@ -226,7 +230,12 @@ status_t BnSurfaceTexture::onTransact( CHECK_INTERFACE(ISurfaceTexture, data, reply); int buf = data.readInt32(); int64_t timestamp = data.readInt64(); status_t result = queueBuffer(buf, timestamp); uint32_t outWidth, outHeight, outTransform; status_t result = queueBuffer(buf, timestamp, &outWidth, &outHeight, &outTransform); reply->writeInt32(outWidth); reply->writeInt32(outHeight); reply->writeInt32(outTransform); reply->writeInt32(result); return NO_ERROR; } break; Loading
libs/gui/SurfaceTexture.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -402,7 +402,8 @@ status_t SurfaceTexture::setSynchronousMode(bool enabled) { return err; } status_t SurfaceTexture::queueBuffer(int buf, int64_t timestamp) { status_t SurfaceTexture::queueBuffer(int buf, int64_t timestamp, uint32_t* outWidth, uint32_t* outHeight, uint32_t* outTransform) { LOGV("SurfaceTexture::queueBuffer"); sp<FrameAvailableListener> listener; Loading Loading @@ -463,6 +464,11 @@ status_t SurfaceTexture::queueBuffer(int buf, int64_t timestamp) { if (listener != 0) { listener->onFrameAvailable(); } *outWidth = mDefaultWidth; *outHeight = mDefaultHeight; *outTransform = 0; return OK; } Loading