Commit 1fe602ee authored by luyikei's avatar luyikei Committed by Hugo Beauzée-Luyssen

Remove AudioSample and OutputBuffer

Signed-off-by: 's avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent 5bf38ac5
......@@ -133,7 +133,7 @@ WorkflowRenderer::lockVideo( void* data, int64_t *pts, size_t *bufferSize, const
if ( m_stopping == true )
return 1;
ret = static_cast<const Workflow::Frame*>( m_mainWorkflow->getOutput( Workflow::VideoTrack, m_paused ) );
ret = m_mainWorkflow->getOutput( Workflow::VideoTrack, m_paused );
ptsDiff = ret->ptsDiff;
if ( ptsDiff == 0 )
{
......@@ -169,8 +169,7 @@ WorkflowRenderer::lockAudio( EsHandler *handler, int64_t *pts, size_t *bufferSiz
if ( m_stopping == false && m_paused == false )
{
renderAudioSample = static_cast<const Workflow::Frame*>( m_mainWorkflow->getOutput( Workflow::AudioTrack,
m_paused ) );
renderAudioSample = m_mainWorkflow->getOutput( Workflow::AudioTrack, m_paused );
}
else
renderAudioSample = nullptr;
......
......@@ -111,7 +111,7 @@ MainWorkflow::startRender( quint32 width, quint32 height )
computeLength();
}
const Workflow::OutputBuffer*
const Workflow::Frame*
MainWorkflow::getOutput( Workflow::TrackType trackType, bool paused )
{
if ( m_renderStarted == true )
......@@ -126,7 +126,7 @@ MainWorkflow::getOutput( Workflow::TrackType trackType, bool paused )
}
bool validTrack = false;
Workflow::OutputBuffer *ret = nullptr;
Workflow::Frame *ret = nullptr;
for ( int i = m_trackCount - 1; i >= 0; --i )
{
......
......@@ -79,7 +79,7 @@ class MainWorkflow : public QObject
* \param trackType The type of track you wish to get the render from.
* \param paused The paused state of the renderer
*/
const Workflow::OutputBuffer *getOutput( Workflow::TrackType trackType, bool paused );
const Workflow::Frame *getOutput( Workflow::TrackType trackType, bool paused );
/**
* \brief Set the workflow position by the desired frame
* \param currentFrame: The desired frame to render from
......
......@@ -162,7 +162,7 @@ TrackWorkflow::getClipHelper( const QUuid& uuid )
return nullptr;
}
Workflow::OutputBuffer*
Workflow::Frame*
TrackWorkflow::renderClip( Workflow::TrackType trackType, ClipWorkflow* cw, qint64 currentFrame,
qint64 start , bool needRepositioning,
bool renderOneFrame, bool paused )
......@@ -258,7 +258,7 @@ TrackWorkflow::stop()
m_isRendering = false;
}
Workflow::OutputBuffer*
Workflow::Frame*
TrackWorkflow::getOutput( Workflow::TrackType trackType, qint64 currentFrame, qint64 subFrame, bool paused )
{
QReadLocker lock( m_clipsLock );
......@@ -266,7 +266,7 @@ TrackWorkflow::getOutput( Workflow::TrackType trackType, qint64 currentFrame, qi
QMap<qint64, ClipWorkflow*>::iterator it = m_clips.begin();
QMap<qint64, ClipWorkflow*>::iterator end = m_clips.end();
bool needRepositioning;
Workflow::OutputBuffer *ret = nullptr;
Workflow::Frame *ret = nullptr;
Workflow::Frame *frames[EffectsEngine::MaxFramesForMixer];
quint32 frameId = 0;
bool renderOneFrame;
......@@ -308,7 +308,7 @@ TrackWorkflow::getOutput( Workflow::TrackType trackType, qint64 currentFrame, qi
renderOneFrame, paused );
if ( trackType == Workflow::VideoTrack )
{
frames[frameId] = static_cast<Workflow::Frame*>( ret );
frames[frameId] = ret;
++frameId;
}
}
......@@ -337,12 +337,12 @@ TrackWorkflow::getOutput( Workflow::TrackType trackType, qint64 currentFrame, qi
else //If there's no mixer, just use the first frame, ignore the rest. It will be cleaned by the responsible ClipWorkflow.
ret = frames[0];
//Now handle filters :
quint32 *newFrame = applyFilters( ret != nullptr ? static_cast<const Workflow::Frame*>( ret ) : Core::instance()->workflow()->blackOutput(),
quint32 *newFrame = applyFilters( ret != nullptr ? ret : Core::instance()->workflow()->blackOutput(),
currentFrame );
if ( newFrame != nullptr )
{
if ( ret != nullptr )
static_cast<Workflow::Frame*>( ret )->setBuffer( newFrame );
ret->setBuffer( newFrame );
else //Use the m_mixerBuffer as the frame to return. Ugly but avoid another attribute.
{
m_mixerBuffer->setBuffer( newFrame );
......
......@@ -52,7 +52,7 @@ class TrackWorkflow : public EffectUser
TrackWorkflow( quint32 trackId );
~TrackWorkflow();
Workflow::OutputBuffer *getOutput( Workflow::TrackType trackType, qint64 currentFrame,
Workflow::Frame *getOutput( Workflow::TrackType trackType, qint64 currentFrame,
qint64 subFrame, bool paused );
qint64 getLength() const;
void stop();
......@@ -102,7 +102,7 @@ class TrackWorkflow : public EffectUser
private:
void computeLength();
Workflow::OutputBuffer *renderClip( Workflow::TrackType trackType, ClipWorkflow* cw, qint64 currentFrame,
Workflow::Frame *renderClip( Workflow::TrackType trackType, ClipWorkflow* cw, qint64 currentFrame,
qint64 start, bool needRepositioning,
bool renderOneFrame, bool paused );
void preloadClip( ClipWorkflow* cw );
......
......@@ -27,7 +27,6 @@ using namespace Workflow;
#include <cstring> //memcpy
Frame::Frame() :
OutputBuffer( VideoTrack ),
ptsDiff( 0 ),
m_buffer( 0 ),
m_size( 0 ),
......@@ -36,7 +35,6 @@ Frame::Frame() :
}
Frame::Frame( quint32 width, quint32 height ) :
OutputBuffer( VideoTrack ),
ptsDiff( 0 ),
m_pts( 0 )
{
......@@ -45,7 +43,6 @@ Frame::Frame( quint32 width, quint32 height ) :
}
Frame::Frame( size_t forcedSize ) :
OutputBuffer( VideoTrack ),
ptsDiff( 0 ),
m_pts( 0 )
{
......
......@@ -40,14 +40,7 @@ namespace Workflow
NbTrackType, ///< Used to know how many types we have
};
struct OutputBuffer
{
TrackType type;
protected:
OutputBuffer( TrackType _type ) : type( _type ) {}
};
class Frame : public OutputBuffer
class Frame
{
public:
explicit Frame();
......@@ -95,22 +88,6 @@ namespace Workflow
quint32 m_nbPixels;
qint64 m_pts;
};
class AudioSample : public OutputBuffer
{
public:
AudioSample()
: OutputBuffer( AudioTrack )
, buff( nullptr )
, size( 0 )
{
}
unsigned char* buff;
size_t size;
quint32 nbSample;
quint32 nbChannels;
qint64 ptsDiff;
qint64 pts;
};
}
namespace Vlmc
......
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