
Originally Posted by
kroenecker
So, out of curiosity, if I wanted to make an application that streams video content in QT3, how do I start? (ie what classes would be appropriate etc)
Nothing easier, here is an example of my QVideo plugin for 32 bit rgb frames:
/** No descriptions */
void QVideo::showRGB32(unsigned int *buff){
int buffSize = width()*height()*sizeof(unsigned int);
if(!m_image32)
m_image32
= new QImage(width
(),height
(),
32);
if(m_image32->width() != width() || m_image32->height() != height())
{
delete m_image32;
m_image32
= new QImage(width
(),height
(),
32);
}
memcpy(m_image32->bits(),buff,buffSize);
if(!m_image32->isNull())
bitBlt(this,0,0,m_image32);
// m_lastImage = m_image32; //<--this is not thread safe
}
/** No descriptions */
void QVideo::showRGB32(unsigned int *buff){
int buffSize = width()*height()*sizeof(unsigned int);
if(!m_image32)
m_image32 = new QImage(width(),height(),32);
if(m_image32->width() != width() || m_image32->height() != height())
{
delete m_image32;
m_image32 = new QImage(width(),height(),32);
}
memcpy(m_image32->bits(),buff,buffSize);
if(!m_image32->isNull())
bitBlt(this,0,0,m_image32);
// m_lastImage = m_image32; //<--this is not thread safe
}
To copy to clipboard, switch view to plain text mode
Bookmarks