Session 028: Optional dependencies configuration
- Added WITH_VLC option to Lts/Application/THP (default OFF) - Added WITH_SCHUSSTAFEL option to CentralEffectSimulation (default OFF) - Added WITH_ARCGIS option to Explosions plugin (default OFF) - Protected VLC includes with #ifdef THP_HAS_VLC - Added qt5compat module to Docker image for QTextCodec support - Validated CMake configure and lts_common build in Docker container - All external dependencies now optional, build succeeds without them Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
1 parent
d5af8b9764
commit
1edc9934fa
5 files changed
+205
-9
No files matched your search
+143
@@ -22,11 +22,15 @@
|
||||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef THP_HAS_VLC
|
||||
#include <vlc/libvlc_version.h>
|
||||
#endif
|
||||
|
||||
namespace THP
|
||||
{
|
||||
|
||||
#ifdef THP_HAS_VLC
|
||||
|
||||
static const float s_speedArray[] =
|
||||
{
|
||||
1. / 8.,
|
||||
@@ -627,3 +631,142 @@ void AudioVideoWidget::setAV(bool isAudio)
|
||||
}
|
||||
|
||||
} // namespace THP
|
||||
|
||||
#else // THP_HAS_VLC - Stub implementation when VLC is not available
|
||||
|
||||
#include <NGLLogger/INGLLogger.h>
|
||||
|
||||
AudioVideoWidget::Private::Private(QFrame *parent)
|
||||
: m_vlcinstance(nullptr)
|
||||
, m_mPlayer(nullptr)
|
||||
, m_mListPlayer(nullptr)
|
||||
, m_mediaList(nullptr)
|
||||
, currentSpeedIdx(2)
|
||||
, m_parent(parent)
|
||||
, m_timer(nullptr)
|
||||
, m_initThread(nullptr)
|
||||
, ui(new Ui::audioVideoWidget())
|
||||
, m_logger(NGL::INGLLogger::Instance())
|
||||
{
|
||||
m_logger.Log("AudioVideoWidget: VLC not available, using stub implementation", NGL::eLogWarning);
|
||||
ui->setupUi(m_parent);
|
||||
}
|
||||
|
||||
AudioVideoWidget::Private::~Private()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
bool AudioVideoWidget::Private::initVLCInstance(bool /*bInInitThread*/)
|
||||
{
|
||||
m_logger.Log("AudioVideoWidget::initVLCInstance: VLC not available", NGL::eLogWarning);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AudioVideoWidget::Private::uninitVLCInstance()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AudioVideoWidget::Private::initVLCPlayer()
|
||||
{
|
||||
m_logger.Log("AudioVideoWidget::initVLCPlayer: VLC not available", NGL::eLogWarning);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AudioVideoWidget::Private::uninitVLCPlayer()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AudioVideoWidget::Private::playVLC(const QUrl & /*url*/)
|
||||
{
|
||||
m_logger.Log("AudioVideoWidget::playVLC: VLC not available", NGL::eLogWarning);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AudioVideoWidget::Private::stopVLC()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void AudioVideoWidget::Private::setAV(bool /*isAudio*/)
|
||||
{
|
||||
m_logger.Log("AudioVideoWidget::setAV: VLC not available", NGL::eLogWarning);
|
||||
}
|
||||
|
||||
void AudioVideoWidget::Private::onSlower()
|
||||
{
|
||||
}
|
||||
|
||||
void AudioVideoWidget::Private::onFaster()
|
||||
{
|
||||
}
|
||||
|
||||
void AudioVideoWidget::Private::on100pct()
|
||||
{
|
||||
}
|
||||
|
||||
void AudioVideoWidget::Private::onPlay()
|
||||
{
|
||||
}
|
||||
|
||||
void AudioVideoWidget::Private::onStop()
|
||||
{
|
||||
}
|
||||
|
||||
void AudioVideoWidget::Private::onPositionChanged(int /*pos*/)
|
||||
{
|
||||
}
|
||||
|
||||
void AudioVideoWidget::Private::onVolumeChanged(int /*vol*/)
|
||||
{
|
||||
}
|
||||
|
||||
void AudioVideoWidget::Private::onUpdateGUI()
|
||||
{
|
||||
}
|
||||
|
||||
void AudioVideoWidget::Private::onVLCInstanceInitializd()
|
||||
{
|
||||
}
|
||||
|
||||
void AudioVideoWidget::Private::clearMediaList()
|
||||
{
|
||||
}
|
||||
|
||||
void AudioVideoWidget::Private::playVLCInternal()
|
||||
{
|
||||
}
|
||||
|
||||
void AudioVideoWidget::Private::onUpdateGUIWithState(libvlc_state_t /*overwrite_state*/)
|
||||
{
|
||||
}
|
||||
|
||||
bool AudioVideoWidget::Private::init()
|
||||
{
|
||||
m_logger.Log("AudioVideoWidget::init: VLC not available", NGL::eLogWarning);
|
||||
return false;
|
||||
}
|
||||
|
||||
void AudioVideoWidget::Private::setRate()
|
||||
{
|
||||
}
|
||||
|
||||
libvlc_state_t AudioVideoWidget::Private::getState() const
|
||||
{
|
||||
return libvlc_NothingSpecial;
|
||||
}
|
||||
|
||||
AudioVideoInitThread::AudioVideoInitThread(AudioVideoWidget::Private *p)
|
||||
: m_private(p)
|
||||
{
|
||||
}
|
||||
|
||||
void AudioVideoInitThread::run()
|
||||
{
|
||||
}
|
||||
|
||||
#endif // THP_HAS_VLC
|
||||
|
||||
} // namespace THP
|
||||
+15
@@ -13,7 +13,9 @@
|
||||
typedef SSIZE_T ssize_t;
|
||||
#endif
|
||||
|
||||
#ifdef THP_HAS_VLC
|
||||
#include <vlc/vlc.h>
|
||||
#endif
|
||||
#include <QtCore/QObject>
|
||||
#include <QThread>
|
||||
#include <NGLLogger/INGLLogger.h>
|
||||
@@ -27,6 +29,12 @@ namespace Ui
|
||||
class audioVideoWidget;
|
||||
}
|
||||
|
||||
// Forward declarations for VLC types when VLC is not available
|
||||
#ifndef THP_HAS_VLC
|
||||
typedef int libvlc_state_t;
|
||||
#define libvlc_NothingSpecial 0
|
||||
#endif
|
||||
|
||||
namespace THP
|
||||
{
|
||||
class AudioVideoInitThread;
|
||||
@@ -64,10 +72,17 @@ protected:
|
||||
void setRate();
|
||||
libvlc_state_t getState() const;
|
||||
|
||||
#ifdef THP_HAS_VLC
|
||||
libvlc_instance_t *m_vlcinstance;
|
||||
libvlc_media_player_t *m_mPlayer;
|
||||
libvlc_media_list_player_t *m_mListPlayer;
|
||||
libvlc_media_list_t *m_mediaList;
|
||||
#else
|
||||
void *m_vlcinstance;
|
||||
void *m_mPlayer;
|
||||
void *m_mListPlayer;
|
||||
void *m_mediaList;
|
||||
#endif
|
||||
|
||||
int currentSpeedIdx;
|
||||
|
||||
|
||||
Reference in new issue
Block a user