Skip to content

Commit

Permalink
Merge pull request #76 from ni-mheppner/feature/fix_ni_package_cmake_…
Browse files Browse the repository at this point in the history
…and_update_changelog

Fix ni package cmake and update changelog
  • Loading branch information
ni-mheppner authored May 8, 2024
2 parents 9dfe547 + aff504c commit aeabfac
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# 2024-05-08 version v1.1.2:

* FIXED: Issues in cmake integration for NI's internal build system

# 2024-04-30 version v1.1.1:

* ADDED: Cmake integration for NI's internal build system
* FIXED: An issue where `media_foundation_helper` could produce an integer overflow resulting in a freeze while reading a file

# 2023-12-20 version v1.1.0:

* ADDED: Possibility of creating a custom decoder via `istream_source`
Expand Down
14 changes: 10 additions & 4 deletions NI.package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ function( pr_init_ni_nimedia_package_path )
endfunction()
pr_init_ni_nimedia_package_path()

if( APPLE OR WIN32 )
set( APPLE_OR_WINDOWS TRUE )
endif()

set( NIMEDIA_PCM_INCLUDE_DIRS "${NI_NIMEDIA_PACKAGE_PATH}/pcm/inc" )

if ( NOT (EXISTS ${NIMEDIA_PCM_INCLUDE_DIRS}) )
Expand Down Expand Up @@ -120,7 +124,7 @@ set( audiostream_sources
"${NI_NIMEDIA_PACKAGE_PATH}/audiostream/src/ni/media/iostreams/stream_buffer.h"
"${NI_NIMEDIA_PACKAGE_PATH}/audiostream/src/ni/media/iostreams/write_obj.h"
)
if ( APPLE OR WIN32 )
if ( APPLE_OR_WINDOWS )
list( APPEND audiostream_sources
"${NI_NIMEDIA_PACKAGE_PATH}/audiostream/src/ni/media/audio/mp3/mp3_file_source.h"
"${NI_NIMEDIA_PACKAGE_PATH}/audiostream/src/ni/media/audio/mp3/mp3_vector_source.h"
Expand Down Expand Up @@ -162,6 +166,8 @@ list( APPEND codec_libraries flacpp )
find_package( NILibVorbis REQUIRED )
list( APPEND codec_libraries libvorbis )
if ( APPLE )
find_library( COREAUDIOTOOLBOX_FRAMEWORK AudioToolbox )
list( APPEND codec_libraries ${COREAUDIOTOOLBOX_FRAMEWORK})
if ( NOT IOS )
find_library( CORESERVICES_FRAMEWORK CoreServices )
list( APPEND codec_libraries ${CORESERVICES_FRAMEWORK} )
Expand All @@ -186,13 +192,13 @@ target_link_libraries( audiostream PUBLIC pcm
target_compile_definitions( audiostream PRIVATE
NIMEDIA_ENABLE_AIFF_DECODING=1
NIMEDIA_ENABLE_FLAC_DECODING=1
NIMEDIA_ENABLE_MP3_DECODING=1
NIMEDIA_ENABLE_MP4_DECODING=1
NIMEDIA_ENABLE_MP3_DECODING=$<BOOL:${APPLE_OR_WINDOWS}>
NIMEDIA_ENABLE_MP4_DECODING=$<BOOL:${APPLE_OR_WINDOWS}>
NIMEDIA_ENABLE_OGG_DECODING=1
NIMEDIA_ENABLE_WAV_DECODING=1
NIMEDIA_ENABLE_WMA_DECODING=$<BOOL:${NIMEDIA_ENABLE_WMA_DECODING}> #wma support is off by default, clients need to turn it on
NIMEDIA_ENABLE_WAV_ENCODING=1
NIMEDIA_ENABLE_ITUNES_DECODING=1
NIMEDIA_ENABLE_ITUNES_DECODING=$<BOOL:${IOS}>
)

add_library( ni-media INTERFACE )
Expand Down

0 comments on commit aeabfac

Please sign in to comment.