Ticket #9268: ogl-thrd.diff
File ogl-thrd.diff, 3.2 KB (added by , 13 years ago) |
---|
-
mythtv/libs/libmythui/mythrender_opengl.h
65 65 class MythGLTexture; 66 66 class MythGLShaderObject; 67 67 class MythRenderOpenGL; 68 class QThread; 68 69 69 70 class MPUBLIC OpenGLLocker 70 71 { … … 204 205 QVector<GLuint> m_programs; 205 206 QVector<GLuint> m_framebuffers; 206 207 GLuint m_fence; 208 QThread* const m_creator; 207 209 208 210 QMutex *m_lock; 209 211 int m_lock_level; -
mythtv/libs/libmythui/mythrender_opengl.cpp
1 #include <QThread> 1 2 #include "mythverbose.h" 2 3 #include "mythrender_opengl.h" 3 4 #include "mythxdisplay.h" … … 139 140 } 140 141 141 142 MythRenderOpenGL::MythRenderOpenGL(const QGLFormat& format, QPaintDevice* device) 142 : QGLContext(format, device) 143 : QGLContext(format, device), m_creator(QThread::currentThread()) 143 144 { 144 145 Reset(); 145 146 } 146 147 147 148 MythRenderOpenGL::MythRenderOpenGL(const QGLFormat& format) 148 : QGLContext(format) 149 : QGLContext(format), m_creator(QThread::currentThread()) 149 150 { 150 151 Reset(); 151 152 } … … 172 173 void MythRenderOpenGL::makeCurrent() 173 174 { 174 175 m_lock->lock(); 175 if (this != MythRenderOpenGL::currentContext()) 176 QGLContext::makeCurrent(); 176 if (this->m_creator == QThread::currentThread()) 177 { 178 if (this != MythRenderOpenGL::currentContext()) 179 QGLContext::makeCurrent(); 180 } 181 else 182 { 183 VERBOSE(VB_IMPORTANT, LOC_ERR + 184 QString("Wrong thread '%1' calls makeCurrent()") 185 .arg(QThread::currentThread()->objectName())); 186 } 177 187 m_lock_level++; 178 188 } 179 189 -
mythtv/libs/libmythtv/mythplayer.h
100 100 101 101 public: 102 102 DecoderThread(MythPlayer *mp, bool start_paused) 103 : QThread(NULL), m_mp(mp), m_start_paused(start_paused) { } 103 : QThread(NULL), m_mp(mp), m_start_paused(start_paused) 104 { setObjectName("DecoderThread"); } 104 105 105 106 protected: 106 107 virtual void run(void); -
mythtv/libs/libmythtv/mythplayer.cpp
812 812 813 813 if (interlaced) 814 814 { 815 if (QThread::currentThread() != this->playerThread) 816 return; 817 815 818 m_deint_possible = videoOutput->SetDeinterlacingEnabled(true); 816 819 if (!m_deint_possible) 817 820 { … … 837 840 { 838 841 if (kScan_Progressive == scan) 839 842 { 843 if (QThread::currentThread() != this->playerThread) 844 return; 845 840 846 m_double_process = false; 841 847 m_double_framerate = false; 842 848 videoOutput->SetDeinterlacingEnabled(false);