Skip to content

Commit 0d9e4fa

Browse files
committed
Merge pull request #107 from valnoel/build_windows
Build windows
2 parents 5ebabd0 + 0912cff commit 0d9e4fa

File tree

16 files changed

+60
-32
lines changed

16 files changed

+60
-32
lines changed

CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@ add_definitions(-DAVTRANSCODER_VERSION_MICRO=${AVTRANSCODER_VERSION_MICRO})
1717
set(CMAKE_VERBOSE_MAKEFILE OFF)
1818

1919
# CPP flags on debug / release mode
20-
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -fPIC -pg -g")
21-
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fPIC -O3")
20+
if(NOT WIN32)
21+
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -fPIC -pg -g")
22+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fPIC -O3")
23+
endif()
24+
2225

2326
add_subdirectory(src)
2427
add_subdirectory(app)

app/avInfo/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
55
include(AvTranscoderMacros)
66

77
# Build app
8-
include_directories(${AVTRANSCODER_SRC_PATH})
8+
include_directories(${AVTRANSCODER_SRC_PATH} ${FFMPEG_INCLUDE_DIR})
99
add_executable(avinfo avInfo.cpp)
1010
set_target_properties(avinfo PROPERTIES VERSION ${AVTRANSCODER_VERSION})
1111
target_link_libraries(avinfo avtranscoder-shared)

cmake/FindFFmpeg.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ endmacro()
7979
# Get FFmpeg from custom install
8080
if(FFMPEG_LIBRARY_DIR AND FFMPEG_INCLUDE_DIR)
8181
set(FFMPEG_FOUND TRUE)
82-
file(GLOB FFMPEG_LIBRARIES "${FFMPEG_LIBRARY_DIR}/*.so")
82+
if(WIN32)
83+
file(GLOB FFMPEG_LIBRARIES "${FFMPEG_LIBRARY_DIR}/*.lib")
84+
else()
85+
file(GLOB FFMPEG_LIBRARIES "${FFMPEG_LIBRARY_DIR}/*.so")
86+
endif()
8387
# Get FFmpeg from system install
8488
else()
8589
# Check FFmpeg version

src/AvTranscoder/Profile.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef _AV_TRANSCODER_PROFILE_HPP_
22
#define _AV_TRANSCODER_PROFILE_HPP_
33

4+
#include "common.hpp"
5+
46
#include <string>
57
#include <cstring>
68
#include <vector>
@@ -9,7 +11,7 @@
911
namespace avtranscoder
1012
{
1113

12-
class Profile
14+
class AvExport Profile
1315
{
1416
public:
1517
static const std::string avProfileIdentificator;

src/AvTranscoder/avTranscoder.i

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
%include "std_pair.i"
88
%include "std_map.i"
99

10-
1110
%include "AvTranscoder/swig/avException.i"
1211
%include "AvTranscoder/swig/avExport.i"
1312

@@ -50,11 +49,28 @@
5049

5150
#include <AvTranscoder/transcoder/StreamTranscoder.hpp>
5251
#include <AvTranscoder/transcoder/Transcoder.hpp>
53-
%}
5452

55-
%include "AvTranscoder/progress/progress.i"
53+
/* initialize static const members for binding */
54+
namespace avtranscoder {
55+
const std::string Profile::avProfileIdentificator = "avProfile";
56+
const std::string Profile::avProfileIdentificatorHuman = "avProfileLong";
57+
58+
const std::string Profile::avProfileType = "avProfileType";
59+
const std::string Profile::avProfileTypeFormat = "avProfileTypeFormat";
60+
const std::string Profile::avProfileTypeVideo = "avProfileTypeVideo";
61+
const std::string Profile::avProfileTypeAudio = "avProfileTypeAudio";
62+
63+
const std::string Profile::avProfileFormat = "format";
64+
const std::string Profile::avProfileCodec = "codec";
65+
const std::string Profile::avProfilePixelFormat = "pix_fmt";
66+
const std::string Profile::avProfileSampleFormat = "sample_fmt";
67+
const std::string Profile::avProfileFrameRate = "r";
68+
const std::string Profile::avProfileSampleRate = "ar";
69+
const std::string Profile::avProfileChannel = "ac";
70+
}
71+
%}
5672

