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

Libshout intern #2040

Merged
merged 11 commits into from
Dec 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion build/depends.py
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ def sources(self, build):
'preferences/dialog/dlgprefvinyldlg.ui',
'preferences/dialog/dlgprefwaveformdlg.ui',
]
map(Qt.uic(build), ui_files)
list(map(Qt.uic(build), ui_files))

if build.platform_is_windows:
# Add Windows resource file with icons and such
Expand Down
40 changes: 39 additions & 1 deletion build/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,14 +812,32 @@ def enabled(self, build):

def add_options(self, build, vars):
vars.Add('shoutcast', 'Set to 1 to enable live broadcasting support', 1)
vars.Add('shoutcast_internal', 'Set to 1 to use internal libshout', 0)

def configure(self, build, conf):
if not self.enabled(build):
return

libshout_found = conf.CheckLib(['libshout', 'shout'])
build.env.Append(CPPDEFINES='__BROADCAST__')

build.flags['shoutcast_internal'] = util.get_flags(build.env, 'shoutcast_internal', 0)
if build.platform_is_linux and not int(build.flags['shoutcast_internal']):
# Check if system lib is lower 2.4.2 or 2.4.3 and not suffering bug
# https://bugs.launchpad.net/mixxx/+bug/1833225
if not conf.CheckForPKG('shout', '2.4.3'):
if conf.CheckForPKG('shout', '2.4.2'):
print("System's libshout 2.4.2 suffers lp1833225, using internal shout_mixxx")
build.flags['shoutcast_internal'] = 1
else:
print("(no) here is fine here we just don't want 2.4.2")

if int(build.flags['shoutcast_internal']):
build.env.Append(CPPPATH='include')
build.env.Append(CPPPATH='src')
return

libshout_found = conf.CheckLib(['libshout', 'shout'])

if not libshout_found:
raise Exception('Could not find libshout or its development headers. Please install it or compile Mixxx without Shoutcast support using the shoutcast=0 flag.')

Expand All @@ -829,6 +847,26 @@ def configure(self, build, conf):
conf.CheckLib('gdi32')

def sources(self, build):
if int(build.flags['shoutcast_internal']):
# Clone our main environment so we don't change any settings in the
# Mixxx environment
libshout_env = build.env.Clone()

if build.toolchain_is_gnu:
libshout_env.Append(CCFLAGS='-pthread')
libshout_env.Append(LINKFLAGS='-pthread')

libshout_env.Append(CPPPATH="#lib/libshout")
libshout_dir = libshout_env.Dir("#lib/libshout")

env = libshout_env
SCons.Export('env')
SCons.Export('build')
env.SConscript(env.File('SConscript', libshout_dir))

build.env.Append(LIBPATH=libshout_dir)
build.env.Append(LIBS=['shout_mixxx', 'ogg', 'vorbis', 'theora', 'speex', 'ssl', 'crypto'])

