Skip to content
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

Feature add linux gstreamer support #11

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
717b048
adding support for mp3, m4a and wma files on linux by using gstreamer…
hhoegelo Dec 21, 2017
5274d99
fixed some tests, still some failing
hhoegelo Dec 22, 2017
9130479
improve readability
hhoegelo Jan 5, 2018
693b84d
add gstreamer dependencies for ci run
hhoegelo Jan 8, 2018
e9254c1
fix intendation issue
hhoegelo Jan 8, 2018
07341d1
blindflight: configureing ubuntu packages not having ubuntu
hhoegelo Jan 8, 2018
8ec93ff
blindflight: configureing ubuntu packages not having ubuntu
hhoegelo Jan 8, 2018
f46c5d2
fix formatting (apply clang-format)
hhoegelo Jan 11, 2018
d147f11
fix alignment
hhoegelo Jan 11, 2018
1c58318
incorporated some of the pull request comments
hhoegelo Jan 17, 2018
5736624
Merge branch 'master' into feature-add-linux-gstreamer-support
Mar 22, 2018
9019049
fix retrieval of num_frames info
Mar 24, 2018
9ed24e3
use absolute_position for seeking, return -1 on seek error
Mar 24, 2018
e45327e
improve error reporting for failing streams
Mar 27, 2018
1823462
change m_position type to std::streampos
Mar 28, 2018
76366dc
read_interlaced_test: add more valuable test output
Mar 28, 2018
be51e20
Merge branch 'master' into feature-add-linux-gstreamer-support-marcrambo
Apr 11, 2018
4643b10
adding support for mp3, m4a and wma files on linux by using gstreamer…
hhoegelo Dec 21, 2017
8f1123b
fixed some tests, still some failing
hhoegelo Dec 22, 2017
e6a05c1
improve readability
hhoegelo Jan 5, 2018
7146d73
add gstreamer dependencies for ci run
hhoegelo Jan 8, 2018
eea5bb4
fix intendation issue
hhoegelo Jan 8, 2018
48c73f2
blindflight: configureing ubuntu packages not having ubuntu
hhoegelo Jan 8, 2018
7dde3c7
blindflight: configureing ubuntu packages not having ubuntu
hhoegelo Jan 8, 2018
44d9df9
fix formatting (apply clang-format)
hhoegelo Jan 11, 2018
7023f2f
fix alignment
hhoegelo Jan 11, 2018
59bd834
incorporated some of the pull request comments
hhoegelo Jan 17, 2018
54ea50d
incorporated some of sdroege's comments
hhoegelo Apr 16, 2018
4d82bdc
fixup
hhoegelo Apr 17, 2018
cf1e7a8
removed GstApp dependency
hhoegelo Apr 17, 2018
b4d9d4c
merged marc boucek's fixes
hhoegelo Apr 17, 2018
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
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ matrix:
- libogg-dev
- libvorbis-dev
- libflac++-dev
- gstreamer1.0-libav
- gstreamer1.0-plugins-base
- gstreamer1.0-plugins-good
- gstreamer1.0-plugins-ugly
- gstreamer1.0-plugins-bad
- gstreamer1.0-plugins-bad-faad
- libgstreamer1.0-dev
- libgstreamer-plugins-base1.0-dev

env: MATRIX_EVAL="CONFIG=Release && CXX=g++-5"

Expand Down
29 changes: 27 additions & 2 deletions audiostream/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ option( NIMEDIA_ENABLE_AIFF_DECODING "Enable ni-media aiff decoding" ON )
option( NIMEDIA_ENABLE_FLAC_DECODING "Enable ni-media flac decoding" ON )
option( NIMEDIA_ENABLE_OGG_DECODING "Enable ni-media ogg decoding" ON )

if ( APPLE OR WIN32 )
if ( APPLE OR WIN32 OR LINUX )
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should make this the default behavior, since gstreamer is LGLP licensed? I'd say users should be required to manually enable it?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it be reasonable to enable these options if we detect the presence of gstreamer? or leave it manual... For APPLE and WIN32 cases, we can rely on SDKs that are guaranteed part of the OS, so its implicitly going to work.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me, licensing of gstreamer is still (after years of working with it) unclear: While gstreamer itself is LGPL and thus could - as far as I understand - be enabled by default without copyleft, the plug-ins that are used by gstreamer might be GPL (copyleft) or even 'worse'. I don't understand, if and how the license of dynamically loaded plugins influence the license chain "gstreamer->ni-media->application".