57-
namespace std {
73+
namespace std {
5874
%template(IntPair) pair< size_t, size_t >;
5975
%template(VideoVector) vector< avtranscoder::VideoProperties >;
6076
%template(AudioVector) vector< avtranscoder::AudioProperties >;
@@ -69,6 +85,8 @@ namespace std {
6985

7086
%include <AvTranscoder/common.hpp>
7187

88+
%include "AvTranscoder/progress/progress.i"
89+
7290
%include <AvTranscoder/Profile.hpp>
7391

7492
%include <AvTranscoder/essenceStructures/Pixel.hpp>

src/AvTranscoder/common.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct Ratio
6464
size_t den;
6565
};
6666

67-
class ParamSet
67+
class AvExport ParamSet
6868
{
6969
public:
7070
ParamSet( void* obj )
@@ -82,11 +82,11 @@ class ParamSet
8282
void* _objContext;
8383
};
8484

85-
void split( std::vector< std::string >& splitedString, const std::string& inputString, const std::string& splitChars = ";" );
86-
int getFilesInDir( const std::string& dir, std::vector< std::string >& files );
85+
void AvExport split( std::vector< std::string >& splitedString, const std::string& inputString, const std::string& splitChars = ";" );
86+
int AvExport getFilesInDir( const std::string& dir, std::vector< std::string >& files );
8787

88-
std::string getFormat( const std::string& filename );
89-
bool matchFormat( const std::string& format, const std::string& filename );
88+
std::string AvExport getFormat( const std::string& filename );
89+
bool AvExport matchFormat( const std::string& format, const std::string& filename );
9090

9191
}
9292

src/AvTranscoder/essenceStream/AvOutputAudio.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace avtranscoder
1313
{
1414

15-
class AvOutputAudio : public IOutputEssence
15+
class AvExport AvOutputAudio : public IOutputEssence
1616
{
1717
public:
1818
AvOutputAudio();

src/AvTranscoder/essenceStructures/Pixel.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ enum ESubsamplingType
3131
eSubsampling420 // 4:2:0
3232
};
3333

34-
class Pixel
34+
class AvExport Pixel
3535
{
3636
public:
3737
Pixel()

src/AvTranscoder/mediaProperty/mediaProperty.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ namespace detail
2020
/**
2121
* @brief Fill metadata parameter with the given AVDictionary.
2222
*/
23-
void fillMetadataDictionnary( AVDictionary* avdictionnary, MetadatasMap& metadata );
23+
void AvExport fillMetadataDictionnary( AVDictionary* avdictionnary, MetadatasMap& metadata );
2424
}
2525

26-
struct Channel
26+
struct AvExport Channel
2727
{
2828
size_t id;
2929
size_t chromaHeight;
3030
size_t bitStep;
3131
};
3232

33-
struct VideoProperties
33+
struct AvExport VideoProperties
3434
{
3535
std::string codecName;
3636
std::string codecLongName;
@@ -91,7 +91,7 @@ struct VideoProperties
9191
MetadatasMap getDataMap() const;
9292
};
9393

94-
struct AudioProperties
94+
struct AvExport AudioProperties
9595
{
9696
std::string codecName;
9797
std::string codecLongName;
@@ -111,7 +111,7 @@ struct AudioProperties
111111
MetadatasMap getDataMap() const;
112112
};
113113

114-
struct DataProperties
114+
struct AvExport DataProperties
115115
{
116116
size_t streamId;
117117
MetadatasMap metadatas;
@@ -120,7 +120,7 @@ struct DataProperties
120120
MetadatasMap getDataMap() const;
121121
};
122122

123-
struct SubtitleProperties
123+
struct AvExport SubtitleProperties
124124
{
125125
size_t streamId;
126126
MetadatasMap metadatas;
@@ -129,7 +129,7 @@ struct SubtitleProperties
129129
MetadatasMap getDataMap() const;
130130
};
131131

132-
struct AttachementProperties
132+
struct AvExport AttachementProperties
133133
{
134134
size_t streamId;
135135
MetadatasMap metadatas;
@@ -138,7 +138,7 @@ struct AttachementProperties
138138
MetadatasMap getDataMap() const;
139139
};
140140

141-
struct UnknownProperties
141+
struct AvExport UnknownProperties
142142
{
143143
size_t streamId;
144144
MetadatasMap metadatas;
@@ -147,7 +147,7 @@ struct UnknownProperties
147147
MetadatasMap getDataMap() const;
148148
};
149149

150-
struct Properties
150+
struct AvExport Properties
151151
{
152152
std::string filename;
153153
std::string formatName;

src/AvTranscoder/progress/ConsoleProgress.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace avtranscoder
99
/**
1010
* @brief Implementation of IProgress, to display a progress bar in console.
1111
*/
12-
class ConsoleProgress : public IProgress
12+
class AvExport ConsoleProgress : public IProgress
1313
{
1414
public:
1515
~ConsoleProgress();

src/AvTranscoder/progress/IProgress.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ enum EJobStatus
2222
* Inherit this class to have your own way to manage a progress bar.
2323
* You can inherit this class in C++, but also in python / Java binding.
2424
*/
25-
class IProgress
25+
class AvExport IProgress
2626
{
2727
public:
2828
virtual ~IProgress() {};

src/AvTranscoder/progress/NoDisplayProgress.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace avtranscoder
99
/**
1010
* @brief Implementation of IProgress, to manage cases when we need an IProgress but don't care of a progress bar.
1111
*/
12-
class NoDisplayProgress : public IProgress
12+
class AvExport NoDisplayProgress : public IProgress
1313
{
1414
public:
1515
~NoDisplayProgress()

src/AvTranscoder/transcoder/StreamTranscoder.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace avtranscoder
1717

1818
class IEssenceTransform;
1919

20-
class StreamTranscoder
20+
class AvExport StreamTranscoder
2121
{
2222
public:
2323
/**

src/AvTranscoder/transcoder/Transcoder.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include <limits>
44
#include <iostream>
5+
#include <algorithm>
56

67
namespace avtranscoder
78
{

src/AvTranscoder/transcoder/Transcoder.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ enum EProcessMethod
3838
eProcessMethodInfinity,
3939
};
4040

41-
class Transcoder
41+
class AvExport Transcoder
4242
{
4343
public:
4444

src/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ if(SWIG_FOUND)
7171

7272
# Create 'avtranscoder-py' shared lib
7373
swig_add_module(avtranscoder-py python ${AVTRANSCODER_BINDING_FILE})
74-
if(NOT APPLE)
74+
if(NOT APPLE AND NOT WIN32)
7575
set_target_properties(${SWIG_MODULE_avtranscoder-py_REAL_NAME} PROPERTIES SOVERSION ${AVTRANSCODER_VERSION_MAJOR})
7676
set_target_properties(${SWIG_MODULE_avtranscoder-py_REAL_NAME} PROPERTIES VERSION ${AVTRANSCODER_VERSION})
7777
endif()
@@ -101,7 +101,7 @@ if(SWIG_FOUND)
101101

102102
# Create 'avtranscoder-java' shared lib
103103
swig_add_module(avtranscoder-java java ${AVTRANSCODER_BINDING_FILE})
104-
if(NOT APPLE)
104+
if(NOT APPLE AND NOT WIN32)
105105
set_target_properties(${SWIG_MODULE_avtranscoder-java_REAL_NAME} PROPERTIES SOVERSION ${AVTRANSCODER_VERSION_MAJOR})
106106
set_target_properties(${SWIG_MODULE_avtranscoder-java_REAL_NAME} PROPERTIES VERSION ${AVTRANSCODER_VERSION})
107107
endif()

0 commit comments

Comments
 (0)