Commit 12607d9f authored by Christophe Courtaut's avatar Christophe Courtaut

Switching from vmem to smem rendering!

parent 519ced8a
......@@ -47,14 +47,14 @@ void Media::addOption( const char* opt )
void Media::setLockCallback( Media::lockCallback callback )
{
char param[64];
sprintf( param, ":vmem-lock=%lld", (qint64)(intptr_t)callback );
sprintf( param, ":sout-smem-video-prerender-callback=%lld", (qint64)(intptr_t)callback );
addOption(param);
}
void Media::setUnlockCallback( Media::unlockCallback callback )
{
char param[64];
sprintf( param, ":vmem-unlock=%lld", (qint64)(intptr_t)callback );
sprintf( param, ":sout-smem-video-postrender-callback=%lld", (qint64)(intptr_t)callback );
addOption( param );
}
......@@ -62,7 +62,7 @@ void Media::setDataCtx( void* dataCtx )
{
char param[64];
sprintf( param, ":vmem-data=%lld", (qint64)(intptr_t)dataCtx );
sprintf( param, ":sout-smem-video-data=%lld", (qint64)(intptr_t)dataCtx );
addOption( param );
}
......
......@@ -79,14 +79,20 @@ void ClipWorkflow::checkStateChange()
}
}
void ClipWorkflow::lock( ClipWorkflow* cw, void** pp_ret )
void ClipWorkflow::lock( ClipWorkflow* cw, void** pp_ret, int size )
{
Q_UNUSED( size );
cw->m_renderLock->lock();
*pp_ret = cw->m_buffer;
}
void ClipWorkflow::unlock( ClipWorkflow* cw )
void ClipWorkflow::unlock( ClipWorkflow* cw, void* buffer, int width, int height, int bpp, int size )
{
Q_UNUSED( buffer );
Q_UNUSED( width );
Q_UNUSED( height );
Q_UNUSED( bpp );
Q_UNUSED( size );
cw->m_renderLock->unlock();
cw->m_stateLock->lockForWrite();
......@@ -118,20 +124,21 @@ void ClipWorkflow::setVmem()
char buffer[32];
m_vlcMedia->addOption( ":no-audio" );
m_vlcMedia->addOption( ":vout=vmem" );
m_vlcMedia->addOption( ":sout=#transcode{}:smem" );
m_vlcMedia->setDataCtx( this );
m_vlcMedia->setLockCallback( reinterpret_cast<LibVLCpp::Media::lockCallback>( &ClipWorkflow::lock ) );
m_vlcMedia->setUnlockCallback( reinterpret_cast<LibVLCpp::Media::unlockCallback>( &ClipWorkflow::unlock ) );
m_vlcMedia->addOption( ":vmem-chroma=RV24" );
m_vlcMedia->addOption( ":sout-transcode-vcodec=RV24" );
m_vlcMedia->addOption( ":sout-transcode-acodec=s16l" );
sprintf( buffer, ":vmem-width=%i", VIDEOWIDTH );
sprintf( buffer, ":sout-transcode-width=%i", VIDEOWIDTH );
m_vlcMedia->addOption( buffer );
sprintf( buffer, ":vmem-height=%i", VIDEOHEIGHT );
sprintf( buffer, ":sout-transcode-height=%i", VIDEOHEIGHT );
m_vlcMedia->addOption( buffer );
sprintf( buffer, "vmem-pitch=%i", VIDEOWIDTH * 3 );
m_vlcMedia->addOption( buffer );
//sprintf( buffer, "sout-smem-video-pitch=%i", VIDEOWIDTH * 3 );
//m_vlcMedia->addOption( buffer );
}
void ClipWorkflow::initialize()
......
......@@ -156,8 +156,8 @@ class ClipWorkflow : public QObject
LibVLCpp::MediaPlayer* getMediaPlayer();
private:
static void lock( ClipWorkflow* clipWorkflow, void** pp_ret );
static void unlock( ClipWorkflow* clipWorkflow );
static void lock( ClipWorkflow* clipWorkflow, void** pp_ret, int size );
static void unlock( ClipWorkflow* clipWorkflow, void* buffer, int width, int height, int bpp, int size );
void setVmem();
void setState( State state );
void checkSynchronisation( State newState );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment