equal
deleted
inserted
replaced
659 nbFramesDisplayed++; |
659 nbFramesDisplayed++; |
660 #endif |
660 #endif |
661 |
661 |
662 |
662 |
663 #ifndef QT_NO_OPENGL |
663 #ifndef QT_NO_OPENGL |
664 if (painter.paintEngine() && painter.paintEngine()->type() == QPaintEngine::OpenGL && checkGLPrograms()) { |
664 if (painter.paintEngine() && |
|
665 (painter.paintEngine()->type() == QPaintEngine::OpenGL || painter.paintEngine()->type() == QPaintEngine::OpenGL2) |
|
666 && checkGLPrograms()) { |
|
667 |
665 //for now we only support YUV (both YV12 and YUY2) |
668 //for now we only support YUV (both YV12 and YUY2) |
666 updateTexture(); |
669 updateTexture(); |
667 |
670 |
668 if (!m_textureUploaded) { |
671 if (!m_textureUploaded) { |
669 //we simply fill the whole video with content |
672 //we simply fill the whole video with content |
671 painter.drawRect(r); |
674 painter.drawRect(r); |
672 return; |
675 return; |
673 } |
676 } |
674 |
677 |
675 //let's draw the texture |
678 //let's draw the texture |
|
679 painter.beginNativePainting(); |
676 |
680 |
677 //Let's pass the other arguments |
681 //Let's pass the other arguments |
678 const Program prog = (m_inputPin->connectedType().subtype == MEDIASUBTYPE_YV12) ? YV12toRGB : YUY2toRGB; |
682 const Program prog = (m_inputPin->connectedType().subtype == MEDIASUBTYPE_YV12) ? YV12toRGB : YUY2toRGB; |
679 glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, m_program[prog]); |
683 glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, m_program[prog]); |
680 //loading the parameters |
684 //loading the parameters |
720 glDrawArrays(GL_QUADS, 0, 4); |
724 glDrawArrays(GL_QUADS, 0, 4); |
721 glDisableClientState(GL_TEXTURE_COORD_ARRAY); |
725 glDisableClientState(GL_TEXTURE_COORD_ARRAY); |
722 glDisableClientState(GL_VERTEX_ARRAY); |
726 glDisableClientState(GL_VERTEX_ARRAY); |
723 |
727 |
724 glDisable(GL_FRAGMENT_PROGRAM_ARB); |
728 glDisable(GL_FRAGMENT_PROGRAM_ARB); |
|
729 painter.endNativePainting(); |
725 return; |
730 return; |
726 } else |
731 } else |
727 #endif |
732 #endif |
728 if (m_sampleBuffer) { |
733 if (m_sampleBuffer) { |
729 //we need to get the sample data |
734 //we need to get the sample data |