Commit 29ba995e authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

ImageClipWorkflow doesn't have to inherit VideoClipWorkflow

This was a bad idea, as a VideoClipWorkflow preallocate 90 image
buffers...
parent c1d0c09e
......@@ -23,9 +23,10 @@
#include "ImageClipWorkflow.h"
#include "Clip.h"
#include "LightVideoFrame.h"
#include "MainWorkflow.h"
ImageClipWorkflow::ImageClipWorkflow( Clip *clip ) :
VideoClipWorkflow( clip ),
ClipWorkflow( clip ),
m_buffer( NULL ),
m_stackedBuffer( NULL )
{
......@@ -40,11 +41,28 @@ ImageClipWorkflow::initVlcOutput()
{
char buffer[32];
m_vlcMedia->addOption( ":no-audio" );
m_vlcMedia->addOption( ":no-sout-audio" );
m_vlcMedia->addOption( ":sout=#transcode{}:smem" );
m_vlcMedia->setVideoDataCtx( this );
m_vlcMedia->setVideoLockCallback( reinterpret_cast<void*>( getLockCallback() ) );
m_vlcMedia->setVideoUnlockCallback( reinterpret_cast<void*>( getUnlockCallback() ) );
m_vlcMedia->addOption( ":sout-transcode-vcodec=RV24" );
m_vlcMedia->addOption( ":sout-transcode-acodec=s16l" );
m_vlcMedia->addOption( ":sout-smem-time-sync" );
sprintf( buffer, ":sout-transcode-width=%i",
MainWorkflow::getInstance()->getWidth() );
m_vlcMedia->addOption( buffer );
sprintf( buffer, ":sout-transcode-height=%i",
MainWorkflow::getInstance()->getHeight() );
m_vlcMedia->addOption( buffer );
sprintf( buffer, ":sout-transcode-fps=%f", (float)Clip::DefaultFPS );
m_vlcMedia->addOption( buffer );
sprintf( buffer, ":fake-duration=%d", 1000 );
m_vlcMedia->addOption( buffer );
sprintf( buffer, ":fake-fps=%f", m_clip->getParent()->getFps() );
m_vlcMedia->addOption( buffer );
VideoClipWorkflow::initVlcOutput();
}
void*
......@@ -108,6 +126,11 @@ ImageClipWorkflow::stopComputation()
m_mediaPlayer->stop();
}
void
ImageClipWorkflow::flushComputedBuffers()
{
}
ImageClipWorkflow::StackedBuffer::StackedBuffer( LightVideoFrame *lvf ) :
::StackedBuffer<LightVideoFrame*>( lvf, false )
{
......
......@@ -23,9 +23,10 @@
#ifndef IMAGECLIPWORKFLOW_H
#define IMAGECLIPWORKFLOW_H
#include "VideoClipWorkflow.h"
#include "ClipWorkflow.h"
#include "StackedBuffer.hpp"
class ImageClipWorkflow : public VideoClipWorkflow
class ImageClipWorkflow : public ClipWorkflow
{
Q_OBJECT
......@@ -35,8 +36,6 @@ class ImageClipWorkflow : public VideoClipWorkflow
public:
StackedBuffer( LightVideoFrame* lvf );
virtual void release();
private:
QPointer<VideoClipWorkflow> m_poolHandler;
};
ImageClipWorkflow( Clip* clip );
......@@ -47,6 +46,7 @@ class ImageClipWorkflow : public VideoClipWorkflow
virtual void initVlcOutput();
virtual uint32_t getNbComputedBuffers() const;
virtual uint32_t getMaxComputedBuffers() const;
virtual void flushComputedBuffers();
private:
static void lock( ImageClipWorkflow* clipWorkflow, void** pp_ret,
int size );
......
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