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

Using forward declaration in VLCException.h and VLCMediaPlayer.h

This avoid rebuilding half vlmc whenever vlc is updated.
parent 1691efc5
......@@ -141,7 +141,7 @@ public:
* \brief Ugly hack to change the old track number of an item.
* \deprecated Do not use, will be removed soon.
*/
bool setItemOldTrack( const QUuid& uuid, uint32_t oldTrackNumber );
bool setItemOldTrack( const QUuid& uuid, quint32 oldTrackNumber );
public slots:
/**
......
......@@ -21,6 +21,7 @@
*****************************************************************************/
#include <QtDebug>
#include "vlc/vlc.h"
#include "VLCException.h"
using namespace LibVLCpp;
......
......@@ -23,8 +23,8 @@
#ifndef VLCEXCEPTION_H
#define VLCEXCEPTION_H
#include "vlc/vlc.h"
#include "VLCpp.hpp"
struct libvlc_exception_t;
#define CheckVlcppException(ex) (ex.checkThrow(__FILE__, __LINE__, __func__))
......
......@@ -24,6 +24,7 @@
#include <cassert>
#include "VLCMediaPlayer.h"
#include "VLCInstance.h"
#include "VLCMedia.h"
using namespace LibVLCpp;
......
......@@ -23,17 +23,19 @@
#ifndef VLCMEDIAPLAYER_H
#define VLCMEDIAPLAYER_H
#include "vlc/vlc.h"
#include <QMutex>
#include <QObject>
#include "VLCpp.hpp"
#include "VLCMedia.h"
struct libvlc_media_player_t;
struct libvlc_event_t;
struct libvlc_event_manager_t;
#include "VLCException.h"
namespace LibVLCpp
{
class Media;
class MediaPlayer : public QObject, public Internal< libvlc_media_player_t >
{
Q_OBJECT
......@@ -53,7 +55,7 @@ namespace LibVLCpp
bool isPlaying();
bool isSeekable();
void setDrawable( void* hwnd );
void setDrawable( uint32_t drawable );
void setDrawable( quint32 drawable );
void setMedia(Media* media);
int getWidth();
int getHeight();
......
......@@ -42,7 +42,7 @@ public:
qCritical() << "Pool is empty !!";
return new T;
}
uint8_t* ptr = m_pool.dequeue();
quint8* ptr = m_pool.dequeue();
T* ret = new (ptr) T;
return ret;
}
......@@ -50,25 +50,25 @@ public:
{
QMutexLocker lock( m_mutex );
toRelease->~T();
m_pool.enqueue( reinterpret_cast<uint8_t*>( toRelease ) );
m_pool.enqueue( reinterpret_cast<quint8*>( toRelease ) );
}
private:
MemoryPool()
{
for ( size_t i = 0; i < NB_ELEM; ++i )
m_pool.enqueue( new uint8_t[ sizeof(T) ] );
m_pool.enqueue( new quint8[ sizeof(T) ] );
m_mutex = new QMutex;
}
~MemoryPool()
{
while ( m_pool.size() != 0 )
{
uint8_t* ptr = m_pool.dequeue();
quint8* ptr = m_pool.dequeue();
delete ptr;
}
delete m_mutex;
}
QQueue<uint8_t*> m_pool;
QQueue<quint8*> m_pool;
QMutex* m_mutex;
friend class Singleton< MemoryPool<T> >;
};
......
......@@ -23,6 +23,7 @@
#include <QtDebug>
#include "AudioClipWorkflow.h"
#include "VLCMedia.h"
AudioClipWorkflow::AudioClipWorkflow( Clip* clip ) :
ClipWorkflow( clip )
......@@ -98,7 +99,7 @@ AudioClipWorkflow::AudioSample* AudioClipWorkflow::createBuffer( size_t size
return as;
}
void AudioClipWorkflow::lock( AudioClipWorkflow* cw, uint8_t** pcm_buffer , unsigned int size )
void AudioClipWorkflow::lock( AudioClipWorkflow* cw, quint8** pcm_buffer , unsigned int size )
{
QMutexLocker lock( cw->m_availableBuffersMutex );
cw->m_renderLock->lock();
......@@ -120,7 +121,7 @@ void AudioClipWorkflow::lock( AudioClipWorkflow* cw, uint8_t** pcm_buffer
*pcm_buffer = as->buff;
}
void AudioClipWorkflow::unlock( AudioClipWorkflow* cw, uint8_t* pcm_buffer,
void AudioClipWorkflow::unlock( AudioClipWorkflow* cw, quint8* pcm_buffer,
unsigned int channels, unsigned int rate,
unsigned int nb_samples, unsigned int bits_per_sample,
unsigned int size, qint64 pts )
......@@ -143,12 +144,14 @@ void AudioClipWorkflow::unlock( AudioClipWorkflow* cw, uint8_t* pcm_buffe
cw->m_computedBuffersMutex->unlock();
}
uint32_t AudioClipWorkflow::getNbComputedBuffers() const
quint32
AudioClipWorkflow::getNbComputedBuffers() const
{
return m_computedBuffers.count();
}
uint32_t AudioClipWorkflow::getMaxComputedBuffers() const
quint32
AudioClipWorkflow::getMaxComputedBuffers() const
{
return AudioClipWorkflow::nbBuffers;
}
......
......@@ -40,7 +40,7 @@ class AudioClipWorkflow : public ClipWorkflow
unsigned int nbSample;
unsigned int nbChannels;
qint64 ptsDiff;
uint32_t debugId;
quint32 debugId;
};
class StackedBuffer : public ::StackedBuffer<AudioSample*>
{
......@@ -59,8 +59,8 @@ class AudioClipWorkflow : public ClipWorkflow
virtual void *getOutput( ClipWorkflow::GetMode mode );
protected:
virtual uint32_t getNbComputedBuffers() const;
virtual uint32_t getMaxComputedBuffers() const;
virtual quint32 getNbComputedBuffers() const;
virtual quint32 getMaxComputedBuffers() const;
void flushComputedBuffers();
private:
......@@ -72,15 +72,15 @@ class AudioClipWorkflow : public ClipWorkflow
void initVlcOutput();
AudioSample* createBuffer( size_t size );
static void lock( AudioClipWorkflow* clipWorkflow,
uint8_t** pcm_buffer , unsigned int size );
quint8** pcm_buffer , unsigned int size );
static void unlock( AudioClipWorkflow* clipWorkflow,
uint8_t* pcm_buffer, unsigned int channels,
quint8* pcm_buffer, unsigned int channels,
unsigned int rate, unsigned int nb_samples,
unsigned int bits_per_sample,
unsigned int size, qint64 pts );
//FIXME: this is totally random powered ! Please adjust with a value that does make sense...
static const uint32_t nbBuffers = 256;
static const quint32 nbBuffers = 256;
};
#endif // AUDIOCLIPWORKFLOW_H
......@@ -171,8 +171,8 @@ class ClipWorkflow : public QObject
* This thread safe context has to be set
* from the underlying ClipWorkflow implementation.
*/
virtual uint32_t getNbComputedBuffers() const = 0;
virtual uint32_t getMaxComputedBuffers() const = 0;
virtual quint32 getNbComputedBuffers() const = 0;
virtual quint32 getMaxComputedBuffers() const = 0;
/**
* \brief Will empty the computed buffers stack.
* This has to be implemented in the underlying
......
......@@ -44,8 +44,8 @@ class ImageClipWorkflow : public ClipWorkflow
virtual void *getOutput( ClipWorkflow::GetMode mode );
protected:
virtual void initVlcOutput();
virtual uint32_t getNbComputedBuffers() const;
virtual uint32_t getMaxComputedBuffers() const;
virtual quint32 getNbComputedBuffers() const;
virtual quint32 getMaxComputedBuffers() const;
virtual void flushComputedBuffers();
private:
static void lock( ImageClipWorkflow* clipWorkflow, void** pp_ret,
......
......@@ -313,7 +313,7 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow>
* \return The width (in pixels) of the currently rendered frames
* \sa getHeight()
*/
uint32_t getWidth() const;
quint32 getWidth() const;
/**
* \brief Get the height used for rendering.
*
......@@ -323,7 +323,7 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow>
* \return The height (in pixels) of the currently rendered frames
* \sa getWidth()
*/
uint32_t getHeight() const;
quint32 getHeight() const;
/**
* \brief Will render one frame only
......@@ -375,9 +375,9 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow>
/// Effect engine instance.
EffectsEngine* m_effectEngine;
/// Width used for the render
uint32_t m_width;
quint32 m_width;
/// Height used the render
uint32_t m_height;
quint32 m_height;
/// Pre-filled buffer used when there's nothing to render
static LightVideoFrame* blackOutput;
......
......@@ -52,12 +52,12 @@ class VideoClipWorkflow : public ClipWorkflow
void *getUnlockCallback() const;
virtual void *getOutput( ClipWorkflow::GetMode mode );
static const uint32_t nbBuffers = 3 * 30; //3 seconds with an average fps of 30
static const quint32 nbBuffers = 3 * 30; //3 seconds with an average fps of 30
protected:
virtual void initVlcOutput();
virtual uint32_t getNbComputedBuffers() const;
virtual uint32_t getMaxComputedBuffers() const;
virtual quint32 getNbComputedBuffers() const;
virtual quint32 getMaxComputedBuffers() const;
void releaseBuffer( LightVideoFrame* lvf );
void flushComputedBuffers();
......
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