Skip to content

Fix build windows #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Oct 17, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ set(CMAKE_VERBOSE_MAKEFILE OFF)
if(NOT WIN32)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -fPIC -pg -g")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fPIC -O3")
else()
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
endif()


Expand Down
9 changes: 8 additions & 1 deletion app/avInfo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@ set_target_properties(avinfo PROPERTIES VERSION ${AVTRANSCODER_VERSION})
target_link_libraries(avinfo avtranscoder-shared)

# Install app
if(WIN32)
set(BINARY_FILES "${CMAKE_CURRENT_BINARY_DIR}/avinfo.exe")
else()
set(BINARY_FILES "${CMAKE_CURRENT_BINARY_DIR}/avinfo" "${CMAKE_CURRENT_BINARY_DIR}/avinfo-${AVTRANSCODER_VERSION}")
endif()

install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/avinfo" "${CMAKE_CURRENT_BINARY_DIR}/avinfo-${AVTRANSCODER_VERSION}"
FILES ${BINARY_FILES}
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE
DESTINATION "bin/"
)

install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/avinfo.man
RENAME "avinfo.1"
Expand Down
9 changes: 8 additions & 1 deletion app/avMeta/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@ set_target_properties(avmeta PROPERTIES VERSION ${AVTRANSCODER_VERSION})
target_link_libraries(avmeta avtranscoder-shared)

# Install app
if(WIN32)
set(BINARY_FILES "${CMAKE_CURRENT_BINARY_DIR}/avmeta.exe")
else()
set(BINARY_FILES "${CMAKE_CURRENT_BINARY_DIR}/avmeta" "${CMAKE_CURRENT_BINARY_DIR}/avmeta-${AVTRANSCODER_VERSION}")
endif()

install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/avmeta" "${CMAKE_CURRENT_BINARY_DIR}/avmeta-${AVTRANSCODER_VERSION}"
FILES ${BINARY_FILES}
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE
DESTINATION "bin/"
)

install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/avmeta.man
RENAME "avmeta.1"
Expand Down
9 changes: 8 additions & 1 deletion app/avTranscoder/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@ set_target_properties(avtranscoder PROPERTIES VERSION ${AVTRANSCODER_VERSION})
target_link_libraries(avtranscoder avtranscoder-shared)

# Install app
if(WIN32)
set(BINARY_FILES "${CMAKE_CURRENT_BINARY_DIR}/avtranscoder.exe")
else()
set(BINARY_FILES "${CMAKE_CURRENT_BINARY_DIR}/avtranscoder" "${CMAKE_CURRENT_BINARY_DIR}/avtranscoder-${AVTRANSCODER_VERSION}")
endif()

install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/avtranscoder" "${CMAKE_CURRENT_BINARY_DIR}/avtranscoder-${AVTRANSCODER_VERSION}"
FILES ${BINARY_FILES}
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE
DESTINATION "bin/"
)

install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/av++.man
RENAME av++.1
Expand Down
20 changes: 16 additions & 4 deletions app/avplay/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,38 @@ endif()

# Check GLUT
find_package(GLUT)
if(NOT GLUT_FOUND)

if(NOT GLUT_Xi_LIBRARY OR NOT GLUT_Xmu_LIBRARY)
set(GLUT_FOUND FALSE)
endif()

if(NOT GLUT_FOUND)
message("GLUT not found, will not build avplay app.")
return()
endif()

# Build app
include_directories(${AVTRANSCODER_SRC_PATH} ${FFMPEG_INCLUDE_DIR})
include_directories( ${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS} )
include_directories( ${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIR} )

file(GLOB AVPLAY_SRC_FILES "*.cpp" "*.hpp")
add_executable(avplay ${AVPLAY_SRC_FILES})
set_target_properties(avplay PROPERTIES VERSION ${AVTRANSCODER_VERSION})
target_link_libraries(avplay avtranscoder-shared ${OPENGL_LIBRARIES} ${GLUT_LIBRARY})
target_link_libraries(avplay avtranscoder-shared ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES})

