/frameworks/native/libs/gui/BufferQueue.cpp
if (mConnectedApi != NO_CONNECTED_API) {
659 ST_LOGE("connect: already connected (cur=%d, req=%d)",
660 mConnectedApi, api);
661 return -EINVAL;
662 }
surface.java
/**
* Release the local reference to the server-side surface.
* Always call release() when you're done with a Surface.
* This will make the surface invalid.
*/
public void release() {
synchronized (mLock) {
if (mNativeObject != 0) {
nativeRelease(mNativeObject);
setNativeObjectLocked(0);
}
}
}
if (mConnectedApi != NO_CONNECTED_API) {
659 ST_LOGE("connect: already connected (cur=%d, req=%d)",
660 mConnectedApi, api);
661 return -EINVAL;
662 }
surface.java
/**
* Release the local reference to the server-side surface.
* Always call release() when you're done with a Surface.
* This will make the surface invalid.
*/
public void release() {
synchronized (mLock) {
if (mNativeObject != 0) {
nativeRelease(mNativeObject);
setNativeObjectLocked(0);
}
}
}
Surface连接与释放机制
本文探讨了Surface在连接过程中的状态检查机制,特别是在已连接状态下尝试再次连接时的错误处理逻辑。此外,还介绍了Surface对象的释放方法,强调了在使用完毕后释放资源的重要性。

被折叠的 条评论
为什么被折叠?



