]>
Commit | Line | Data |
---|---|---|
4dd6f92b JK |
1 | diff -dur asterisk-13.7.2.orig/main/codec_builtin.c asterisk-13.7.2/main/codec_builtin.c |
2 | --- asterisk-13.7.2.orig/main/codec_builtin.c 2016-02-05 21:32:40.000000000 +0100 | |
3 | +++ asterisk-13.7.2/main/codec_builtin.c 2016-03-09 11:55:44.000000000 +0100 | |
4 | @@ -38,6 +38,8 @@ | |
5 | #include "asterisk/format_cache.h" | |
6 | #include "asterisk/frame.h" | |
7 | ||
8 | +#include <opus/opus.h> | |
9 | + | |
10 | enum frame_type { | |
11 | TYPE_HIGH, /* 0x0 */ | |
12 | TYPE_LOW, /* 0x1 */ | |
13 | @@ -698,6 +700,11 @@ | |
14 | .get_length = g719_length, | |
15 | }; | |
16 | ||
17 | +static int opus_samples(struct ast_frame *frame) | |
18 | +{ | |
19 | + return opus_packet_get_nb_samples(frame->data.ptr, frame->datalen, 48000); | |
20 | +} | |
21 | + | |
22 | static struct ast_codec opus = { | |
23 | .name = "opus", | |
24 | .description = "Opus Codec", | |
25 | @@ -707,6 +714,7 @@ | |
26 | .maximum_ms = 60, | |
27 | .default_ms = 20, | |
28 | .minimum_bytes = 10, | |
29 | + .samples_count = opus_samples, | |
30 | }; | |
31 | ||
32 | static struct ast_codec jpeg = { | |
33 | diff -dur asterisk-13.7.2.orig/main/Makefile asterisk-13.7.2/main/Makefile | |
34 | --- asterisk-13.7.2.orig/main/Makefile 2016-03-09 11:53:45.000000000 +0100 | |
35 | +++ asterisk-13.7.2/main/Makefile 2016-03-09 11:55:44.000000000 +0100 | |
36 | @@ -40,6 +40,7 @@ | |
37 | AST_LIBS+=$(URIPARSER_LIB) | |
38 | AST_LIBS+=$(UUID_LIB) | |
39 | AST_LIBS+=$(CRYPT_LIB) | |
40 | +AST_LIBS+=$(OPUS_LIB) | |
41 | AST_LIBS+=$(AST_CLANG_BLOCKS_LIBS) | |
42 | ||
43 | ifneq ($(findstring $(OSARCH), linux-gnu linux-gnux32 uclinux linux-uclibc kfreebsd-gnu),) | |
44 | @@ -160,6 +161,7 @@ | |
45 | bucket.o: _ASTCFLAGS+=$(URIPARSER_INCLUDE) | |
46 | crypt.o: _ASTCFLAGS+=$(CRYPT_INCLUDE) | |
47 | uuid.o: _ASTCFLAGS+=$(UUID_INCLUDE) | |
48 | +codec_builtin.o: _ASTCFLAGS+=$(OPUS_INCLUDE) | |
49 | ||
50 | ifneq ($(findstring ENABLE_UPLOADS,$(MENUSELECT_CFLAGS)),) | |
51 | http.o: _ASTCFLAGS+=$(GMIME_INCLUDE) | |
52 | diff -dur asterisk-13.7.2.orig/main/Makefile.orig asterisk-13.7.2/main/Makefile.orig | |
53 | --- asterisk-13.7.2.orig/main/Makefile.orig 2016-02-05 21:32:40.000000000 +0100 | |
54 | +++ asterisk-13.7.2/main/Makefile.orig 2016-03-09 11:53:45.000000000 +0100 | |
55 | @@ -42,7 +42,7 @@ | |
56 | AST_LIBS+=$(CRYPT_LIB) | |
57 | AST_LIBS+=$(AST_CLANG_BLOCKS_LIBS) | |
58 | ||
59 | -ifneq ($(findstring $(OSARCH), linux-gnu uclinux linux-uclibc kfreebsd-gnu),) | |
60 | +ifneq ($(findstring $(OSARCH), linux-gnu linux-gnux32 uclinux linux-uclibc kfreebsd-gnu),) | |
61 | ifneq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),) | |
62 | AST_LIBS+=-ldl | |
63 | endif |