From 8dbabe3708a3628fa7cd5f0a9427137798a5a677 Mon Sep 17 00:00:00 2001 From: winlin Date: Sun, 8 Mar 2015 17:36:43 +0800 Subject: [PATCH] fix #310, refine aac LC, support aac HE/HEv2. 2.0.134. --- README.md | 1 + trunk/src/core/srs_core.hpp | 2 +- trunk/src/kernel/srs_kernel_codec.cpp | 14 ++++++++++++++ trunk/src/kernel/srs_kernel_codec.hpp | 6 ++++++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2eee072b4..b86e29a64 100755 --- a/README.md +++ b/README.md @@ -550,6 +550,7 @@ Supported operating systems and hardware: ### SRS 2.0 history +* v2.0, 2015-03-08, fix [#310](https://github.com/winlinvip/simple-rtmp-server/issues/310), refine aac LC, support aac HE/HEv2. 2.0.134. * v2.0, 2015-03-06, for [#322](https://github.com/winlinvip/simple-rtmp-server/issues/322), fix http-flv stream bug, support multiple streams. 2.0.133. * v2.0, 2015-03-06, refine http request parse. 2.0.132. * v2.0, 2015-03-01, for [#179](https://github.com/winlinvip/simple-rtmp-server/issues/179), revert dvr http api. 2.0.128. diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index d714ec41a..0b7b49c7c 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // current release version #define VERSION_MAJOR 2 #define VERSION_MINOR 0 -#define VERSION_REVISION 133 +#define VERSION_REVISION 134 // server info. #define RTMP_SIG_SRS_KEY "SRS" diff --git a/trunk/src/kernel/srs_kernel_codec.cpp b/trunk/src/kernel/srs_kernel_codec.cpp index 5d9ba6559..afd0d3280 100644 --- a/trunk/src/kernel/srs_kernel_codec.cpp +++ b/trunk/src/kernel/srs_kernel_codec.cpp @@ -87,6 +87,18 @@ string srs_codec_aac_profile2str(SrsAacProfile aac_profile) } } +string srs_codec_aac_object2str(SrsAacObjectType aac_object) +{ + switch (aac_object) { + case SrsAacObjectTypeAacMain: return "Main"; + case SrsAacObjectTypeHE: return "HE"; + case SrsAacObjectTypeHEV2: return "HEv2"; + case SrsAacObjectTypeAacLC: return "LC"; + case SrsAacObjectTypeAacSSR: return "SSR"; + default: return "Other"; + } +} + SrsAacObjectType srs_codec_aac_ts2rtmp(SrsAacProfile profile) { switch (profile) { @@ -101,6 +113,8 @@ SrsAacProfile srs_codec_aac_rtmp2ts(SrsAacObjectType object_type) { switch (object_type) { case SrsAacObjectTypeAacMain: return SrsAacProfileMain; + case SrsAacObjectTypeHE: + case SrsAacObjectTypeHEV2: case SrsAacObjectTypeAacLC: return SrsAacProfileLC; case SrsAacObjectTypeAacSSR: return SrsAacProfileSSR; default: return SrsAacProfileReserved; diff --git a/trunk/src/kernel/srs_kernel_codec.hpp b/trunk/src/kernel/srs_kernel_codec.hpp index 4bec2744b..950ffb1e4 100644 --- a/trunk/src/kernel/srs_kernel_codec.hpp +++ b/trunk/src/kernel/srs_kernel_codec.hpp @@ -404,7 +404,13 @@ enum SrsAacObjectType SrsAacObjectTypeAacMain = 1, SrsAacObjectTypeAacLC = 2, SrsAacObjectTypeAacSSR = 3, + + // AAC HE = LC+SBR + SrsAacObjectTypeHE = 5, + // AAC HEv2 = LC+SBR+PS + SrsAacObjectTypeHEV2 = 29, }; +std::string srs_codec_aac_object2str(SrsAacObjectType aac_object); // ts/hls/adts audio header profile to RTMP sequence header object type. SrsAacObjectType srs_codec_aac_ts2rtmp(SrsAacProfile profile); // RTMP sequence header object type to ts/hls/adts audio header profile.