Skip to content

Commit

Permalink
Import of v1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
j0r1 committed Dec 14, 2016
1 parent 5286ac1 commit e0f1030
Show file tree
Hide file tree
Showing 117 changed files with 246 additions and 166 deletions.
46 changes: 38 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 2.6)

project(emiplib)
set(VERSION 1.1.0)
set(VERSION 1.1.1)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")

Expand All @@ -24,6 +24,10 @@ include(CheckCXXSourceCompiles)
include(TestBigEndian)
include("${PROJECT_SOURCE_DIR}/cmake/Macros.cmake")

if (NOT UNIX)
set(EMIPLIB_COMPILE_STATIC ON CACHE BOOL "Flag indicating if a static library should be built, or a dynamic one")
endif (NOT UNIX)

if (UNIX)
if (APPLE)
set(TMP ON)
Expand All @@ -32,7 +36,11 @@ if (UNIX)
endif (APPLE)
option(EMIPLIB_LINK "Flag indicating if the shared library should be automatically linked against the other libraries used" ${TMP})
else (UNIX)
set(EMIPLIB_LINK FALSE)
if (EMIPLIB_COMPILE_STATIC)
set(EMIPLIB_LINK FALSE)
else (EMIPLIB_COMPILE_STATIC)
set(EMIPLIB_LINK TRUE)
endif (EMIPLIB_COMPILE_STATIC)
endif (UNIX)

set(EMIPLIB_INTERNAL_INCLUDES "")
Expand Down Expand Up @@ -258,6 +266,14 @@ else (EMIPLIB_STDINT)
endif (EMIPLIB_INTTYPES)
endif (EMIPLIB_STDINT)

if (UNIX OR EMIPLIB_COMPILE_STATIC)
set(EMIPLIB_IMPORT "")
set(EMIPLIB_EXPORT "")
else (UNIX OR EMIPLIB_COMPILE_STATIC)
set(EMIPLIB_IMPORT "__declspec(dllimport)")
set(EMIPLIB_EXPORT "__declspec(dllexport)")
endif (UNIX OR EMIPLIB_COMPILE_STATIC)

configure_file("${PROJECT_SOURCE_DIR}/src/core/mipconfig.h.in" "${PROJECT_BINARY_DIR}/src/core/mipconfig.h")
configure_file("${PROJECT_SOURCE_DIR}/src/core/miptypes.h.in" "${PROJECT_BINARY_DIR}/src/core/miptypes.h")

Expand All @@ -269,12 +285,19 @@ if (UNIX)
get_filename_component(EMIPLIB_LIBNAME "${EMIPLIB_LOCAL_LIBRARY_NAME}" NAME)
set(EMIPLIB_LIBS "${LIBRARY_INSTALL_DIR}/${EMIPLIB_LIBNAME}")
else (UNIX)
get_target_property(EMIPLIB_LOCAL_LIBRARY_NAME emiplib-static RELEASE_LOCATION)
get_filename_component(EMIPLIB_LIBNAME_RELEASE "${EMIPLIB_LOCAL_LIBRARY_NAME}" NAME)
get_target_property(EMIPLIB_LOCAL_LIBRARY_NAME emiplib-static DEBUG_LOCATION)
get_filename_component(EMIPLIB_LIBNAME_DEBUG "${EMIPLIB_LOCAL_LIBRARY_NAME}" NAME)
set(EMIPLIB_LIBS optimized "${LIBRARY_INSTALL_DIR}/${EMIPLIB_LIBNAME_RELEASE}"
debug "${LIBRARY_INSTALL_DIR}/${EMIPLIB_LIBNAME_DEBUG}")
if (EMIPLIB_COMPILE_STATIC)
get_target_property(EMIPLIB_LOCAL_LIBRARY_NAME emiplib-static RELEASE_LOCATION)
get_filename_component(EMIPLIB_LIBNAME_RELEASE "${EMIPLIB_LOCAL_LIBRARY_NAME}" NAME_WE)
get_target_property(EMIPLIB_LOCAL_LIBRARY_NAME emiplib-static DEBUG_LOCATION)
get_filename_component(EMIPLIB_LIBNAME_DEBUG "${EMIPLIB_LOCAL_LIBRARY_NAME}" NAME_WE)
else (EMIPLIB_COMPILE_STATIC)
get_target_property(EMIPLIB_LOCAL_LIBRARY_NAME emiplib-shared RELEASE_LOCATION)
get_filename_component(EMIPLIB_LIBNAME_RELEASE "${EMIPLIB_LOCAL_LIBRARY_NAME}" NAME_WE)
get_target_property(EMIPLIB_LOCAL_LIBRARY_NAME emiplib-shared DEBUG_LOCATION)
get_filename_component(EMIPLIB_LIBNAME_DEBUG "${EMIPLIB_LOCAL_LIBRARY_NAME}" NAME_WE)
endif (EMIPLIB_COMPILE_STATIC)
set(EMIPLIB_LIBS optimized "${LIBRARY_INSTALL_DIR}/${EMIPLIB_LIBNAME_RELEASE}.lib"
debug "${LIBRARY_INSTALL_DIR}/${EMIPLIB_LIBNAME_DEBUG}.lib")
endif (UNIX)

