...
 
Commits (7)
......@@ -55,7 +55,7 @@ SET(PROJECT_VERSION ${CPACK_PACKAGE_VERSION})
MESSAGE(STATUS "VLMC Version: ${PROJECT_VERSION}")
STRING(TOLOWER ${PROJECT_NAME_SHORT} PROJECT_NAME_SHORT_LOWER)
PROJECT(${PROJECT_NAME_SHORT_LOWER}-${PROJECT_VERSION})
PROJECT("vlmc")
# Codename of the Project :-)
SET(CODENAME "alpha")
......@@ -232,6 +232,7 @@ SUBDIRS(ts)
SUBDIRS(src)
SUBDIRS(nsis)
SUBDIRS(effects)
subdirs(tests)
# Copy stuff to doc subdirectory
INSTALL (FILES AUTHORS COPYING INSTALL NEWS README THANKS TRANSLATORS
......
list(APPEND VLMC_SRCS
IBackend.h
IRenderer.h
ISource.h
VLC/VLCBackend.cpp
VLC/VLCRenderer.cpp
VLC/VLCSource.cpp
VLC/LibVLCpp/VLCInstance.cpp
VLC/LibVLCpp/VLCMedia.cpp
VLC/LibVLCpp/VLCMediaPlayer.cpp
VLC/LibVLCpp/VLCpp.hpp
)
project("vlmc")
set_property(GLOBAL PROPERTY BACKEND_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
subdirs(VLC)
project( "vlmc" )
include_directories(LibVLCpp)
add_definitions(-DQT_SHARED)
list(APPEND BACKEND_VLC_SRCS
EventWaiter.cpp
VLCBackend.cpp
VLCSourceRenderer.cpp
VLCVmemRenderer.cpp
VLCSource.cpp
VLCMemorySource.cpp
LibVLCpp/VLCInstance.cpp
LibVLCpp/VLCMedia.cpp
LibVLCpp/VLCMediaPlayer.cpp
LibVLCpp/VLCpp.hpp
)
add_library(backend_vlc SHARED ${BACKEND_VLC_SRCS} )
target_link_libraries(backend_vlc ${LIBVLC_LIBRARY} ${LIBVLCCORE_LIBRARY})
qt_use_modules(backend_vlc Core Gui)
......@@ -25,10 +25,13 @@
#include "VLCBackend.h"
#include "VLCSource.h"
#include "VLCMemorySource.h"
#include "Settings/SettingsManager.h"
#include "Tools/VlmcDebug.h"
#include "Tools/VlmcLogger.h"
#include "VlmcDebug.h"
#include "VlmcLogger.h"
using namespace Backend;
using namespace Backend::VLC;
......
......@@ -59,7 +59,7 @@ class VLCBackend : public IBackend, public Singleton<VLCBackend>
} //VLC
IBackend* getBackend();
Q_DECL_EXPORT IBackend* getBackend();
} //Backend
......
......@@ -4,21 +4,13 @@
# Ludovic Fauvet <etix@vlmc.org>
#
project("vlmc")
subdirs(Backend)
list(APPEND VLMC_LIBS backend_vlc)
SET(VLMC_SRCS
Commands/Commands.cpp
Backend/IBackend.h
Backend/ISourceRenderer.h
Backend/ISource.h
Backend/VLC/EventWaiter.cpp
Backend/VLC/VLCBackend.cpp
Backend/VLC/VLCSourceRenderer.cpp
Backend/VLC/VLCVmemRenderer.cpp
Backend/VLC/VLCSource.cpp
Backend/VLC/VLCMemorySource.cpp
Backend/VLC/LibVLCpp/VLCInstance.cpp
Backend/VLC/LibVLCpp/VLCMedia.cpp
Backend/VLC/LibVLCpp/VLCMediaPlayer.cpp
Backend/VLC/LibVLCpp/VLCpp.hpp
EffectsEngine/EffectsEngine.cpp
EffectsEngine/Effect.cpp
EffectsEngine/EffectUser.cpp
......@@ -233,7 +225,7 @@ ELSE(NOT WITH_GUI)
MACOSX_PACKAGE_LOCATION Resources)
SET(MACOSX_BUNDLE_ICON_FILE VLMC.icns)
LIST( APPEND VLMC_SRCS Gui/preview/RenderWidget.mm )
message(${FOUNDATION_FRAMEWORK})
list( APPEND VLMC_LIBS ${FOUNDATION_FRAMEWORK} ${APPKIT_FRAMEWORK} )
ELSE( APPLE )
## Since there's no implementation on non-apple platforms, we need to process
......@@ -241,7 +233,7 @@ message(${FOUNDATION_FRAMEWORK})
LIST( APPEND VLMC_SRCS Gui/preview/RenderWidget.h )
ENDIF( APPLE )
ADD_EXECUTABLE( vlmc ${GUI_TYPE} ${VLMC_SRCS} ${VLMC_MOC_SRCS} ${VLMC_UIS_H} ${VLMC_RCC_SRCS} )
ADD_EXECUTABLE( vlmc ${GUI_TYPE} ${VLMC_SRCS} ${VLMC_MOC_SRCS} ${VLMC_UIS_H} ${VLMC_RCC_SRCS})
TARGET_LINK_LIBRARIES( vlmc ${VLMC_LIBS} )
if (NOT Qt4_FOUND)
qt_use_modules(vlmc Core Gui Widgets Xml Network)
......
project("vlmc")
include(ExternalProject)
# Fetch gtest
ExternalProject_Add(
gtest-dependency
SVN_REPOSITORY http://googletest.googlecode.com/svn/trunk/
TIMEOUT 10
# Disable install step
INSTALL_COMMAND ""
# Wrap download, configure and build steps in a script to log output
LOG_DOWNLOAD ON
LOG_CONFIGURE ON
LOG_BUILD ON
)
# Add its includes to our path
ExternalProject_Get_Property(gtest-dependency source_dir)
include_directories(${source_dir}/include)
# Fetch our VLC backend module
get_property(BACKEND_INCLUDE_DIR GLOBAL PROPERTY BACKEND_INCLUDE_DIR)
# And add it to our include path
include_directories(${BACKEND_INCLUDE_DIR})
set(VLMC_TEST_SRCS
vlmc-test.cpp
VLCBackendTest.cpp )
# Also link with gtest:
# fetch the directory which contains the built libraries (gtest & gtest_main)
ExternalProject_Get_Property(gtest-dependency binary_dir)
link_directories(${binary_dir})
message(STATUS ${binary_dir})
add_executable(vlmc-test ${VLMC_TEST_SRCS})
add_dependencies(vlmc-test gtest-dependency)
# Add our backend & vlc to the link dependencies
target_link_libraries(vlmc-test backend_vlc)
target_link_libraries(vlmc-test gtest gtest_main)
# Also add pthread, as gtest requires it
if(UNIX)
target_link_libraries(vlmc-test "pthread")
endif()
# We also need Qt for some basic stuff
qt_use_modules(vlmc-test Core)
/*****************************************************************************
* VLCBackendTest.cpp: Test for VLC backend
*****************************************************************************
* Copyright (C) 2008-2014 VideoLAN
*
* Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "VLCBackendTest.h"
#include <QString>
TEST_P(VLCBackendTest, sourcePreparse)
{
std::string param = GetParam();
Backend::IBackend* backend = Backend::getBackend();
Backend::ISource* source = backend->createSource( param.c_str() );
bool res = source->preparse();
delete source;
delete backend;
}
/*****************************************************************************
* VLCBackendTest.h: Test for VLC backend
*****************************************************************************
* Copyright (C) 2008-2014 VideoLAN
*
* Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef VLCBACKENDTEST_H
#define VLCBACKENDTEST_H
#include "ISource.h"
#include "IBackend.h"
#include <gtest/gtest.h>
std::ostream& operator<<( std::ostream& os, const QString& str );
class VLCBackendTest : public ::testing::TestWithParam<std::string>
{
protected:
public:
static void SetUpTestCase()
{
}
static void TearDownTestCase()
{
}
};
#endif // VLCBACKENDTEST_H
/*****************************************************************************
* vlmc-test.cpp: Entry point for VLMC unit tests
*****************************************************************************
* Copyright (C) 2008-2014 VideoLAN
*
* Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <gtest/gtest.h>
#include <list>
#include <QDir>
#include <QProcessEnvironment>
#include <QString>
#include <QStack>
#include <QDebug>
#include "VLCBackendTest.h"
static std::list<std::string> GetSamples()
{
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
QString samplePath = env.value("VLMC_SAMPLES_PATH");
std::list<std::string> files;
if ( samplePath.isEmpty() )
{
qWarning() << "Invalid or no value for VLMC_SAMPLES_PATH environment variable";
return files;
}
qDebug() << "Using sample dir:" << samplePath;
QStack<QString> directories;
directories.push(samplePath);
while (directories.isEmpty() == false )
{
QString path = directories.pop();
QDir dir(path);
foreach (const QFileInfo fInfo, dir.entryInfoList( QDir::Dirs | QDir::Files | QDir::Readable | QDir::NoDotAndDotDot ) )
{
if ( fInfo.isDir() )
directories.push( fInfo.absoluteFilePath() );
else if ( fInfo.isFile() )
files.push_back( fInfo.absoluteFilePath().toStdString() );
}
}
return files;
}
INSTANTIATE_TEST_CASE_P(SampleBased, VLCBackendTest, ::testing::ValuesIn(GetSamples()));
int main(int argc, char **argv)
{
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}