Skip to content

Commit 9e8553e

Browse files
author
Clement Champetier
committed
Merge branch 'master' of https://github.com/avTranscoder/avTranscoder into dev_pyTest
Conflicts: src/AvTranscoder/transcoder/StreamTranscoder.cpp
2 parents ef16095 + a28347e commit 9e8553e

33 files changed

+247
-204
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ set(CMAKE_VERBOSE_MAKEFILE OFF)
2020
if(NOT WIN32)
2121
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -fPIC -pg -g")
2222
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fPIC -O3")
23+
else()
24+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
25+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
2326
endif()
2427

2528

app/avInfo/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,18 @@ set_target_properties(avinfo PROPERTIES VERSION ${AVTRANSCODER_VERSION})
1111
target_link_libraries(avinfo avtranscoder-shared)
1212

1313
# Install app
14+
if(WIN32)
15+
set(BINARY_FILES "${CMAKE_CURRENT_BINARY_DIR}/avinfo.exe")
16+
else()
17+
set(BINARY_FILES "${CMAKE_CURRENT_BINARY_DIR}/avinfo" "${CMAKE_CURRENT_BINARY_DIR}/avinfo-${AVTRANSCODER_VERSION}")
18+
endif()
19+
1420
install(
15-
FILES "${CMAKE_CURRENT_BINARY_DIR}/avinfo" "${CMAKE_CURRENT_BINARY_DIR}/avinfo-${AVTRANSCODER_VERSION}"
21+
FILES ${BINARY_FILES}
1622
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE
1723
DESTINATION "bin/"
1824
)
25+
1926
install(
2027
FILES ${CMAKE_CURRENT_SOURCE_DIR}/avinfo.man
2128
RENAME "avinfo.1"

app/avMeta/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,18 @@ set_target_properties(avmeta PROPERTIES VERSION ${AVTRANSCODER_VERSION})
1111
target_link_libraries(avmeta avtranscoder-shared)
1212

1313
# Install app
14+
if(WIN32)
15+
set(BINARY_FILES "${CMAKE_CURRENT_BINARY_DIR}/avmeta.exe")
16+
else()
17+
set(BINARY_FILES "${CMAKE_CURRENT_BINARY_DIR}/avmeta" "${CMAKE_CURRENT_BINARY_DIR}/avmeta-${AVTRANSCODER_VERSION}")
18+
endif()
19+
1420
install(
15-
FILES "${CMAKE_CURRENT_BINARY_DIR}/avmeta" "${CMAKE_CURRENT_BINARY_DIR}/avmeta-${AVTRANSCODER_VERSION}"
21+
FILES ${BINARY_FILES}
1622
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE
1723
DESTINATION "bin/"
1824
)
25+
1926
install(
2027
FILES ${CMAKE_CURRENT_SOURCE_DIR}/avmeta.man
2128
RENAME "avmeta.1"

app/avTranscoder/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,18 @@ set_target_properties(avtranscoder PROPERTIES VERSION ${AVTRANSCODER_VERSION})
1111
target_link_libraries(avtranscoder avtranscoder-shared)
1212

1313
# Install app
14+
if(WIN32)
15+
set(BINARY_FILES "${CMAKE_CURRENT_BINARY_DIR}/avtranscoder.exe")
16+
else()
17+
set(BINARY_FILES "${CMAKE_CURRENT_BINARY_DIR}/avtranscoder" "${CMAKE_CURRENT_BINARY_DIR}/avtranscoder-${AVTRANSCODER_VERSION}")
18+
endif()
19+
1420
install(
15-
FILES "${CMAKE_CURRENT_BINARY_DIR}/avtranscoder" "${CMAKE_CURRENT_BINARY_DIR}/avtranscoder-${AVTRANSCODER_VERSION}"
21+
FILES ${BINARY_FILES}
1622
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE
1723
DESTINATION "bin/"
1824
)
25+
1926
install(
2027
FILES ${CMAKE_CURRENT_SOURCE_DIR}/av++.man
2128
RENAME av++.1

app/avplay/CMakeLists.txt

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,38 @@ endif()
1313

1414
# Check GLUT
1515
find_package(GLUT)
16-
if(NOT GLUT_FOUND)
16+
17+
if(NOT GLUT_Xi_LIBRARY OR NOT GLUT_Xmu_LIBRARY)
18+
set(GLUT_FOUND FALSE)
19+
endif()
20+
21+
if(NOT GLUT_FOUND)
1722
message("GLUT not found, will not build avplay app.")
1823
return()
1924
endif()
2025

2126
# Build app
2227
include_directories(${AVTRANSCODER_SRC_PATH} ${FFMPEG_INCLUDE_DIR})
23-
include_directories( ${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS} )
28+
include_directories( ${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIR} )
2429

2530
file(GLOB AVPLAY_SRC_FILES "*.cpp" "*.hpp")
2631
add_executable(avplay ${AVPLAY_SRC_FILES})
2732
set_target_properties(avplay PROPERTIES VERSION ${AVTRANSCODER_VERSION})
28-
target_link_libraries(avplay avtranscoder-shared ${OPENGL_LIBRARIES} ${GLUT_LIBRARY})
33+
target_link_libraries(avplay avtranscoder-shared ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES})
2934

3035
# Install app
36+
if(WIN32)
37+
set(BINARY_FILES "${CMAKE_CURRENT_BINARY_DIR}/avplay.exe")
38+
else()
39+
set(BINARY_FILES "${CMAKE_CURRENT_BINARY_DIR}/avplay" "${CMAKE_CURRENT_BINARY_DIR}/avplay-${AVTRANSCODER_VERSION}")
40+
endif()
41+
3142
install(
32-
FILES "${CMAKE_CURRENT_BINARY_DIR}/avplay" "${CMAKE_CURRENT_BINARY_DIR}/avplay-${AVTRANSCODER_VERSION}"
43+
FILES ${BINARY_FILES}
3344
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE
3445
DESTINATION "bin/"
3546
)
47+
3648
install(
3749
FILES ${CMAKE_CURRENT_SOURCE_DIR}/avplayer.man
3850
RENAME avplayer.1

app/genericProcessor/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,18 @@ set_target_properties(avprocessor PROPERTIES VERSION ${AVTRANSCODER_VERSION})
1111
target_link_libraries(avprocessor avtranscoder-shared)
1212

1313
# Install app
14+
if(WIN32)
15+
set(BINARY_FILES "${CMAKE_CURRENT_BINARY_DIR}/avprocessor.exe")
16+
else()
17+
set(BINARY_FILES "${CMAKE_CURRENT_BINARY_DIR}/avprocessor" "${CMAKE_CURRENT_BINARY_DIR}/avprocessor-${AVTRANSCODER_VERSION}")
18+
endif()
19+
1420
install(
15-
FILES "${CMAKE_CURRENT_BINARY_DIR}/avprocessor" "${CMAKE_CURRENT_BINARY_DIR}/avprocessor-${AVTRANSCODER_VERSION}"
21+
FILES ${BINARY_FILES}
1622
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE
1723
DESTINATION "bin/"
1824
)
25+
1926
install(
2027
FILES ${CMAKE_CURRENT_SOURCE_DIR}/avprocessor.man
2128
RENAME avprocessor.1

app/optionChecker/CMakeLists.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,26 @@ include(AvTranscoderMacros)
77
# Build app
88
include_directories(${AVTRANSCODER_SRC_PATH} ${FFMPEG_INCLUDE_DIR})
99
# Add C++11 flag
10-
set(CMAKE_CXX_FLAGS "-std=c++0x")
10+
if(NOT WIN32)
11+
set(CMAKE_CXX_FLAGS "-std=c++0x")
12+
elseif(${MSVC_VERSION} LESS 1800)
13+
message("C++11 not supported, will not build avOptionChecker app.")
14+
return()
15+
endif()
16+
1117
add_executable(avoptionchecker optionChecker.cpp)
1218
set_target_properties(avoptionchecker PROPERTIES VERSION ${AVTRANSCODER_VERSION})
1319
target_link_libraries(avoptionchecker avtranscoder-shared)
1420

1521
# Install app
22+
if(WIN32)
23+
set(BINARY_FILES "${CMAKE_CURRENT_BINARY_DIR}/avoptionchecker.exe")
24+
else()
25+
set(BINARY_FILES "${CMAKE_CURRENT_BINARY_DIR}/avoptionchecker" "${CMAKE_CURRENT_BINARY_DIR}/avoptionchecker-${AVTRANSCODER_VERSION}")
26+
endif()
27+
1628
install(
17-
FILES "${CMAKE_CURRENT_BINARY_DIR}/avoptionchecker" "${CMAKE_CURRENT_BINARY_DIR}/avoptionchecker-${AVTRANSCODER_VERSION}"
29+
FILES ${BINARY_FILES}
1830
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE
1931
DESTINATION "bin/"
2032
)

app/presetChecker/CMakeLists.txt

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,30 @@ include(AvTranscoderMacros)
77
# Build app
88
include_directories(${AVTRANSCODER_SRC_PATH} ${FFMPEG_INCLUDE_DIR})
99
# Add C++11 flag
10-
set(CMAKE_CXX_FLAGS "-std=c++0x")
10+
if(NOT WIN32)
11+
set(CMAKE_CXX_FLAGS "-std=c++0x")
12+
elseif(${MSVC_VERSION} LESS 1800)
13+
message("C++11 not supported, will not build avPresetChecker app.")
14+
return()
15+
endif()
16+
1117
add_executable(avpresetchecker presetChecker.cpp)
1218
set_target_properties(avpresetchecker PROPERTIES VERSION ${AVTRANSCODER_VERSION})
1319
target_link_libraries(avpresetchecker avtranscoder-shared)
1420

1521
# Install app
22+
if(WIN32)
23+
set(BINARY_FILES "${CMAKE_CURRENT_BINARY_DIR}/avpresetchecker.exe")
24+
else()
25+
set(BINARY_FILES "${CMAKE_CURRENT_BINARY_DIR}/avpresetchecker" "${CMAKE_CURRENT_BINARY_DIR}/avpresetchecker-${AVTRANSCODER_VERSION}")
26+
endif()
27+
1628
install(
17-
FILES "${CMAKE_CURRENT_BINARY_DIR}/avpresetchecker" "${CMAKE_CURRENT_BINARY_DIR}/avpresetchecker-${AVTRANSCODER_VERSION}"
29+
FILES ${BINARY_FILES}
1830
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_READ WORLD_EXECUTE
1931
DESTINATION "bin/"
2032
)
33+
2134
install(
2235
FILES ${CMAKE_CURRENT_SOURCE_DIR}/avprofiles.man
2336
RENAME avprofiles.1

app/presetChecker/presetChecker.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ int main( int argc, char** argv )
2525
std::cout << std::setw(35) << key.first << key.second << std::endl;
2626

2727
try{
28-
if( profile.find( avtranscoder::Profile::avProfileType )->second == avtranscoder::Profile::avProfileTypeVideo )
28+
if( profile.find( avtranscoder::constants::avProfileType )->second == avtranscoder::constants::avProfileTypeVideo )
2929
{
3030
avtranscoder::AvOutputVideo outputVideo;
3131
outputVideo.setProfile( profile, outputVideo.getVideoCodec().getVideoFrameDesc() );
3232
}
3333

34-
if( profile.find( avtranscoder::Profile::avProfileType )->second == avtranscoder::Profile::avProfileTypeAudio )
34+
if( profile.find( avtranscoder::constants::avProfileType )->second == avtranscoder::constants::avProfileTypeAudio )
3535
{
3636
avtranscoder::AvOutputAudio outputAudio;
3737
outputAudio.setProfile( profile, outputAudio.getAudioCodec().getFrameDesc() );

src/AvTranscoder/Library.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace avtranscoder
1010
{
1111

12-
class Library
12+
class AvExport Library
1313
{
1414
public:
1515
Library( const std::string& name, const std::string& license, const size_t major, const size_t minor, const size_t release );
@@ -33,11 +33,11 @@ class Library
3333

3434
typedef std::vector< Library > Libraries;
3535

36-
Libraries getLibraries();
36+
Libraries AvExport getLibraries();
3737

38-
std::vector<std::string> getInputExtensions();
38+
std::vector<std::string> AvExport getInputExtensions();
3939

40-
std::vector<std::string> getOutputExtensions();
40+
std::vector<std::string> AvExport getOutputExtensions();
4141

4242
}
4343

src/AvTranscoder/Profile.cpp

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,6 @@
1616
namespace avtranscoder
1717
{
1818

19-
const std::string Profile::avProfileIdentificator( "avProfile" );
20-
const std::string Profile::avProfileIdentificatorHuman( "avProfileLong" );
21-
22-
const std::string Profile::avProfileType( "avProfileType" );
23-
const std::string Profile::avProfileTypeFormat( "avProfileTypeFormat" );
24-
const std::string Profile::avProfileTypeVideo( "avProfileTypeVideo" );
25-
const std::string Profile::avProfileTypeAudio( "avProfileTypeAudio" );
26-
27-
const std::string Profile::avProfileFormat( "format" );
28-
const std::string Profile::avProfileCodec( "codec" );
29-
const std::string Profile::avProfilePixelFormat( "pix_fmt" );
30-
const std::string Profile::avProfileSampleFormat( "sample_fmt" );
31-
const std::string Profile::avProfileFrameRate( "r" );
32-
const std::string Profile::avProfileSampleRate( "ar" );
33-
const std::string Profile::avProfileChannel( "ac" );
34-
3519
Profile::Profile( bool autoload )
3620
{
3721
if( autoload )
@@ -55,11 +39,11 @@ void Profile::loadProfile( const std::string& avProfileFile )
5539
}
5640
// check if profile contains required values
5741
if(
58-
customProfile.count( avProfileIdentificator ) &&
59-
customProfile.count( avProfileIdentificatorHuman ) &&
60-
customProfile.count( avProfileType ) &&
61-
( customProfile.find( avProfileType )->second == avProfileTypeVideo ||
62-
customProfile.find( avProfileType )->second == avProfileTypeAudio )
42+
customProfile.count( constants::avProfileIdentificator ) &&
43+
customProfile.count( constants::avProfileIdentificatorHuman ) &&
44+
customProfile.count( constants::avProfileType ) &&
45+
( customProfile.find( constants::avProfileType )->second == constants::avProfileTypeVideo ||
46+
customProfile.find( constants::avProfileType )->second == constants::avProfileTypeAudio )
6347
)
6448
{
6549
_profiles.push_back( customProfile );
@@ -101,11 +85,11 @@ void Profile::loadProfiles( const std::string& avProfilesPath )
10185

10286
void Profile::update( const ProfileDesc& profile )
10387
{
104-
std::string profileId( profile.find( avProfileIdentificator )->second );
88+
std::string profileId( profile.find( constants::avProfileIdentificator )->second );
10589
size_t profileIndex = 0;
10690
for( ProfilesDesc::iterator it = _profiles.begin(); it != _profiles.end(); ++it )
10791
{
108-
if( (*it).find( avProfileIdentificator )->second == profileId )
92+
if( (*it).find( constants::avProfileIdentificator )->second == profileId )
10993
{
11094
_profiles.at( profileIndex ) = profile;
11195
return;
@@ -127,7 +111,7 @@ Profile::ProfilesDesc Profile::getFormatProfiles()
127111

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

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

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

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

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

@@ -164,7 +148,7 @@ Profile::ProfileDesc& Profile::getProfile( const std::string& searchProfile )
164148
{
165149
for( ProfilesDesc::iterator it = _profiles.begin(); it != _profiles.end(); ++it )
166150
{
167-
if( (*it).find( avProfileIdentificator )->second == searchProfile )
151+
if( (*it).find( constants::avProfileIdentificator )->second == searchProfile )
168152
{
169153
return (*it);
170154
}

src/AvTranscoder/Profile.hpp

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,27 @@
1111
namespace avtranscoder
1212
{
1313

14+
namespace constants
15+
{
16+
const std::string avProfileIdentificator = "avProfile";
17+
const std::string avProfileIdentificatorHuman = "avProfileLong";
18+
const std::string avProfileType = "avProfileType";
19+
const std::string avProfileTypeFormat = "avProfileTypeFormat";
20+
const std::string avProfileTypeVideo = "avProfileTypeVideo";
21+
const std::string avProfileTypeAudio = "avProfileTypeAudio";
22+
const std::string avProfileFormat = "format";
23+
const std::string avProfileCodec = "codec";
24+
const std::string avProfilePixelFormat = "pix_fmt";
25+
const std::string avProfileSampleFormat = "sample_fmt";
26+
const std::string avProfileFrameRate = "r";
27+
const std::string avProfileSampleRate = "ar";
28+
const std::string avProfileChannel = "ac";
29+
}
30+
1431
class AvExport Profile
1532
{
1633
public:
17-
static const std::string avProfileIdentificator;
18-
static const std::string avProfileIdentificatorHuman;
19-
static const std::string avProfileType;
2034

21-
static const std::string avProfileTypeFormat;
22-
static const std::string avProfileTypeVideo;
23-
static const std::string avProfileTypeAudio;
24-
25-
static const std::string avProfileFormat;
26-
static const std::string avProfileCodec;
27-
static const std::string avProfilePixelFormat;
28-
static const std::string avProfileSampleFormat;
29-
static const std::string avProfileFrameRate;
30-
static const std::string avProfileSampleRate;
31-
static const std::string avProfileChannel;
3235

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

5457
private:
5558
ProfilesDesc _profiles;
59+
5660
};
5761

62+
63+
5864
}
5965
#endif

0 commit comments

Comments
 (0)