set(EMIPLIB_INCDIRS ${EMIPLIB_EXTERNAL_INCLUDES} ${CMAKE_INSTALL_PREFIX}/include)
Expand All @@ -283,6 +306,13 @@ remove_empty(EMIPLIB_INCDIRS)
list(REMOVE_DUPLICATES EMIPLIB_INCDIRS)
remove_empty(EMIPLIB_LIBS) # Note that we can't remove duplicates because of multiple 'optimized' or 'debug' options in Win32 version

foreach(ARG ${EMIPLIB_LIBS})
set(EMIPLIB_LIBS_CMAKECONFIG "${EMIPLIB_LIBS_CMAKECONFIG} \"${ARG}\"")
endforeach()
foreach(ARG ${EMIPLIB_INCDIRS})
set(EMIPLIB_INCDIRS_CMAKECONFIG "${EMIPLIB_INCDIRS_CMAKECONFIG} \"${ARG}\"")
endforeach()

configure_file("${PROJECT_SOURCE_DIR}/cmake/EMIPLIBConfig.cmake.in" "${PROJECT_BINARY_DIR}/cmake/EMIPLIBConfig.cmake")
install(FILES "${PROJECT_BINARY_DIR}/cmake/EMIPLIBConfig.cmake" DESTINATION ${LIBRARY_INSTALL_DIR}/cmake/EMIPLIB)

Expand Down
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
EMIPLIB ChangeLog


Version 1.1.1, November 2011
* Fixed a bug in the CMake configuration: was unable to handle
path names with spaces.
* In an MS-Windows environment you can now choose to build a
DLL instead of a static library. This should make it easier
to comply with the LGPL when working on that platform.

Version 1.1.0, July 2011
* Switched to CMake build system.
* Bugfix in MIPAVCodecFrameConverter. Forgot to copy media info.
Expand Down
4 changes: 2 additions & 2 deletions README
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


EMIPLIB README
(1.1.0)
(1.1.1)


1. INTRODUCTION
Expand Down Expand Up @@ -84,7 +84,7 @@ available to the public and for allowing us to include a derived
version in this library.

The component which converts JPEG data into an uncompressed image
used the Tiny Jpeg Decoder by Luc Saillard. Thanks for making this
uses the Tiny Jpeg Decoder by Luc Saillard. Thanks for making this
publically available. Please see the source code in
src/thirdparty/tinyjpeg for more information about copyright and
disclaimer.
Expand Down
4 changes: 2 additions & 2 deletions cmake/EMIPLIBConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

set(EMIPLIB_FOUND 1)

set(EMIPLIB_INCLUDE_DIRS ${EMIPLIB_INCDIRS})
set(EMIPLIB_INCLUDE_DIRS ${EMIPLIB_INCDIRS_CMAKECONFIG})

set(EMIPLIB_LIBRARIES ${EMIPLIB_LIBS})
set(EMIPLIB_LIBRARIES ${EMIPLIB_LIBS_CMAKECONFIG})

