Skip to content

Commit

Permalink
Add Opus building instructions
Browse files Browse the repository at this point in the history
Issue #234
  • Loading branch information
eofster committed Aug 26, 2016
1 parent 24ba90b commit bc5d6f4
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
build/
.idea/

ThirdParty/Opus
ThirdParty/LibreSSL
ThirdParty/PJSIP
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ internet connection.

## Building

### Opus

Opus codec is optional.

Download:

$ ftp http://downloads.xiph.org/releases/opus/opus-1.1.3.tar.gz
$ tar xzvf opus-1.1.3.tar.gz
$ cd opus-1.1.3

Build and install:

$ ./configure --prefix=/path/to/Telephone/ThirdParty/Opus --disable-shared CFLAGS='-O2 -mmacosx-version-min=10.10'
$ make
$ make install

### PJSIP

Download:
Expand All @@ -24,9 +40,9 @@ Create `pjlib/include/pj/config_site.h`:
#define PJ_DNS_SRV_MAX_ADDR 32
#define PJSIP_MAX_RESOLVED_ADDRESSES 32

Build and install:
Build and install (remove `--with-opus` option if you don’t need Opus):

$ ./configure --prefix=/path/to/Telephone/ThirdParty/PJSIP --host=x86_64-apple-darwin CFLAGS='-mmacosx-version-min=10.10'
$ ./configure --prefix=/path/to/Telephone/ThirdParty/PJSIP --with-opus=/path/to/Telephone/ThirdParty/Opus --host=x86_64-apple-darwin CFLAGS='-mmacosx-version-min=10.10'
$ make lib
$ make install

Expand Down
12 changes: 10 additions & 2 deletions Telephone.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3625,7 +3625,10 @@
HEADER_SEARCH_PATHS = "\"$(SRCROOT)/ThirdParty/PJSIP/include\"";
INFOPLIST_FILE = Telephone/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/ThirdParty/PJSIP/lib\"";
LIBRARY_SEARCH_PATHS = (
"\"$(SRCROOT)/ThirdParty/PJSIP/lib\"",
"\"$(SRCROOT)/ThirdParty/Opus/lib\"",
);
OTHER_LDFLAGS = (
"-lpjsua-x86_64-apple-darwin",
"-lpjsip-ua-x86_64-apple-darwin",
Expand All @@ -3642,6 +3645,7 @@
"-lspeex-x86_64-apple-darwin",
"-lilbccodec-x86_64-apple-darwin",
"-lpj-x86_64-apple-darwin",
"-lopus",
);
PRODUCT_BUNDLE_IDENTIFIER = com.tlphn.Telephone;
PRODUCT_NAME = Telephone;
Expand All @@ -3659,7 +3663,10 @@
HEADER_SEARCH_PATHS = "\"$(SRCROOT)/ThirdParty/PJSIP/include\"";
INFOPLIST_FILE = Telephone/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
LIBRARY_SEARCH_PATHS = "\"$(SRCROOT)/ThirdParty/PJSIP/lib\"";
LIBRARY_SEARCH_PATHS = (
"\"$(SRCROOT)/ThirdParty/PJSIP/lib\"",
"\"$(SRCROOT)/ThirdParty/Opus/lib\"",
);
OTHER_LDFLAGS = (
"-lpjsua-x86_64-apple-darwin",
"-lpjsip-ua-x86_64-apple-darwin",
Expand All @@ -3676,6 +3683,7 @@
"-lspeex-x86_64-apple-darwin",
"-lilbccodec-x86_64-apple-darwin",
"-lpj-x86_64-apple-darwin",
"-lopus",
);
PRODUCT_BUNDLE_IDENTIFIER = com.tlphn.Telephone;
PRODUCT_NAME = Telephone;
Expand Down
11 changes: 6 additions & 5 deletions Telephone/AKSIPUserAgent.m
Original file line number Diff line number Diff line change
Expand Up @@ -745,11 +745,12 @@ - (NSUInteger)priorityForCodec:(NSString *)identifier {
@"speex/16000/1": @(130),
@"speex/8000/1": @(129),
@"speex/32000/1": @(128),
@"iLBC/8000/1": @(127),
@"GSM/8000/1": @(126),
@"PCMU/8000/1": @(125),
@"PCMA/8000/1": @(124),
@"G722/16000/1": @(123)
@"opus/48000/2": @(127),
@"iLBC/8000/1": @(126),
@"GSM/8000/1": @(125),
@"PCMU/8000/1": @(124),
@"PCMA/8000/1": @(123),
@"G722/16000/1": @(122)
};
});

Expand Down

0 comments on commit bc5d6f4

Please sign in to comment.