Android: correctly use mutex for texture rendering.
Some sections were not protected by the mutex, even though they should have been. An example of problem that could happen because of this was if the SurfaceTexture was reset while the render thread was rendering that texture. Change-Id: Ie95860fd4eb722bbac04cccc430cc1a8abf1df4d Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
This commit is contained in:
@@ -218,6 +218,8 @@ bool QAndroidTextureVideoOutput::initSurfaceTexture()
|
||||
return false;
|
||||
}
|
||||
|
||||
QMutexLocker locker(&m_mutex);
|
||||
|
||||
m_surfaceTexture = new AndroidSurfaceTexture(m_externalTex);
|
||||
|
||||
if (m_surfaceTexture->surfaceTexture() != 0) {
|
||||
@@ -235,6 +237,7 @@ bool QAndroidTextureVideoOutput::initSurfaceTexture()
|
||||
|
||||
void QAndroidTextureVideoOutput::clearSurfaceTexture()
|
||||
{
|
||||
QMutexLocker locker(&m_mutex);
|
||||
if (m_surfaceTexture) {
|
||||
delete m_surfaceTexture;
|
||||
m_surfaceTexture = 0;
|
||||
|
||||
Reference in New Issue
Block a user