2 changes: 1 addition & 1 deletion doc/mainpage.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* </style>
* \endhtmlonly
*
* \mainpage EMIPLIB 1.1.0
* \mainpage EMIPLIB 1.1.1
*
*
* \author Hasselt University - Expertise Centre for Digital Media
Expand Down
6 changes: 5 additions & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ apply_include_paths("${EMIPLIB_EXTERNAL_INCLUDES}")
foreach(IDX avsession feedbackexample multiplesoundfileplayer simplechain soundfileplayer soundrecorder pushtotalk
pushtotalk2)
add_executable(${IDX} ${IDX}.cpp)
target_link_libraries(${IDX} emiplib-static ${EMIPLIB_LINK_LIBS})
if (UNIX OR EMIPLIB_COMPILE_STATIC)
target_link_libraries(${IDX} emiplib-static ${EMIPLIB_LINK_LIBS})
else ()
target_link_libraries(${IDX} emiplib-shared ${EMIPLIB_LINK_LIBS})
endif (UNIX OR EMIPLIB_COMPILE_STATIC)
endforeach(IDX)

30 changes: 19 additions & 11 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
add_definitions(-DEMIPLIB_COMPILING)

set(HEADERS
core/mipcompat.h
core/mipmessage.h
Expand Down Expand Up @@ -247,25 +249,31 @@ endif (NOT UNIX AND WIN32)
apply_include_paths("${EMIPLIB_INTERNAL_INCLUDES}")
apply_include_paths("${EMIPLIB_EXTERNAL_INCLUDES}")

add_library(emiplib-static STATIC ${SOURCES} ${HEADERS})
if (UNIX)
set_target_properties(emiplib-static PROPERTIES OUTPUT_NAME emip)
else (UNIX)
set_target_properties(emiplib-static PROPERTIES OUTPUT_NAME emiplib)
endif (UNIX)
set_target_properties(emiplib-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
set(EMIPLIB_INSTALLTARGETS emiplib-static)
if (UNIX OR EMIPLIB_COMPILE_STATIC)
add_library(emiplib-static STATIC ${SOURCES} ${HEADERS})
if (UNIX)
set_target_properties(emiplib-static PROPERTIES OUTPUT_NAME emip)
else (UNIX)
set_target_properties(emiplib-static PROPERTIES OUTPUT_NAME emiplib)
endif (UNIX)
set_target_properties(emiplib-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
set(EMIPLIB_INSTALLTARGETS emiplib-static)
endif (UNIX OR EMIPLIB_COMPILE_STATIC)

if (UNIX)
if (UNIX OR NOT EMIPLIB_COMPILE_STATIC)
add_library(emiplib-shared SHARED ${SOURCES} ${HEADERS})
set_target_properties(emiplib-shared PROPERTIES VERSION ${VERSION})
set_target_properties(emiplib-shared PROPERTIES OUTPUT_NAME emip)
if (UNIX)
set_target_properties(emiplib-shared PROPERTIES OUTPUT_NAME emip)
else (UNIX)
set_target_properties(emiplib-shared PROPERTIES OUTPUT_NAME emiplib)
endif (UNIX)
set_target_properties(emiplib-shared PROPERTIES CLEAN_DIRECT_OUTPUT 1)
set(EMIPLIB_INSTALLTARGETS ${EMIPLIB_INSTALLTARGETS} emiplib-shared)
if (EMIPLIB_LINK)
target_link_libraries(emiplib-shared ${EMIPLIB_LINK_LIBS})
endif (EMIPLIB_LINK)
endif (UNIX)
endif (UNIX OR NOT EMIPLIB_COMPILE_STATIC)

install(FILES ${HEADERS} DESTINATION include/emiplib)
install(TARGETS ${EMIPLIB_INSTALLTARGETS} DESTINATION ${LIBRARY_INSTALL_DIR})
Expand Down
2 changes: 1 addition & 1 deletion src/components/codec/mipalawdecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class MIPRaw16bitAudioMessage;
* This component accepts a-law encoded audio messages and produces message
* raw audio messages using 16 bit signed native endian encoding.
*/
class MIPALawDecoder : public MIPComponent
class EMIPLIB_IMPORTEXPORT MIPALawDecoder : public MIPComponent
{
public:
MIPALawDecoder();
Expand Down
2 changes: 1 addition & 1 deletion src/components/codec/mipalawencoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class MIPEncodedAudioMessage;
* with type MIPMESSAGE_TYPE_AUDIO_ENCODED and subtype MIPENCODEDAUDIOMESSAGE_TYPE_ALAW
* is produced.
*/
class MIPALawEncoder : public MIPComponent
class EMIPLIB_IMPORTEXPORT MIPALawEncoder : public MIPComponent
{
public:
MIPALawEncoder();
Expand Down
2 changes: 1 addition & 1 deletion src/components/codec/mipavcodecdecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class MIPRawYUV420PVideoMessage;
* This component is a libavcodec based H.263+ decoder. It accepts encoded video messages with
* subtype MIPENCODEDVIDEOMESSAGE_TYPE_H263P and creates raw video messages in YUV420P format.
*/
class MIPAVCodecDecoder : public MIPComponent
class EMIPLIB_IMPORTEXPORT MIPAVCodecDecoder : public MIPComponent
{
public:
MIPAVCodecDecoder();
Expand Down
2 changes: 1 addition & 1 deletion src/components/codec/mipavcodecencoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class MIPEncodedVideoMessage;
* raw video messages in YUV420P format and creates encoded video messages with
* subtype MIPENCODEDVIDEOMESSAGE_TYPE_H263P.
*/
class MIPAVCodecEncoder : public MIPComponent
class EMIPLIB_IMPORTEXPORT MIPAVCodecEncoder : public MIPComponent
{
public:
MIPAVCodecEncoder();
Expand Down
2 changes: 1 addition & 1 deletion src/components/codec/mipgsmdecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct gsm_state;
* should be MIPEncodedAudioMessage instances with subtype MIPENCODEDAUDIOMESSAGE_TYPE_GSM.
* The component generates signed 16 bit native endian encoded raw audio messages.
*/
class MIPGSMDecoder : public MIPComponent
class EMIPLIB_IMPORTEXPORT MIPGSMDecoder : public MIPComponent
{
public:
MIPGSMDecoder();
Expand Down
2 changes: 1 addition & 1 deletion src/components/codec/mipgsmencoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct gsm_state;
* be compressed using the GSM 06.10 codec. Messages generated by this component
* are encoded audio messages with subtype MIPENCODEDAUDIOMESSAGE_TYPE_GSM.
*/
class MIPGSMEncoder : public MIPComponent
class EMIPLIB_IMPORTEXPORT MIPGSMEncoder : public MIPComponent
{
public:
MIPGSMEncoder();
Expand Down
2 changes: 1 addition & 1 deletion src/components/codec/miplpcdecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class LPCDecoder;
* should be MIPEncodedAudioMessage instances with subtype MIPENCODEDAUDIOMESSAGE_TYPE_LPC.
* The component generates signed 16 bit native endian encoded raw audio messages.
*/
class MIPLPCDecoder : public MIPComponent
class EMIPLIB_IMPORTEXPORT MIPLPCDecoder : public MIPComponent
{
public:
MIPLPCDecoder();
Expand Down
2 changes: 1 addition & 1 deletion src/components/codec/miplpcencoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class LPCEncoder;
* compressed using the LPC codec. Messages generated by this component
* are encoded audio messages with subtype MIPENCODEDAUDIOMESSAGE_TYPE_LPC.
*/
class MIPLPCEncoder : public MIPComponent
class EMIPLIB_IMPORTEXPORT MIPLPCEncoder : public MIPComponent
{
public:
MIPLPCEncoder();
Expand Down
2 changes: 1 addition & 1 deletion src/components/codec/mipsilkdecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class MIPAudioMessage;
* should be MIPEncodedAudioMessage instances with subtype MIPENCODEDAUDIOMESSAGE_TYPE_SILK.
* The component generates signed 16 bit native endian encoded raw audio messages.
*/
class MIPSILKDecoder : public MIPComponent
class EMIPLIB_IMPORTEXPORT MIPSILKDecoder : public MIPComponent
{
public:
MIPSILKDecoder();
Expand Down
7 changes: 6 additions & 1 deletion src/components/codec/mipsilkencoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#define MIPSILKENCODER_ERRSTR_NOTINIT "Not initialized"
#define MIPSILKENCODER_ERRSTR_ALREADYINIT "Already initialized"
#define MIPSILKENCODER_ERRSTR_CANTGETENCODERSIZE "Unable to retrieve appropriate encoder state size"
#define MIPSILKENCODER_ERRSTR_INVALIDBITRATE "Bitrate must lie between 5000 and 100000 bps"
//#define MIPSILKENCODER_ERRSTR_INVALIDBITRATE "Bitrate must lie between 5000 and 100000 bps"
#define MIPSILKENCODER_ERRSTR_INVALIDENCODERSAMPLINGRATE "Encoder sampling rate must be one of 8000, 12000, 16000 and 24000 Hz"
#define MIPSILKENCODER_ERRSTR_INVALIDINPUTSAMPLINGRATE "Input sampling rate must be one of 8000, 12000, 16000, 24000, 32000, 44100 and 48000 Hz"
#define MIPSILKENCODER_ERRSTR_INVALIDINTERVAL "Interval must be either 20, 40, 60, 80 or 100 ms"
Expand Down Expand Up @@ -80,11 +80,16 @@ bool MIPSILKEncoder::init(int samplingRate, MIPTime interval, int targetBitrate,
return false;
}

if (targetBitrate < 0)
targetBitrate = 0;

/*
if (targetBitrate < 5000 || targetBitrate > 100000)
{
setErrorString(MIPSILKENCODER_ERRSTR_INVALIDBITRATE);
return false;
}
*/

int intervalMs = (int)(interval.getValue()*1000.0 + 0.5);

Expand Down
12 changes: 11 additions & 1 deletion src/components/codec/mipsilkencoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,23 @@ class MIPEncodedAudioMessage;
* codec. Messages generated by this component are encoded audio messages with subtype
* MIPENCODEDAUDIOMESSAGE_TYPE_SILK.
*/
class MIPSILKEncoder : public MIPComponent
class EMIPLIB_IMPORTEXPORT MIPSILKEncoder : public MIPComponent
{
public:
MIPSILKEncoder();
~MIPSILKEncoder();

/** Initializes the SILK encoder.
* Initializes the SILK encoder.
* \param inputSamplingRate The sampling rate of audio messages going into the component.
* \param interval The interval contained in each incoming audio message. Should be a
* multiple of 20 ms, with a maximum value of 100 ms.
* \param targetBitrate The target bitrate of the encoder.
* \param encoderSamplingRate The maximum sampling rate used internally by the encoder.
*/
bool init(int inputSamplingRate, MIPTime interval, int targetBitrate, int encoderSamplingRate);

/** De-initializes the SILK encoder. */
bool destroy();

bool push(const MIPComponentChain &chain, int64_t iteration, MIPMessage *pMsg);
Expand Down
2 changes: 1 addition & 1 deletion src/components/codec/mipspeexdecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct SpeexBits;
* The component generates floating point mono raw audio messages or signed 16 bit native endian
* encoded raw audio messages.
*/
class MIPSpeexDecoder : public MIPComponent
class EMIPLIB_IMPORTEXPORT MIPSpeexDecoder : public MIPComponent
{
public:
MIPSpeexDecoder();
Expand Down
2 changes: 1 addition & 1 deletion src/components/codec/mipspeexencoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct SpeexBits;
* messages can be compressed using the Speex codec. Messages generated by this component
* are encoded audio messages with subtype MIPENCODEDAUDIOMESSAGE_TYPE_SPEEX.
*/
class MIPSpeexEncoder : public MIPComponent
class EMIPLIB_IMPORTEXPORT MIPSpeexEncoder : public MIPComponent
{
public:
/** Used to select speex encoding type. */
Expand Down
2 changes: 1 addition & 1 deletion src/components/codec/miptinyjpegdecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class MIPVideoMessage;
* A JPEG decoder based on the Tiny JPEG Decoder library. It accepts frames that
* are JPEG compressed and outputs YUV420P frames.
*/
class MIPTinyJPEGDecoder : public MIPComponent
class EMIPLIB_IMPORTEXPORT MIPTinyJPEGDecoder : public MIPComponent
{
public:
MIPTinyJPEGDecoder();
Expand Down
Loading

0 comments on commit e0f1030

Please sign in to comment.