depends.Qt.uic(build)('preferences/dialog/dlgprefbroadcastdlg.ui')
return ['preferences/dialog/dlgprefbroadcast.cpp',
'broadcast/broadcastmanager.cpp',
Expand Down
481 changes: 481 additions & 0 deletions lib/libshout/COPYING

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions lib/libshout/HACKING
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Note that these instructions are *not* necessary for distribution
tarballs; they have separate configure/build instructions.

Building this package from subversion is mainly intended for developers.
General users should obtain official distribution packages; both
source and binary distributions are available at
http://www.icecast.org/

-----

These are *brief* instructions on how to build this package from subversion.
Yes, there are details left out.

There are generally four steps necessary when building from subversion (i.e.,
a developer's copy):

1. svn checkout of the sources, or svn update. RTFM from your
favorite flavor of svn documentation; information on the xiph.org
svn repository can be found at http://www.xiph.org/svn/.

2. [re-]generate files such as "configure" and "Makefile.in" with the
GNU autoconf/automake tools. Run the "autogen.sh" script to
perform this step.

*** IF YOU ARE NOT BUILDING WITH GNU MAKE *AND* GCC: you must set
the AUTOMAKE_FLAGS environment variable to "--include-deps"
before running autogen.sh. For example:

csh% setenv AUTOMAKE_FLAGS --include-deps
csh% ./autogen.sh
or
sh% AUTOMAKE_FLAGS=--include-deps ./autogen.sh

3. Run configure. There are several options available; see
"./configure --help" for more information.

4. Run "make" to build the source.

In general, steps 2 and 3 need to be re-run every time any of the
following files are modified (either manually or by a svn update):

configure.in
m4/*

Running "make clean" after running steps 2 and 3 is generally also
advisable before running step 4. It isn't *always* necessary, but
unless you understand the workings of autoconf/automake, it's safest
to just do it.
41 changes: 41 additions & 0 deletions lib/libshout/INSTALL
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Prerequisites
-------------

libvorbis
libogg

Both of these libraries must be installed before you can build
libshout. If they aren't available in your OS's package system, you
can find them at vorbis.com. You may also want libtheora if you're
interested in doing video streaming.

Building
--------

Normally, just ./configure; make

You may need to specify --with-ogg-prefix and/or --with-vorbis-prefix
if you have installed those libraries in a non-standard
location. The arguments to these will match the --prefix you used when
configuring ogg and vorbis, respectively.

You may also choose to build libshout without thread safety, with the
--disable-pthread argument to configure. Only do this if you know you
will never be using the library in a threaded application, or if you
intend to make all calls to libshout threadsafe by hand in your
calling application.

Installation
------------
(as root) make install

This will install header files in $(prefix)/shout and library files in
$(prefix)/lib.

configure will have detected whether or not you have pkg-config
automatically. If you have, it will place a pkg-config data file in
$(prefix)/lib/pkgconfig, otherwise it will place a shout-config script
in $(prefix)/bin. You can force libshout to use shout-config instead
of pkgconfig with the configure option --disable-pkgconfig.

$Id$
30 changes: 30 additions & 0 deletions lib/libshout/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Process this file with automake to produce Makefile.in

AUTOMAKE_OPTIONS = 1.6 foreign
ACLOCAL_AMFLAGS = -I m4

SUBDIRS = include src examples doc win32

EXTRA_DIST = INSTALL m4/shout.m4 m4/acx_pthread.m4 \
m4/ogg.m4 m4/vorbis.m4 m4/xiph_compiler.m4 m4/xiph_net.m4 \
m4/xiph_types.m4 libshout.ckport

docdir = $(datadir)/doc/$(PACKAGE)
doc_DATA = COPYING NEWS README examples/example.c examples/nonblocking.c

m4datadir = $(datadir)/aclocal
m4data_DATA = m4/shout.m4

ckportdir = $(libdir)/ckport/db
ckport_DATA = libshout.ckport

if HAVE_PKGCONFIG
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = shout.pc
endif

debug:
$(MAKE) all CFLAGS="@DEBUG@"

profile:
$(MAKE) all CFLAGS="@PROFILE@"
49 changes: 49 additions & 0 deletions lib/libshout/NEWS
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
libshout 2.4.1 (20151120)

* Fixed issue with missing file in distribution

libshout 2.4.0 (20151111)

* Audio only WebM support.
* Protocol level meta data support improved.
Some API calls got replaced and marked as obsolete.
* Code hardened.
* Fixed overlinking.
* Removed Debian packaging.
* TLS support (RFC2818 and RFC2817, mode can be autodetected).
* Improved HTTP protocol:
* Set Host:-header (vhosting),
* Check for server capabilities.
* Basic support for RoarAudio protocol.

libshout 2.3.1 (20120525)

* Opus support

libshout 2.3.0 (20120201)

* Rough WebM support
* removed the shout-config script

libshout 2.2.2 (20060619)

* Handle Oggs that don't begin with zero granulepos.
* Install header in correct location (broken in 2.2.1).
* Theora memory leak fix.
* Non-blocking shout_open was failing unnecessarily in the
connect_pending state.
* Cast some size_ts to ints for display purposes.

libshout 2.2.1 (20060417)

* Fix error handling while opening a connection, so that shout_open
can be retried.
* pkgconfig fix for header installation
* Fix a memory leak in HTTP authentication

libshout 2.2 (20060103)

* Speex support
* Fix a double-free bug when login fails
* More robust server response parser
* Theora timing fix
20 changes: 20 additions & 0 deletions lib/libshout/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
libshout
--------

Libshout is a library for communicating with and sending data to an
icecast server. It handles the socket connection, the timing of the
data, and prevents bad data from getting to the icecast server.

With just a few lines of code, a programmer can easily turn any application
into a streaming source for an icecast server. Libshout also allows
developers who want a specific feature set (database access, request taking)
to concentrate on that feature set, instead of worrying about how server
communication works.

Please refer to the api reference and example code to start learning how to
use libshout in your own code.

Libshout is licensed under the LGPL. Please see the COPYING file for details.

If you have any questions or comments, please visit us at
http://www.icecast.org or email us at [email protected].
35 changes: 35 additions & 0 deletions lib/libshout/SConscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env python

Import('env')
env = env.Clone()

libshout_sources = [
'src/common/avl/avl.c',
'src/common/net/sock.c',
'src/common/net/resolver.c',
'src/common/timing/timing.c',
'src/common/httpp/httpp.c',
'src/common/httpp/encoding.c',
'src/common/thread/thread.c',
'src/shout.c',
'src/util.c',
'src/queue.c',
'src/proto_http.c',
'src/proto_xaudiocast.c',
'src/proto_icy.c',
'src/proto_roaraudio.c',
'src/format_ogg.c',
'src/format_webm.c',
'src/format_mp3.c',
'src/codec_vorbis.c',
'src/codec_opus.c',
'src/codec_theora.c',
'src/codec_speex.c',
'src/tls.c'
]

env.Append(CPPDEFINES='HAVE_CONFIG_H')
env.Append(CPPPATH='src/common')
env.Append(CPPPATH='include')

env.StaticLibrary(target='libshout_mixxx', source=libshout_sources)
Loading