# Install app
if(WIN32)
set(BINARY_FILES "${CMAKE_CURRENT_BINARY_DIR}/avplay.exe")
else()
set(BINARY_FILES "${CMAKE_CURRENT_BINARY_DIR}/avplay" "${CMAKE_CURRENT_BINARY_DIR}/avplay-${AVTRANSCODER_VERSION}")
endif()

install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/avplay" "${CMAKE_CURRENT_BINARY_DIR}/avplay-${AVTRANSCODER_VERSION}"
FILES ${BINARY_FILES}
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE
DESTINATION "bin/"
)

install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/avplayer.man
RENAME avplayer.1
Expand Down
9 changes: 8 additions & 1 deletion app/genericProcessor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@ set_target_properties(avprocessor PROPERTIES VERSION ${AVTRANSCODER_VERSION})
target_link_libraries(avprocessor avtranscoder-shared)

# Install app
if(WIN32)
set(BINARY_FILES "${CMAKE_CURRENT_BINARY_DIR}/avprocessor.exe")
else()
set(BINARY_FILES "${CMAKE_CURRENT_BINARY_DIR}/avprocessor" "${CMAKE_CURRENT_BINARY_DIR}/avprocessor-${AVTRANSCODER_VERSION}")
endif()

install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/avprocessor" "${CMAKE_CURRENT_BINARY_DIR}/avprocessor-${AVTRANSCODER_VERSION}"
FILES ${BINARY_FILES}
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE
DESTINATION "bin/"
)

install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/avprocessor.man
RENAME avprocessor.1
Expand Down
16 changes: 14 additions & 2 deletions app/optionChecker/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,26 @@ include(AvTranscoderMacros)
# Build app
include_directories(${AVTRANSCODER_SRC_PATH} ${FFMPEG_INCLUDE_DIR})
# Add C++11 flag
set(CMAKE_CXX_FLAGS "-std=c++0x")
if(NOT WIN32)
set(CMAKE_CXX_FLAGS "-std=c++0x")
elseif(NOT MSVC12)
message("C++11 not supported, will not build avOptionChecker app.")
return()
endif()

add_executable(avoptionchecker optionChecker.cpp)
set_target_properties(avoptionchecker PROPERTIES VERSION ${AVTRANSCODER_VERSION})
target_link_libraries(avoptionchecker avtranscoder-shared)

# Install app
if(WIN32)
set(BINARY_FILES "${CMAKE_CURRENT_BINARY_DIR}/avoptionchecker.exe")
else()
set(BINARY_FILES "${CMAKE_CURRENT_BINARY_DIR}/avoptionchecker" "${CMAKE_CURRENT_BINARY_DIR}/avoptionchecker-${AVTRANSCODER_VERSION}")
endif()

install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/avoptionchecker" "${CMAKE_CURRENT_BINARY_DIR}/avoptionchecker-${AVTRANSCODER_VERSION}"
FILES ${BINARY_FILES}
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE
DESTINATION "bin/"
)
17 changes: 15 additions & 2 deletions app/presetChecker/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,30 @@ include(AvTranscoderMacros)
# Build app
include_directories(${AVTRANSCODER_SRC_PATH} ${FFMPEG_INCLUDE_DIR})
# Add C++11 flag
set(CMAKE_CXX_FLAGS "-std=c++0x")
if(NOT WIN32)
set(CMAKE_CXX_FLAGS "-std=c++0x")
elseif(NOT MSVC12)
message("C++11 not supported, will not build avPresetChecker app.")
return()
endif()

add_executable(avpresetchecker presetChecker.cpp)
set_target_properties(avpresetchecker PROPERTIES VERSION ${AVTRANSCODER_VERSION})
target_link_libraries(avpresetchecker avtranscoder-shared)

# Install app
if(WIN32)
set(BINARY_FILES "${CMAKE_CURRENT_BINARY_DIR}/avpresetchecker.exe")
else()
set(BINARY_FILES "${CMAKE_CURRENT_BINARY_DIR}/avpresetchecker" "${CMAKE_CURRENT_BINARY_DIR}/avpresetchecker-${AVTRANSCODER_VERSION}")
endif()