option( NIMEDIA_ENABLE_MP3_DECODING "Enable ni-media mp3 decoding" ON )
option( NIMEDIA_ENABLE_MP4_DECODING "Enable ni-media mp4 decoding" ON )
else()
Expand All @@ -20,7 +20,7 @@ else()
option( NIMEDIA_ENABLE_ITUNES_DECODING "Enable ni-media iTunes decoding" OFF )
endif()

if( WIN32 )
if( WIN32 OR LINUX )
option( NIMEDIA_ENABLE_WMA_DECODING "Enable ni-media wma decoding" ON )
else()
option( NIMEDIA_ENABLE_WMA_DECODING "Enable ni-media wma decoding" OFF )
Expand Down Expand Up @@ -71,6 +71,7 @@ endif()

set( COMPILE_WITH_COREAUDIO DONT_COMPILE)
set( COMPILE_WITH_MEDIA_FOUNDATION DONT_COMPILE)
set( COMPILE_WITH_GSTREAMER DONT_COMPILE)

#-----------------------------------------------------------------------------------------------------------------------
# dependencies
Expand Down Expand Up @@ -133,6 +134,29 @@ if( NIMEDIA_ENABLE_MP3_DECODING OR NIMEDIA_ENABLE_MP4_DECODING OR NIMEDIA_ENABLE

list(APPEND codec_libraries mfplat.lib mfreadwrite.lib mfuuid.lib Propsys.lib)

elseif( LINUX )

set(COMPILE_WITH_GSTREAMER)

find_package(Glib REQUIRED)
find_package(GStreamer REQUIRED)
find_package(GStreamerApp REQUIRED)
find_package(GObject REQUIRED)

if ( NOT TARGET GSTREAMER::gstreamer )
message(FATAL_ERROR
"You are building ni-media with GStreamer decoding support but the required gstreamer-1.0 library was not found\n"
"Make sure library can be found or disable GSTREAMER decoding by setting:\n"
" * NIMEDIA_ENABLE_MP3_DECODING = OFF\n"
" * NIMEDIA_ENABLE_MP4_DECODING = OFF\n"
" * NIMEDIA_ENABLE_WMA_DECODING = OFF\n")
endif()

list(APPEND codec_libraries GSTREAMER::gstreamer)
list(APPEND codec_libraries GSTREAMERAPP::gstreamerapp)
list(APPEND codec_libraries glib-2.0)
list(APPEND codec_libraries gobject-2.0)

else()

message(FATAL_ERROR
Expand Down Expand Up @@ -228,6 +252,7 @@ add_src_file (FILES_media_audio_source "src/ni/media/audio/source/container_sou
add_src_file (FILES_media_audio_source "src/ni/media/audio/source/core_audio_file_source.cpp" ${COMPILE_WITH_COREAUDIO} WITH_HEADER )
add_src_file (FILES_media_audio_source "src/ni/media/audio/source/media_foundation_helper.h" ${COMPILE_WITH_MEDIA_FOUNDATION} )
add_src_file (FILES_media_audio_source "src/ni/media/audio/source/media_foundation_file_source.cpp" ${COMPILE_WITH_MEDIA_FOUNDATION} WITH_HEADER )
add_src_file (FILES_media_audio_source "src/ni/media/audio/source/gstreamer_file_source.cpp" ${COMPILE_WITH_GSTREAMER} WITH_HEADER )
add_src_file (FILES_media_audio_source "src/ni/media/audio/source/aiff_source.h" ${COMPILE_WITH_AIFF_DECODING} )
add_src_file (FILES_media_audio_source "src/ni/media/audio/source/aiff_file_source.h" ${COMPILE_WITH_AIFF_DECODING} )
add_src_file (FILES_media_audio_source "src/ni/media/audio/source/aiff_vector_source.h" ${COMPILE_WITH_AIFF_DECODING} )
Expand Down
Loading