Merge "Minor fix in SurfaceTexture"
This commit is contained in:
commit
19e0a8bfe9
|
@ -139,7 +139,7 @@ public:
|
||||||
|
|
||||||
// setFrameAvailableListener sets the listener object that will be notified
|
// setFrameAvailableListener sets the listener object that will be notified
|
||||||
// when a new frame becomes available.
|
// when a new frame becomes available.
|
||||||
void setFrameAvailableListener(const sp<FrameAvailableListener>& l);
|
void setFrameAvailableListener(const sp<FrameAvailableListener>& listener);
|
||||||
|
|
||||||
// getAllocator retrieves the binder object that must be referenced as long
|
// getAllocator retrieves the binder object that must be referenced as long
|
||||||
// as the GraphicBuffers dequeued from this SurfaceTexture are referenced.
|
// as the GraphicBuffers dequeued from this SurfaceTexture are referenced.
|
||||||
|
@ -343,7 +343,7 @@ private:
|
||||||
uint32_t mNextTransform;
|
uint32_t mNextTransform;
|
||||||
|
|
||||||
// mTexName is the name of the OpenGL texture to which streamed images will
|
// mTexName is the name of the OpenGL texture to which streamed images will
|
||||||
// be bound when updateTexImage is called. It is set at construction time
|
// be bound when updateTexImage is called. It is set at construction time
|
||||||
// changed with a call to setTexName.
|
// changed with a call to setTexName.
|
||||||
const GLuint mTexName;
|
const GLuint mTexName;
|
||||||
|
|
||||||
|
|
|
@ -148,6 +148,11 @@ status_t SurfaceTexture::setBufferCount(int bufferCount) {
|
||||||
LOGV("SurfaceTexture::setBufferCount");
|
LOGV("SurfaceTexture::setBufferCount");
|
||||||
Mutex::Autolock lock(mMutex);
|
Mutex::Autolock lock(mMutex);
|
||||||
|
|
||||||
|
if (bufferCount > NUM_BUFFER_SLOTS) {
|
||||||
|
LOGE("setBufferCount: bufferCount larger than slots available");
|
||||||
|
return BAD_VALUE;
|
||||||
|
}
|
||||||
|
|
||||||
// Error out if the user has dequeued buffers
|
// Error out if the user has dequeued buffers
|
||||||
for (int i=0 ; i<mBufferCount ; i++) {
|
for (int i=0 ; i<mBufferCount ; i++) {
|
||||||
if (mSlots[i].mBufferState == BufferSlot::DEQUEUED) {
|
if (mSlots[i].mBufferState == BufferSlot::DEQUEUED) {
|
||||||
|
@ -208,7 +213,7 @@ status_t SurfaceTexture::dequeueBuffer(int *outBuf, uint32_t w, uint32_t h,
|
||||||
uint32_t format, uint32_t usage) {
|
uint32_t format, uint32_t usage) {
|
||||||
LOGV("SurfaceTexture::dequeueBuffer");
|
LOGV("SurfaceTexture::dequeueBuffer");
|
||||||
|
|
||||||
if ((w && !h) || (!w & h)) {
|
if ((w && !h) || (!w && h)) {
|
||||||
LOGE("dequeueBuffer: invalid size: w=%u, h=%u", w, h);
|
LOGE("dequeueBuffer: invalid size: w=%u, h=%u", w, h);
|
||||||
return BAD_VALUE;
|
return BAD_VALUE;
|
||||||
}
|
}
|
||||||
|
@ -699,10 +704,10 @@ nsecs_t SurfaceTexture::getTimestamp() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SurfaceTexture::setFrameAvailableListener(
|
void SurfaceTexture::setFrameAvailableListener(
|
||||||
const sp<FrameAvailableListener>& l) {
|
const sp<FrameAvailableListener>& listener) {
|
||||||
LOGV("SurfaceTexture::setFrameAvailableListener");
|
LOGV("SurfaceTexture::setFrameAvailableListener");
|
||||||
Mutex::Autolock lock(mMutex);
|
Mutex::Autolock lock(mMutex);
|
||||||
mFrameAvailableListener = l;
|
mFrameAvailableListener = listener;
|
||||||
}
|
}
|
||||||
|
|
||||||
sp<IBinder> SurfaceTexture::getAllocator() {
|
sp<IBinder> SurfaceTexture::getAllocator() {
|
||||||
|
|
Loading…
Reference in New Issue