install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/avpresetchecker" "${CMAKE_CURRENT_BINARY_DIR}/avpresetchecker-${AVTRANSCODER_VERSION}"
FILES ${BINARY_FILES}
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE
DESTINATION "bin/"
)

install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/avprofiles.man
RENAME avprofiles.1
Expand Down
4 changes: 2 additions & 2 deletions app/presetChecker/presetChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ int main( int argc, char** argv )
std::cout << std::setw(35) << key.first << key.second << std::endl;

try{
if( profile.find( avtranscoder::Profile::avProfileType )->second == avtranscoder::Profile::avProfileTypeVideo )
if( profile.find( avtranscoder::constants::avProfileType )->second == avtranscoder::constants::avProfileTypeVideo )
{
avtranscoder::AvOutputVideo outputVideo;
outputVideo.setProfile( profile, outputVideo.getVideoCodec().getVideoFrameDesc() );
}

if( profile.find( avtranscoder::Profile::avProfileType )->second == avtranscoder::Profile::avProfileTypeAudio )
if( profile.find( avtranscoder::constants::avProfileType )->second == avtranscoder::constants::avProfileTypeAudio )
{
avtranscoder::AvOutputAudio outputAudio;
outputAudio.setProfile( profile, outputAudio.getAudioCodec().getFrameDesc() );
Expand Down
8 changes: 4 additions & 4 deletions src/AvTranscoder/Library.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace avtranscoder
{

class Library
class AvExport Library
{
public:
Library( const std::string& name, const std::string& license, const size_t major, const size_t minor, const size_t release );
Expand All @@ -33,11 +33,11 @@ class Library

typedef std::vector< Library > Libraries;

Libraries getLibraries();
Libraries AvExport getLibraries();

std::vector<std::string> getInputExtensions();
std::vector<std::string> AvExport getInputExtensions();

std::vector<std::string> getOutputExtensions();
std::vector<std::string> AvExport getOutputExtensions();

}

Expand Down
38 changes: 11 additions & 27 deletions src/AvTranscoder/Profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,6 @@
namespace avtranscoder
{

const std::string Profile::avProfileIdentificator( "avProfile" );
const std::string Profile::avProfileIdentificatorHuman( "avProfileLong" );

const std::string Profile::avProfileType( "avProfileType" );
const std::string Profile::avProfileTypeFormat( "avProfileTypeFormat" );
const std::string Profile::avProfileTypeVideo( "avProfileTypeVideo" );
const std::string Profile::avProfileTypeAudio( "avProfileTypeAudio" );

const std::string Profile::avProfileFormat( "format" );
const std::string Profile::avProfileCodec( "codec" );
const std::string Profile::avProfilePixelFormat( "pix_fmt" );
const std::string Profile::avProfileSampleFormat( "sample_fmt" );
const std::string Profile::avProfileFrameRate( "r" );
const std::string Profile::avProfileSampleRate( "ar" );
const std::string Profile::avProfileChannel( "ac" );

Profile::Profile( bool autoload )
{
if( autoload )
Expand All @@ -55,11 +39,11 @@ void Profile::loadProfile( const std::string& avProfileFile )
}
// check if profile contains required values
if(
customProfile.count( avProfileIdentificator ) &&
customProfile.count( avProfileIdentificatorHuman ) &&
customProfile.count( avProfileType ) &&
( customProfile.find( avProfileType )->second == avProfileTypeVideo ||
customProfile.find( avProfileType )->second == avProfileTypeAudio )
customProfile.count( constants::avProfileIdentificator ) &&
customProfile.count( constants::avProfileIdentificatorHuman ) &&
customProfile.count( constants::avProfileType ) &&
( customProfile.find( constants::avProfileType )->second == constants::avProfileTypeVideo ||
customProfile.find( constants::avProfileType )->second == constants::avProfileTypeAudio )
)
{
_profiles.push_back( customProfile );
Expand Down Expand Up @@ -101,11 +85,11 @@ void Profile::loadProfiles( const std::string& avProfilesPath )

void Profile::update( const ProfileDesc& profile )
{
std::string profileId( profile.find( avProfileIdentificator )->second );
std::string profileId( profile.find( constants::avProfileIdentificator )->second );
size_t profileIndex = 0;
for( ProfilesDesc::iterator it = _profiles.begin(); it != _profiles.end(); ++it )
{
if( (*it).find( avProfileIdentificator )->second == profileId )
if( (*it).find( constants::avProfileIdentificator )->second == profileId )
{
_profiles.at( profileIndex ) = profile;
return;
Expand All @@ -127,7 +111,7 @@ Profile::ProfilesDesc Profile::getFormatProfiles()

for( ProfilesDesc::iterator it = _profiles.begin(); it != _profiles.end(); ++it )
{
if( (*it).find( avProfileType )->second == avProfileTypeFormat )
if( (*it).find( constants::avProfileType )->second == constants::avProfileTypeFormat )
profiles.push_back( *it );
}

Expand All @@ -140,7 +124,7 @@ Profile::ProfilesDesc Profile::getVideoProfiles()

for( ProfilesDesc::iterator it = _profiles.begin(); it != _profiles.end(); ++it )
{
if( (*it).find( avProfileType )->second == avProfileTypeVideo )
if( (*it).find( constants::avProfileType )->second == constants::avProfileTypeVideo )
profiles.push_back( *it );
}

Expand All @@ -153,7 +137,7 @@ Profile::ProfilesDesc Profile::getAudioProfiles()

for( ProfilesDesc::iterator it = _profiles.begin(); it != _profiles.end(); ++it )
{
if( (*it).find( avProfileType )->second == avProfileTypeAudio )
if( (*it).find( constants::avProfileType )->second == constants::avProfileTypeAudio )
profiles.push_back( *it );
}

Expand All @@ -164,7 +148,7 @@ Profile::ProfileDesc& Profile::getProfile( const std::string& searchProfile )
{
for( ProfilesDesc::iterator it = _profiles.begin(); it != _profiles.end(); ++it )
{
if( (*it).find( avProfileIdentificator )->second == searchProfile )
if( (*it).find( constants::avProfileIdentificator )->second == searchProfile )
{
return (*it);
}
Expand Down
34 changes: 20 additions & 14 deletions src/AvTranscoder/Profile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,27 @@
namespace avtranscoder
{

namespace constants
{
const std::string avProfileIdentificator = "avProfile";
const std::string avProfileIdentificatorHuman = "avProfileLong";
const std::string avProfileType = "avProfileType";
const std::string avProfileTypeFormat = "avProfileTypeFormat";
const std::string avProfileTypeVideo = "avProfileTypeVideo";
const std::string avProfileTypeAudio = "avProfileTypeAudio";
const std::string avProfileFormat = "format";
const std::string avProfileCodec = "codec";
const std::string avProfilePixelFormat = "pix_fmt";
const std::string avProfileSampleFormat = "sample_fmt";
const std::string avProfileFrameRate = "r";
const std::string avProfileSampleRate = "ar";
const std::string avProfileChannel = "ac";
}

class AvExport Profile
{
public:
static const std::string avProfileIdentificator;
static const std::string avProfileIdentificatorHuman;
static const std::string avProfileType;

static const std::string avProfileTypeFormat;
static const std::string avProfileTypeVideo;
static const std::string avProfileTypeAudio;

static const std::string avProfileFormat;
static const std::string avProfileCodec;
static const std::string avProfilePixelFormat;
static const std::string avProfileSampleFormat;
static const std::string avProfileFrameRate;
static const std::string avProfileSampleRate;
static const std::string avProfileChannel;

public:
// typedef std::pair< std::string, std::string > KeyDesc;
Expand All @@ -53,7 +56,10 @@ class AvExport Profile

private:
ProfilesDesc _profiles;

};



}
#endif
Loading