Commit fb3e521d authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

File rendering is working again.

parent 0a2f501d
......@@ -24,12 +24,12 @@
#include "SettingsManager.h"
WorkflowFileRenderer::WorkflowFileRenderer( const QString& outputFileName ) :
WorkflowRenderer(),
m_outputFileName( outputFileName )
{
m_dialog = new WorkflowFileRendererDialog;
m_dialog->setModal( true );
m_dialog->setOutputFileName( outputFileName );
m_mediaPlayer = new LibVLCpp::MediaPlayer;
connect( m_dialog->m_ui.cancelButton, SIGNAL( clicked() ), this, SLOT( cancelButtonClicked() ) );
}
......@@ -44,23 +44,18 @@ void WorkflowFileRenderer::run()
m_outputFps = SettingsManager::getInstance()->getValue( "VLMC", "VLMCOutPutFPS" )->get().toDouble();
//Media as already been created an mainly initialized by the WorkflowRenderer
m_media->addOption( ":no-audio" );
m_media->addOption( "no-sout-audio" );
m_media->addOption( ":fake" );
//sprintf(buffer, ":fake-fps=%i", FPS );
//m_media->addOption( buffer );
m_media->addOption( ":no-sout-audio" );
QString transcodeStr = ":sout=#transcode{vcodec=mp4v,vb=800,acodec=mpga,ab=128,no-hurry-up}"
":standard{access=file,mux=ps,dst=\""
+ m_outputFileName + "\"}";
m_media->addOption( transcodeStr.toStdString().c_str() );
sprintf( buffer, ":sout-transcode-fps=%f", m_outputFps );
m_media->addOption( buffer );
// sprintf( buffer, ":sout-transcode-fps=%f", m_outputFps );
// m_media->addOption( buffer );
m_mediaPlayer->setMedia( m_media );
connect( m_mainWorkflow, SIGNAL( mainWorkflowEndReached() ), this, SLOT( stop() ) );
connect( m_mainWorkflow, SIGNAL( positionChanged( float ) ), this, SLOT( positionChanged( float ) ) );
m_dialog->show();
......@@ -87,3 +82,8 @@ float WorkflowFileRenderer::getFps() const
{
return m_outputFps;
}
void WorkflowFileRenderer::__frameChanged( qint64 frame, MainWorkflow::FrameChangedReason reason )
{
m_dialog->setProgressBarValue( frame * 100 / m_mainWorkflow->getLengthFrame() );
}
......@@ -49,6 +49,7 @@ private:
private slots:
void stop();
void cancelButtonClicked();
void __frameChanged( qint64 frame, MainWorkflow::FrameChangedReason reason );
};
#endif // WORKFLOWFILERENDERER_H
......@@ -134,15 +134,16 @@ void WorkflowRenderer::startPreview()
//Media player part: to update PreviewWidget
connect( m_mediaPlayer, SIGNAL( playing() ), this, SLOT( __videoPlaying() ), Qt::DirectConnection );
connect( m_mediaPlayer, SIGNAL( paused() ), this, SLOT( __videoPaused() ), Qt::DirectConnection );
//FIXME:: check if this doesn't require Qt::QueuedConnection
connect( m_mediaPlayer, SIGNAL( stopped() ), this, SLOT( __videoStopped() ) );
m_mainWorkflow->setFullSpeedRender( false );
m_mainWorkflow->startRender();
m_mediaPlayer->play();
m_isRendering = true;
m_paused = false;
m_stopping = false;
m_outputFps = SettingsManager::getInstance()->getValue( "VLMC", "VLMCOutPutFPS" )->get().toDouble();
m_mediaPlayer->play();
}
void WorkflowRenderer::nextFrame()
......
......@@ -85,7 +85,7 @@ class WorkflowRenderer : public GenericRenderer
void rulerCursorChanged( qint64 newFrame );
void previewWidgetCursorChanged( qint64 newFrame );
void __frameChanged( qint64 frame, MainWorkflow::FrameChangedReason );
virtual void __frameChanged( qint64 frame, MainWorkflow::FrameChangedReason );
void __videoPaused();
void __videoStopped();
void __videoPlaying();
......
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