diff --git a/LICENSE b/LICENSE
index 63c5b72e8..ed59f8cfc 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2013-2019 Winlin
+Copyright (c) 2013-2020 Winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/README.md b/README.md
index 88c2d8e15..e4d4c2166 100755
--- a/README.md
+++ b/README.md
@@ -148,6 +148,10 @@ For previous versions, please read:
## V3 changes
+* v3.0, 2019-12-30, Fix mp4 security issue, check buffer when required size is variable.
+* v3.0, 2019-12-29, [3.0 alpha7(3.0.90)][r3.0a7] released. 116356 lines.
+* v3.0, 2019-12-29, For [#1255][bug #1255], support vhost/domain in query string for HTTP streaming. 3.0.90
+* v3.0, 2019-12-29, For [#299][bug #299], increase dash segment size for avsync issue. 3.0.89
* v3.0, 2019-12-27, For [#299][bug #299], fix some bugs in dash, it works now. 3.0.88
* v3.0, 2019-12-27, For [#1544][bug #1544], fix memory leaking for complex error. 3.0.87
* v3.0, 2019-12-27, Add links for flv.js, hls.js and dash.js.
@@ -700,7 +704,8 @@ For previous versions, please read:
## Releases
-* 2019-12-19, [Release v3.0-a6][r3.0a6], 3.0 alpha6, 3.0.85, 116056 lines.
+* 2019-12-29, [Release v3.0-a7][r3.0a7], 3.0 alpha7, 3.0.90, 116356 lines.
+* 2019-12-26, [Release v3.0-a6][r3.0a6], 3.0 alpha6, 3.0.85, 116056 lines.
* 2019-12-19, [Release v3.0-a5][r3.0a5], 3.0 alpha5, 3.0.75, 115362 lines.
* 2019-12-13, [Release v3.0-a4][r3.0a4], 3.0 alpha4, 3.0.71, 112928 lines.
* 2019-11-30, [Release v3.0-a3][r3.0a3], 3.0 alpha3, 3.0.67, 110864 lines.
@@ -1574,6 +1579,7 @@ Winlin
[bug #1282]: https://github.com/ossrs/srs/issues/1282
[bug #1105]: https://github.com/ossrs/srs/issues/1105
[bug #1544]: https://github.com/ossrs/srs/issues/1544
+[bug #1255]: https://github.com/ossrs/srs/issues/1255
[bug #xxxxxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxxxxx
[bug #1111]: https://github.com/ossrs/srs/issues/1111
@@ -1582,6 +1588,7 @@ Winlin
[exo #828]: https://github.com/google/ExoPlayer/pull/828
+[r3.0a7]: https://github.com/ossrs/srs/releases/tag/v3.0-a7
[r3.0a6]: https://github.com/ossrs/srs/releases/tag/v3.0-a6
[r3.0a5]: https://github.com/ossrs/srs/releases/tag/v3.0-a5
[r3.0a4]: https://github.com/ossrs/srs/releases/tag/v3.0-a4
diff --git a/trunk/conf/full.conf b/trunk/conf/full.conf
index e706aed5c..1160877a4 100644
--- a/trunk/conf/full.conf
+++ b/trunk/conf/full.conf
@@ -965,14 +965,14 @@ vhost dash.srs.com {
# Default: off
enabled on;
# The duration of segment in seconds.
- # Default: 3
- dash_fragment 3;
- # The period to update the MPD in seconds.
# Default: 30
- dash_update_period 30;
+ dash_fragment 30;
+ # The period to update the MPD in seconds.
+ # Default: 150
+ dash_update_period 150;
# The depth of timeshift buffer in seconds.
- # Default: 60
- dash_timeshift 60;
+ # Default: 300
+ dash_timeshift 300;
# The base/home dir/path for dash.
# All init and segment files will write under this dir.
dash_path ./objs/nginx/html;
diff --git a/trunk/configure b/trunk/configure
index 84fd651d3..3b366397f 100755
--- a/trunk/configure
+++ b/trunk/configure
@@ -323,7 +323,7 @@ fi
if [ $SRS_UTEST = YES ]; then
MODULE_FILES=("srs_utest" "srs_utest_amf0" "srs_utest_protocol" "srs_utest_kernel" "srs_utest_core"
"srs_utest_config" "srs_utest_rtmp" "srs_utest_http" "srs_utest_avc" "srs_utest_reload"
- "srs_utest_service" "srs_utest_app")
+ "srs_utest_mp4" "srs_utest_service" "srs_utest_app")
ModuleLibIncs=(${SRS_OBJS_DIR} ${LibSTRoot} ${LibSSLRoot})
ModuleLibFiles=(${LibSTfile} ${LibSSLfile})
MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL" "SERVICE" "APP")
diff --git a/trunk/src/app/srs_app_async_call.cpp b/trunk/src/app/srs_app_async_call.cpp
index 905873bf7..42df06b5d 100644
--- a/trunk/src/app/srs_app_async_call.cpp
+++ b/trunk/src/app/srs_app_async_call.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_async_call.hpp b/trunk/src/app/srs_app_async_call.hpp
index bcadd891f..4576f312e 100644
--- a/trunk/src/app/srs_app_async_call.hpp
+++ b/trunk/src/app/srs_app_async_call.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_bandwidth.cpp b/trunk/src/app/srs_app_bandwidth.cpp
index da4d7dcb8..f89cabe03 100644
--- a/trunk/src/app/srs_app_bandwidth.cpp
+++ b/trunk/src/app/srs_app_bandwidth.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_bandwidth.hpp b/trunk/src/app/srs_app_bandwidth.hpp
index 4c8365cd6..641d416eb 100644
--- a/trunk/src/app/srs_app_bandwidth.hpp
+++ b/trunk/src/app/srs_app_bandwidth.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_caster_flv.cpp b/trunk/src/app/srs_app_caster_flv.cpp
index d3b96de46..7526921cc 100644
--- a/trunk/src/app/srs_app_caster_flv.cpp
+++ b/trunk/src/app/srs_app_caster_flv.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_caster_flv.hpp b/trunk/src/app/srs_app_caster_flv.hpp
index 0db9a4588..9a251d32c 100644
--- a/trunk/src/app/srs_app_caster_flv.hpp
+++ b/trunk/src/app/srs_app_caster_flv.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_config.cpp b/trunk/src/app/srs_app_config.cpp
index 1a790627a..1b4db7946 100644
--- a/trunk/src/app/srs_app_config.cpp
+++ b/trunk/src/app/srs_app_config.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
@@ -5810,7 +5810,7 @@ bool SrsConfig::get_dash_enabled(string vhost)
srs_utime_t SrsConfig::get_dash_fragment(string vhost)
{
- static int DEFAULT = 3 * SRS_UTIME_SECONDS;
+ static int DEFAULT = 30 * SRS_UTIME_SECONDS;
SrsConfDirective* conf = get_dash(vhost);
if (!conf) {
@@ -5827,7 +5827,7 @@ srs_utime_t SrsConfig::get_dash_fragment(string vhost)
srs_utime_t SrsConfig::get_dash_update_period(string vhost)
{
- static srs_utime_t DEFAULT = 30 * SRS_UTIME_SECONDS;
+ static srs_utime_t DEFAULT = 150 * SRS_UTIME_SECONDS;
SrsConfDirective* conf = get_dash(vhost);
if (!conf) {
@@ -5844,7 +5844,7 @@ srs_utime_t SrsConfig::get_dash_update_period(string vhost)
srs_utime_t SrsConfig::get_dash_timeshift(string vhost)
{
- static srs_utime_t DEFAULT = 60 * SRS_UTIME_SECONDS;
+ static srs_utime_t DEFAULT = 300 * SRS_UTIME_SECONDS;
SrsConfDirective* conf = get_dash(vhost);
if (!conf) {
diff --git a/trunk/src/app/srs_app_config.hpp b/trunk/src/app/srs_app_config.hpp
index 426b727ad..c5a91740c 100644
--- a/trunk/src/app/srs_app_config.hpp
+++ b/trunk/src/app/srs_app_config.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_conn.cpp b/trunk/src/app/srs_app_conn.cpp
index 015292e26..adfa17fe5 100644
--- a/trunk/src/app/srs_app_conn.cpp
+++ b/trunk/src/app/srs_app_conn.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_conn.hpp b/trunk/src/app/srs_app_conn.hpp
index 272b3664c..0ea514a11 100644
--- a/trunk/src/app/srs_app_conn.hpp
+++ b/trunk/src/app/srs_app_conn.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_coworkers.cpp b/trunk/src/app/srs_app_coworkers.cpp
index 2dae87871..16b2dae8d 100644
--- a/trunk/src/app/srs_app_coworkers.cpp
+++ b/trunk/src/app/srs_app_coworkers.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_coworkers.hpp b/trunk/src/app/srs_app_coworkers.hpp
index c25f1f300..6b640bf45 100644
--- a/trunk/src/app/srs_app_coworkers.hpp
+++ b/trunk/src/app/srs_app_coworkers.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_dash.cpp b/trunk/src/app/srs_app_dash.cpp
index 08296a083..40e9a9c53 100644
--- a/trunk/src/app/srs_app_dash.cpp
+++ b/trunk/src/app/srs_app_dash.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
@@ -363,7 +363,18 @@ void SrsDashController::on_unpublish()
{
mpd->on_unpublish();
+ srs_error_t err = srs_success;
+
+ if ((err = vcurrent->reap(video_dts)) != srs_success) {
+ srs_warn("reap video err %s", srs_error_desc(err).c_str());
+ srs_freep(err);
+ }
srs_freep(vcurrent);
+
+ if ((err = acurrent->reap(audio_dts)) != srs_success) {
+ srs_warn("reap audio err %s", srs_error_desc(err).c_str());
+ srs_freep(err);
+ }
srs_freep(acurrent);
}
diff --git a/trunk/src/app/srs_app_dash.hpp b/trunk/src/app/srs_app_dash.hpp
index 0cb6bbc46..775ae9d87 100644
--- a/trunk/src/app/srs_app_dash.hpp
+++ b/trunk/src/app/srs_app_dash.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_dvr.cpp b/trunk/src/app/srs_app_dvr.cpp
index 35275994d..d29d22a23 100644
--- a/trunk/src/app/srs_app_dvr.cpp
+++ b/trunk/src/app/srs_app_dvr.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_dvr.hpp b/trunk/src/app/srs_app_dvr.hpp
index 0b66b521b..62ea1cb1e 100644
--- a/trunk/src/app/srs_app_dvr.hpp
+++ b/trunk/src/app/srs_app_dvr.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_edge.cpp b/trunk/src/app/srs_app_edge.cpp
index a2d95e706..8d9d116a8 100644
--- a/trunk/src/app/srs_app_edge.cpp
+++ b/trunk/src/app/srs_app_edge.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_edge.hpp b/trunk/src/app/srs_app_edge.hpp
index f9ead1f63..4c7249614 100644
--- a/trunk/src/app/srs_app_edge.hpp
+++ b/trunk/src/app/srs_app_edge.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_empty.cpp b/trunk/src/app/srs_app_empty.cpp
index aeaa35e65..a89c4e966 100644
--- a/trunk/src/app/srs_app_empty.cpp
+++ b/trunk/src/app/srs_app_empty.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_empty.hpp b/trunk/src/app/srs_app_empty.hpp
index f4e4ecc62..33bf116cd 100644
--- a/trunk/src/app/srs_app_empty.hpp
+++ b/trunk/src/app/srs_app_empty.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_encoder.cpp b/trunk/src/app/srs_app_encoder.cpp
index d3d2c9f5f..be3bb0263 100644
--- a/trunk/src/app/srs_app_encoder.cpp
+++ b/trunk/src/app/srs_app_encoder.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_encoder.hpp b/trunk/src/app/srs_app_encoder.hpp
index c66724bcf..1969547b8 100644
--- a/trunk/src/app/srs_app_encoder.hpp
+++ b/trunk/src/app/srs_app_encoder.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_ffmpeg.cpp b/trunk/src/app/srs_app_ffmpeg.cpp
index ab382bae2..1712f617d 100644
--- a/trunk/src/app/srs_app_ffmpeg.cpp
+++ b/trunk/src/app/srs_app_ffmpeg.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_ffmpeg.hpp b/trunk/src/app/srs_app_ffmpeg.hpp
index 77c1aab1e..a158d957e 100644
--- a/trunk/src/app/srs_app_ffmpeg.hpp
+++ b/trunk/src/app/srs_app_ffmpeg.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_forward.cpp b/trunk/src/app/srs_app_forward.cpp
index 94e11e203..339d12bde 100755
--- a/trunk/src/app/srs_app_forward.cpp
+++ b/trunk/src/app/srs_app_forward.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_forward.hpp b/trunk/src/app/srs_app_forward.hpp
index c23cd8da1..9b50f89d7 100644
--- a/trunk/src/app/srs_app_forward.hpp
+++ b/trunk/src/app/srs_app_forward.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_fragment.cpp b/trunk/src/app/srs_app_fragment.cpp
index 647853dc9..a6075b22d 100644
--- a/trunk/src/app/srs_app_fragment.cpp
+++ b/trunk/src/app/srs_app_fragment.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_fragment.hpp b/trunk/src/app/srs_app_fragment.hpp
index c7c1125ec..22d938c9e 100644
--- a/trunk/src/app/srs_app_fragment.hpp
+++ b/trunk/src/app/srs_app_fragment.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_hds.cpp b/trunk/src/app/srs_app_hds.cpp
index 3517fb84c..a260e9470 100644
--- a/trunk/src/app/srs_app_hds.cpp
+++ b/trunk/src/app/srs_app_hds.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_hds.hpp b/trunk/src/app/srs_app_hds.hpp
index 0fb5b30e7..93ef16a17 100644
--- a/trunk/src/app/srs_app_hds.hpp
+++ b/trunk/src/app/srs_app_hds.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_heartbeat.cpp b/trunk/src/app/srs_app_heartbeat.cpp
index 2cf42bebe..c8c045c6f 100644
--- a/trunk/src/app/srs_app_heartbeat.cpp
+++ b/trunk/src/app/srs_app_heartbeat.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_heartbeat.hpp b/trunk/src/app/srs_app_heartbeat.hpp
index 32d7b97dc..30f6ec332 100644
--- a/trunk/src/app/srs_app_heartbeat.hpp
+++ b/trunk/src/app/srs_app_heartbeat.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_hls.cpp b/trunk/src/app/srs_app_hls.cpp
index e12a56daf..0f18f74a5 100644
--- a/trunk/src/app/srs_app_hls.cpp
+++ b/trunk/src/app/srs_app_hls.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_hls.hpp b/trunk/src/app/srs_app_hls.hpp
index 2e6adebe2..194c183fb 100644
--- a/trunk/src/app/srs_app_hls.hpp
+++ b/trunk/src/app/srs_app_hls.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_hourglass.cpp b/trunk/src/app/srs_app_hourglass.cpp
index f95a9c01a..88aeb2612 100644
--- a/trunk/src/app/srs_app_hourglass.cpp
+++ b/trunk/src/app/srs_app_hourglass.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_hourglass.hpp b/trunk/src/app/srs_app_hourglass.hpp
index 6a0f624e6..3c8447d4c 100644
--- a/trunk/src/app/srs_app_hourglass.hpp
+++ b/trunk/src/app/srs_app_hourglass.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_http_api.cpp b/trunk/src/app/srs_app_http_api.cpp
index e672a27c8..5355068eb 100644
--- a/trunk/src/app/srs_app_http_api.cpp
+++ b/trunk/src/app/srs_app_http_api.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_http_api.hpp b/trunk/src/app/srs_app_http_api.hpp
index 62e3aca02..5957ff2f3 100644
--- a/trunk/src/app/srs_app_http_api.hpp
+++ b/trunk/src/app/srs_app_http_api.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_http_client.cpp b/trunk/src/app/srs_app_http_client.cpp
index 5c722cc70..c661a5a81 100644
--- a/trunk/src/app/srs_app_http_client.cpp
+++ b/trunk/src/app/srs_app_http_client.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_http_client.hpp b/trunk/src/app/srs_app_http_client.hpp
index 430d6e5fd..5407987ab 100644
--- a/trunk/src/app/srs_app_http_client.hpp
+++ b/trunk/src/app/srs_app_http_client.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_http_conn.cpp b/trunk/src/app/srs_app_http_conn.cpp
index 68663cdb8..fc1831aa4 100644
--- a/trunk/src/app/srs_app_http_conn.cpp
+++ b/trunk/src/app/srs_app_http_conn.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_http_conn.hpp b/trunk/src/app/srs_app_http_conn.hpp
index 40e97f728..f3de6659e 100644
--- a/trunk/src/app/srs_app_http_conn.hpp
+++ b/trunk/src/app/srs_app_http_conn.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_http_hooks.cpp b/trunk/src/app/srs_app_http_hooks.cpp
index 241eb8976..9fc2292c0 100644
--- a/trunk/src/app/srs_app_http_hooks.cpp
+++ b/trunk/src/app/srs_app_http_hooks.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_http_hooks.hpp b/trunk/src/app/srs_app_http_hooks.hpp
index a3579cd34..000780c44 100644
--- a/trunk/src/app/srs_app_http_hooks.hpp
+++ b/trunk/src/app/srs_app_http_hooks.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_http_static.cpp b/trunk/src/app/srs_app_http_static.cpp
index dc4354ed0..04724bdab 100644
--- a/trunk/src/app/srs_app_http_static.cpp
+++ b/trunk/src/app/srs_app_http_static.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_http_static.hpp b/trunk/src/app/srs_app_http_static.hpp
index 61e153953..acc0512af 100644
--- a/trunk/src/app/srs_app_http_static.hpp
+++ b/trunk/src/app/srs_app_http_static.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_http_stream.cpp b/trunk/src/app/srs_app_http_stream.cpp
index 1f4064528..21d84be59 100755
--- a/trunk/src/app/srs_app_http_stream.cpp
+++ b/trunk/src/app/srs_app_http_stream.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_http_stream.hpp b/trunk/src/app/srs_app_http_stream.hpp
index d04c05df4..cc1d23ed1 100755
--- a/trunk/src/app/srs_app_http_stream.hpp
+++ b/trunk/src/app/srs_app_http_stream.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_ingest.cpp b/trunk/src/app/srs_app_ingest.cpp
index 1b10a9765..edaaa0c8a 100644
--- a/trunk/src/app/srs_app_ingest.cpp
+++ b/trunk/src/app/srs_app_ingest.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_ingest.hpp b/trunk/src/app/srs_app_ingest.hpp
index 2314bc726..2bef9ba7b 100644
--- a/trunk/src/app/srs_app_ingest.hpp
+++ b/trunk/src/app/srs_app_ingest.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_listener.cpp b/trunk/src/app/srs_app_listener.cpp
index 1468272a0..b33b4f6f8 100755
--- a/trunk/src/app/srs_app_listener.cpp
+++ b/trunk/src/app/srs_app_listener.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_listener.hpp b/trunk/src/app/srs_app_listener.hpp
index 99da48bda..d7d930e91 100644
--- a/trunk/src/app/srs_app_listener.hpp
+++ b/trunk/src/app/srs_app_listener.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_log.cpp b/trunk/src/app/srs_app_log.cpp
index d5523dbda..eeba11186 100644
--- a/trunk/src/app/srs_app_log.cpp
+++ b/trunk/src/app/srs_app_log.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_log.hpp b/trunk/src/app/srs_app_log.hpp
index c1618243c..f54ceb29f 100644
--- a/trunk/src/app/srs_app_log.hpp
+++ b/trunk/src/app/srs_app_log.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_mpegts_udp.cpp b/trunk/src/app/srs_app_mpegts_udp.cpp
index 6d4e09019..8b81f14aa 100644
--- a/trunk/src/app/srs_app_mpegts_udp.cpp
+++ b/trunk/src/app/srs_app_mpegts_udp.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_mpegts_udp.hpp b/trunk/src/app/srs_app_mpegts_udp.hpp
index b14eb775e..e0b2ad517 100644
--- a/trunk/src/app/srs_app_mpegts_udp.hpp
+++ b/trunk/src/app/srs_app_mpegts_udp.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_ng_exec.cpp b/trunk/src/app/srs_app_ng_exec.cpp
index 35190480d..a1e613c8e 100644
--- a/trunk/src/app/srs_app_ng_exec.cpp
+++ b/trunk/src/app/srs_app_ng_exec.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_ng_exec.hpp b/trunk/src/app/srs_app_ng_exec.hpp
index 8cdf1e96d..901aa9535 100644
--- a/trunk/src/app/srs_app_ng_exec.hpp
+++ b/trunk/src/app/srs_app_ng_exec.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_pithy_print.cpp b/trunk/src/app/srs_app_pithy_print.cpp
index 49170707f..f31b44e51 100644
--- a/trunk/src/app/srs_app_pithy_print.cpp
+++ b/trunk/src/app/srs_app_pithy_print.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_pithy_print.hpp b/trunk/src/app/srs_app_pithy_print.hpp
index 4d1e26741..b2494b926 100644
--- a/trunk/src/app/srs_app_pithy_print.hpp
+++ b/trunk/src/app/srs_app_pithy_print.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_process.cpp b/trunk/src/app/srs_app_process.cpp
index e5d4704be..8975c0b69 100644
--- a/trunk/src/app/srs_app_process.cpp
+++ b/trunk/src/app/srs_app_process.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_process.hpp b/trunk/src/app/srs_app_process.hpp
index 62e95129c..09e071aec 100644
--- a/trunk/src/app/srs_app_process.hpp
+++ b/trunk/src/app/srs_app_process.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_recv_thread.cpp b/trunk/src/app/srs_app_recv_thread.cpp
index 8034da82d..d68185ba7 100644
--- a/trunk/src/app/srs_app_recv_thread.cpp
+++ b/trunk/src/app/srs_app_recv_thread.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_recv_thread.hpp b/trunk/src/app/srs_app_recv_thread.hpp
index 65206353f..2a27a7319 100644
--- a/trunk/src/app/srs_app_recv_thread.hpp
+++ b/trunk/src/app/srs_app_recv_thread.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_refer.cpp b/trunk/src/app/srs_app_refer.cpp
index e126ec05e..ff4e4be28 100644
--- a/trunk/src/app/srs_app_refer.cpp
+++ b/trunk/src/app/srs_app_refer.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_refer.hpp b/trunk/src/app/srs_app_refer.hpp
index 7b348e890..0e0967971 100644
--- a/trunk/src/app/srs_app_refer.hpp
+++ b/trunk/src/app/srs_app_refer.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_reload.cpp b/trunk/src/app/srs_app_reload.cpp
index 6a92b902f..175cbfc14 100644
--- a/trunk/src/app/srs_app_reload.cpp
+++ b/trunk/src/app/srs_app_reload.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_reload.hpp b/trunk/src/app/srs_app_reload.hpp
index 6ffc10d07..442f44ebd 100644
--- a/trunk/src/app/srs_app_reload.hpp
+++ b/trunk/src/app/srs_app_reload.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_rtmp_conn.cpp b/trunk/src/app/srs_app_rtmp_conn.cpp
index 3a0a79281..6ed6ca712 100644
--- a/trunk/src/app/srs_app_rtmp_conn.cpp
+++ b/trunk/src/app/srs_app_rtmp_conn.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_rtmp_conn.hpp b/trunk/src/app/srs_app_rtmp_conn.hpp
index 100fb0025..ac4b7efb9 100644
--- a/trunk/src/app/srs_app_rtmp_conn.hpp
+++ b/trunk/src/app/srs_app_rtmp_conn.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_rtsp.cpp b/trunk/src/app/srs_app_rtsp.cpp
index 4f5fb7b6a..051071b49 100644
--- a/trunk/src/app/srs_app_rtsp.cpp
+++ b/trunk/src/app/srs_app_rtsp.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_rtsp.hpp b/trunk/src/app/srs_app_rtsp.hpp
index 7a1ac77fc..7bbd52651 100644
--- a/trunk/src/app/srs_app_rtsp.hpp
+++ b/trunk/src/app/srs_app_rtsp.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_security.cpp b/trunk/src/app/srs_app_security.cpp
index 362672c0f..06e886fc7 100644
--- a/trunk/src/app/srs_app_security.cpp
+++ b/trunk/src/app/srs_app_security.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_security.hpp b/trunk/src/app/srs_app_security.hpp
index 31bdcc709..e336f1a90 100644
--- a/trunk/src/app/srs_app_security.hpp
+++ b/trunk/src/app/srs_app_security.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_server.cpp b/trunk/src/app/srs_app_server.cpp
index 33f571d32..8c6d21470 100644
--- a/trunk/src/app/srs_app_server.cpp
+++ b/trunk/src/app/srs_app_server.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_server.hpp b/trunk/src/app/srs_app_server.hpp
index aad92c653..fd8cbe3ad 100644
--- a/trunk/src/app/srs_app_server.hpp
+++ b/trunk/src/app/srs_app_server.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_source.cpp b/trunk/src/app/srs_app_source.cpp
index 22b267d02..788773c80 100755
--- a/trunk/src/app/srs_app_source.cpp
+++ b/trunk/src/app/srs_app_source.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_source.hpp b/trunk/src/app/srs_app_source.hpp
index 613c7240f..847857f33 100644
--- a/trunk/src/app/srs_app_source.hpp
+++ b/trunk/src/app/srs_app_source.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_st.cpp b/trunk/src/app/srs_app_st.cpp
index a7219f820..1e6ae4371 100755
--- a/trunk/src/app/srs_app_st.cpp
+++ b/trunk/src/app/srs_app_st.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_st.hpp b/trunk/src/app/srs_app_st.hpp
index e5120de95..131ec697c 100644
--- a/trunk/src/app/srs_app_st.hpp
+++ b/trunk/src/app/srs_app_st.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_statistic.cpp b/trunk/src/app/srs_app_statistic.cpp
index 3b63c6659..b180d20a1 100644
--- a/trunk/src/app/srs_app_statistic.cpp
+++ b/trunk/src/app/srs_app_statistic.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_statistic.hpp b/trunk/src/app/srs_app_statistic.hpp
index c9e475ace..fa8835849 100644
--- a/trunk/src/app/srs_app_statistic.hpp
+++ b/trunk/src/app/srs_app_statistic.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_thread.cpp b/trunk/src/app/srs_app_thread.cpp
index dfd4e9d6e..19a2b6535 100755
--- a/trunk/src/app/srs_app_thread.cpp
+++ b/trunk/src/app/srs_app_thread.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_thread.hpp b/trunk/src/app/srs_app_thread.hpp
index 2d542d941..8aa384a3d 100644
--- a/trunk/src/app/srs_app_thread.hpp
+++ b/trunk/src/app/srs_app_thread.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_utility.cpp b/trunk/src/app/srs_app_utility.cpp
index 9c6343860..9374f4e4b 100644
--- a/trunk/src/app/srs_app_utility.cpp
+++ b/trunk/src/app/srs_app_utility.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/app/srs_app_utility.hpp b/trunk/src/app/srs_app_utility.hpp
index 5e4d09afe..26da0106d 100644
--- a/trunk/src/app/srs_app_utility.hpp
+++ b/trunk/src/app/srs_app_utility.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/core/srs_core.cpp b/trunk/src/core/srs_core.cpp
index 55a932f09..57259c0de 100644
--- a/trunk/src/core/srs_core.cpp
+++ b/trunk/src/core/srs_core.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp
index 021b75c20..fe7692e58 100644
--- a/trunk/src/core/srs_core.hpp
+++ b/trunk/src/core/srs_core.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
@@ -27,7 +27,7 @@
// The version config.
#define VERSION_MAJOR 3
#define VERSION_MINOR 0
-#define VERSION_REVISION 88
+#define VERSION_REVISION 90
// The macros generated by configure script.
#include
diff --git a/trunk/src/core/srs_core_autofree.cpp b/trunk/src/core/srs_core_autofree.cpp
index d56d79a47..8e2583294 100644
--- a/trunk/src/core/srs_core_autofree.cpp
+++ b/trunk/src/core/srs_core_autofree.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/core/srs_core_autofree.hpp b/trunk/src/core/srs_core_autofree.hpp
index 7844eed68..ac1df6f7d 100644
--- a/trunk/src/core/srs_core_autofree.hpp
+++ b/trunk/src/core/srs_core_autofree.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/core/srs_core_mem_watch.cpp b/trunk/src/core/srs_core_mem_watch.cpp
index f43a2c626..701795fa9 100644
--- a/trunk/src/core/srs_core_mem_watch.cpp
+++ b/trunk/src/core/srs_core_mem_watch.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/core/srs_core_mem_watch.hpp b/trunk/src/core/srs_core_mem_watch.hpp
index 7339d5c6a..d10bbb675 100644
--- a/trunk/src/core/srs_core_mem_watch.hpp
+++ b/trunk/src/core/srs_core_mem_watch.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/core/srs_core_performance.cpp b/trunk/src/core/srs_core_performance.cpp
index 9e9f58799..80b22b71e 100644
--- a/trunk/src/core/srs_core_performance.cpp
+++ b/trunk/src/core/srs_core_performance.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/core/srs_core_performance.hpp b/trunk/src/core/srs_core_performance.hpp
index 285513bb2..28eac85a9 100644
--- a/trunk/src/core/srs_core_performance.hpp
+++ b/trunk/src/core/srs_core_performance.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/core/srs_core_time.cpp b/trunk/src/core/srs_core_time.cpp
index 32ee3208c..86d360975 100644
--- a/trunk/src/core/srs_core_time.cpp
+++ b/trunk/src/core/srs_core_time.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/core/srs_core_time.hpp b/trunk/src/core/srs_core_time.hpp
index 42424b3b7..1d0799d42 100644
--- a/trunk/src/core/srs_core_time.hpp
+++ b/trunk/src/core/srs_core_time.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/kernel/srs_kernel_aac.cpp b/trunk/src/kernel/srs_kernel_aac.cpp
index 5302f6f26..95fa34b7b 100644
--- a/trunk/src/kernel/srs_kernel_aac.cpp
+++ b/trunk/src/kernel/srs_kernel_aac.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/kernel/srs_kernel_aac.hpp b/trunk/src/kernel/srs_kernel_aac.hpp
index 187e50ad2..770d51408 100644
--- a/trunk/src/kernel/srs_kernel_aac.hpp
+++ b/trunk/src/kernel/srs_kernel_aac.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/kernel/srs_kernel_balance.cpp b/trunk/src/kernel/srs_kernel_balance.cpp
index 556187dae..6446abd67 100644
--- a/trunk/src/kernel/srs_kernel_balance.cpp
+++ b/trunk/src/kernel/srs_kernel_balance.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/kernel/srs_kernel_balance.hpp b/trunk/src/kernel/srs_kernel_balance.hpp
index 5efc89514..a5066ca8b 100644
--- a/trunk/src/kernel/srs_kernel_balance.hpp
+++ b/trunk/src/kernel/srs_kernel_balance.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/kernel/srs_kernel_buffer.cpp b/trunk/src/kernel/srs_kernel_buffer.cpp
index 80cc6055e..0f0b9e1dc 100644
--- a/trunk/src/kernel/srs_kernel_buffer.cpp
+++ b/trunk/src/kernel/srs_kernel_buffer.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/kernel/srs_kernel_buffer.hpp b/trunk/src/kernel/srs_kernel_buffer.hpp
index 5bbc420c4..3fdb7e74b 100644
--- a/trunk/src/kernel/srs_kernel_buffer.hpp
+++ b/trunk/src/kernel/srs_kernel_buffer.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/kernel/srs_kernel_codec.cpp b/trunk/src/kernel/srs_kernel_codec.cpp
index 0bca66537..6d0cb0dcd 100644
--- a/trunk/src/kernel/srs_kernel_codec.cpp
+++ b/trunk/src/kernel/srs_kernel_codec.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/kernel/srs_kernel_codec.hpp b/trunk/src/kernel/srs_kernel_codec.hpp
index aac1c1395..e25442edc 100644
--- a/trunk/src/kernel/srs_kernel_codec.hpp
+++ b/trunk/src/kernel/srs_kernel_codec.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/kernel/srs_kernel_consts.cpp b/trunk/src/kernel/srs_kernel_consts.cpp
index 17a722f59..9c2be32af 100644
--- a/trunk/src/kernel/srs_kernel_consts.cpp
+++ b/trunk/src/kernel/srs_kernel_consts.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/kernel/srs_kernel_consts.hpp b/trunk/src/kernel/srs_kernel_consts.hpp
index 9a75955c4..b470c644e 100644
--- a/trunk/src/kernel/srs_kernel_consts.hpp
+++ b/trunk/src/kernel/srs_kernel_consts.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/kernel/srs_kernel_error.cpp b/trunk/src/kernel/srs_kernel_error.cpp
index 93c0b47e2..8b66f03d5 100644
--- a/trunk/src/kernel/srs_kernel_error.cpp
+++ b/trunk/src/kernel/srs_kernel_error.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/kernel/srs_kernel_error.hpp b/trunk/src/kernel/srs_kernel_error.hpp
index a5c19da61..f7375780a 100644
--- a/trunk/src/kernel/srs_kernel_error.hpp
+++ b/trunk/src/kernel/srs_kernel_error.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/kernel/srs_kernel_file.cpp b/trunk/src/kernel/srs_kernel_file.cpp
index 6ab9b6a54..194a5e00e 100644
--- a/trunk/src/kernel/srs_kernel_file.cpp
+++ b/trunk/src/kernel/srs_kernel_file.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/kernel/srs_kernel_file.hpp b/trunk/src/kernel/srs_kernel_file.hpp
index 0bfc02945..b8ed2a15f 100644
--- a/trunk/src/kernel/srs_kernel_file.hpp
+++ b/trunk/src/kernel/srs_kernel_file.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/kernel/srs_kernel_flv.cpp b/trunk/src/kernel/srs_kernel_flv.cpp
index 64642514b..e897e1b38 100644
--- a/trunk/src/kernel/srs_kernel_flv.cpp
+++ b/trunk/src/kernel/srs_kernel_flv.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/kernel/srs_kernel_flv.hpp b/trunk/src/kernel/srs_kernel_flv.hpp
index 97e1c7e32..0c77a6664 100644
--- a/trunk/src/kernel/srs_kernel_flv.hpp
+++ b/trunk/src/kernel/srs_kernel_flv.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/kernel/srs_kernel_io.cpp b/trunk/src/kernel/srs_kernel_io.cpp
index 2caffbbfa..83bcfe03b 100644
--- a/trunk/src/kernel/srs_kernel_io.cpp
+++ b/trunk/src/kernel/srs_kernel_io.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/kernel/srs_kernel_io.hpp b/trunk/src/kernel/srs_kernel_io.hpp
index f5eae99b6..ace2959fa 100644
--- a/trunk/src/kernel/srs_kernel_io.hpp
+++ b/trunk/src/kernel/srs_kernel_io.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/kernel/srs_kernel_log.cpp b/trunk/src/kernel/srs_kernel_log.cpp
index ad0fe2a0b..1b2bfcfef 100644
--- a/trunk/src/kernel/srs_kernel_log.cpp
+++ b/trunk/src/kernel/srs_kernel_log.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/kernel/srs_kernel_log.hpp b/trunk/src/kernel/srs_kernel_log.hpp
index 23d4399c4..1d7af37bb 100644
--- a/trunk/src/kernel/srs_kernel_log.hpp
+++ b/trunk/src/kernel/srs_kernel_log.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/kernel/srs_kernel_mp3.cpp b/trunk/src/kernel/srs_kernel_mp3.cpp
index e49262315..52e555090 100644
--- a/trunk/src/kernel/srs_kernel_mp3.cpp
+++ b/trunk/src/kernel/srs_kernel_mp3.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/kernel/srs_kernel_mp3.hpp b/trunk/src/kernel/srs_kernel_mp3.hpp
index 43676e725..66f32751e 100644
--- a/trunk/src/kernel/srs_kernel_mp3.hpp
+++ b/trunk/src/kernel/srs_kernel_mp3.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/kernel/srs_kernel_mp4.cpp b/trunk/src/kernel/srs_kernel_mp4.cpp
index fef9549ea..fd4778e67 100644
--- a/trunk/src/kernel/srs_kernel_mp4.cpp
+++ b/trunk/src/kernel/srs_kernel_mp4.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
@@ -41,7 +41,28 @@ using namespace std;
#define SRS_MP4_BUF_SIZE 4096
-stringstream& srs_padding(stringstream& ss, SrsMp4DumpContext dc, int tab = 4)
+srs_error_t srs_mp4_write_box(ISrsWriter* writer, ISrsCodec* box)
+{
+ srs_error_t err = srs_success;
+
+ int nb_data = box->nb_bytes();
+ std::vector data(nb_data);
+
+ SrsBuffer* buffer = new SrsBuffer(&data[0], nb_data);
+ SrsAutoFree(SrsBuffer, buffer);
+
+ if ((err = box->encode(buffer)) != srs_success) {
+ return srs_error_wrap(err, "encode box");
+ }
+
+ if ((err = writer->write(&data[0], nb_data, NULL)) != srs_success) {
+ return srs_error_wrap(err, "write box");
+ }
+
+ return err;
+}
+
+stringstream& srs_mp4_padding(stringstream& ss, SrsMp4DumpContext dc, int tab)
{
for (int i = 0; i < (int)dc.level; i++) {
for (int j = 0; j < tab; j++) {
@@ -57,127 +78,36 @@ stringstream& srs_print_mp4_type(stringstream& ss, uint32_t v)
return ss;
}
-#define SrsSummaryCount 8
-
-template
-stringstream& srs_dumps_array(std::vector&arr, stringstream& ss, SrsMp4DumpContext dc,
- void (*pfn)(T&, stringstream&, SrsMp4DumpContext),
- void (*delimiter)(stringstream&,SrsMp4DumpContext))
+stringstream& srs_mp4_print_bytes(stringstream& ss, const char* p, int size, SrsMp4DumpContext dc, int line, int max)
{
- int limit = arr.size();
- if (dc.summary) {
- limit = srs_min(SrsSummaryCount, limit);
- }
-
- for (size_t i = 0; i < (size_t)limit; i++) {
- T& elem = arr[i];
-
- pfn(elem, ss, dc);
-
- if (i < limit - 1) {
- delimiter(ss, dc);
+ int limit = srs_min((max<0?size:max), size);
+
+ for (int i = 0; i < (int)limit; i += line) {
+ int nn_line_elems = srs_min(line, limit-i);
+ srs_dumps_array(p+i, nn_line_elems, ss, dc, srs_mp4_pfn_hex, srs_mp4_delimiter_inspace);
+
+ if (i + line < limit) {
+ ss << "," << endl;
+ srs_mp4_padding(ss, dc);
}
}
return ss;
}
-template
-stringstream& srs_dumps_array(T* arr, int size, stringstream& ss, SrsMp4DumpContext dc,
- void (*pfn)(T&, stringstream&, SrsMp4DumpContext),
- void (*delimiter)(stringstream&, SrsMp4DumpContext))
-{
- int limit = size;
- if (dc.summary) {
- limit = srs_min(SrsSummaryCount, limit);
- }
-
- for (size_t i = 0; i < (size_t)limit; i++) {
- T& elem = arr[i];
-
- pfn(elem, ss, dc);
-
- if (i < limit - 1) {
- delimiter(ss, dc);
- }
- }
- return ss;
-}
-
-void srs_delimiter_inline(stringstream& ss, SrsMp4DumpContext dc)
+void srs_mp4_delimiter_inline(stringstream& ss, SrsMp4DumpContext dc)
{
ss << ",";
}
-void srs_delimiter_inlinespace(stringstream& ss, SrsMp4DumpContext dc)
+void srs_mp4_delimiter_inspace(stringstream& ss, SrsMp4DumpContext dc)
{
ss << ", ";
}
-void srs_delimiter_newline(stringstream& ss, SrsMp4DumpContext dc)
+void srs_mp4_delimiter_newline(stringstream& ss, SrsMp4DumpContext dc)
{
ss << endl;
- srs_padding(ss, dc);
-}
-
-template
-void srs_pfn_box(T& elem, stringstream& ss, SrsMp4DumpContext dc)
-{
- elem.dumps(ss, dc);
-}
-
-template
-void srs_pfn_detail(T& elem, stringstream& ss, SrsMp4DumpContext dc)
-{
- elem.dumps_detail(ss, dc);
-}
-
-template
-void srs_pfn_pbox(T*& elem, stringstream& ss, SrsMp4DumpContext dc)
-{
- elem->dumps(ss, dc);
-}
-
-template
-void srs_pfn_pdetail(T*& elem, stringstream& ss, SrsMp4DumpContext dc)
-{
- elem->dumps_detail(ss, dc);
-}
-
-template
-void srs_pfn_types(T& elem, stringstream& ss, SrsMp4DumpContext dc)
-{
- srs_print_mp4_type(ss, (uint32_t)elem);
-}
-
-template
-void srs_pfn_hex(T& elem, stringstream& ss, SrsMp4DumpContext dc)
-{
- ss << "0x" << std::setw(2) << std::setfill('0') << std::hex << (uint32_t)(uint8_t)elem << std::dec;
-}
-
-template
-void srs_pfn_elems(T& elem, stringstream& ss, SrsMp4DumpContext dc)
-{
- ss << elem;
-}
-
-stringstream& srs_print_bytes(stringstream& ss, const char* p, int size, SrsMp4DumpContext dc, int line = SrsSummaryCount, int max = -1)
-{
- if (max == -1) {
- max = size;
- }
-
- for (int i = 0; i < (int)max; i++) {
- ss << "0x" << std::setw(2) << std::setfill('0') << std::hex << (uint32_t)(uint8_t)p[i] << std::dec;
- if (i < max -1) {
- ss << ", ";
- if (((i+1)%line) == 0) {
- ss << endl;
- srs_padding(ss, dc);
- }
- }
- }
- return ss;
+ srs_mp4_padding(ss, dc);
}
int srs_mp4_string_length(const string& v)
@@ -187,12 +117,9 @@ int srs_mp4_string_length(const string& v)
void srs_mp4_string_write(SrsBuffer* buf, const string& v)
{
- // Nothing for empty string.
- if (v.empty()) {
- return;
+ if (!v.empty()) {
+ buf->write_bytes((char*)v.data(), (int)v.length());
}
-
- buf->write_bytes((char*)v.data(), (int)v.length());
buf->write_1bytes(0x00);
}
@@ -217,6 +144,16 @@ srs_error_t srs_mp4_string_read(SrsBuffer* buf, string& v, int left)
return err;
}
+SrsMp4DumpContext::SrsMp4DumpContext()
+{
+ level = 0;
+ summary = false;
+}
+
+SrsMp4DumpContext::~SrsMp4DumpContext()
+{
+}
+
SrsMp4DumpContext SrsMp4DumpContext::indent()
{
SrsMp4DumpContext ctx = *this;
@@ -253,9 +190,23 @@ int SrsMp4Box::sz_header()
return nb_header();
}
+int SrsMp4Box::update_size()
+{
+ uint64_t size = nb_bytes();
+
+ if (size > 0xffffffff) {
+ largesize = size;
+ } else {
+ smallsize = (uint32_t)size;
+ }
+
+ return (int)size;
+}
+
int SrsMp4Box::left_space(SrsBuffer* buf)
{
- return (int)sz() - (buf->pos() - start_pos);
+ int left = (int)sz() - (buf->pos() - start_pos);
+ return srs_max(0, left);
}
bool SrsMp4Box::is_ftyp()
@@ -297,6 +248,7 @@ int SrsMp4Box::remove(SrsMp4BoxType bt)
if (box->type == bt) {
it = boxes.erase(it);
+ srs_freep(box);
} else {
++it;
}
@@ -305,9 +257,14 @@ int SrsMp4Box::remove(SrsMp4BoxType bt)
return nb_removed;
}
+void SrsMp4Box::append(SrsMp4Box* box)
+{
+ boxes.push_back(box);
+}
+
stringstream& SrsMp4Box::dumps(stringstream& ss, SrsMp4DumpContext dc)
{
- srs_padding(ss, dc);
+ srs_mp4_padding(ss, dc);
srs_print_mp4_type(ss, (uint32_t)type);
ss << ", " << sz();
@@ -411,6 +368,7 @@ srs_error_t SrsMp4Box::discovery(SrsBuffer* buf, SrsMp4Box** ppbox)
case SrsMp4BoxTypeSIDX: box = new SrsMp4SegmentIndexBox(); break;
// Skip some unknown boxes.
case SrsMp4BoxTypeFREE: case SrsMp4BoxTypeSKIP: case SrsMp4BoxTypePASP:
+ case SrsMp4BoxTypeUUID:
box = new SrsMp4FreeSpaceBox(type); break;
default:
err = srs_error_new(ERROR_MP4_BOX_ILLEGAL_TYPE, "illegal box type=%d", type);
@@ -443,13 +401,8 @@ int SrsMp4Box::nb_bytes()
srs_error_t SrsMp4Box::encode(SrsBuffer* buf)
{
srs_error_t err = srs_success;
-
- uint64_t size = nb_bytes();
- if (size > 0xffffffff) {
- largesize = size;
- } else {
- smallsize = (uint32_t)size;
- }
+
+ update_size();
start_pos = buf->pos();
@@ -781,7 +734,7 @@ stringstream& SrsMp4FileTypeBox::dumps_detail(stringstream& ss, SrsMp4DumpContex
if (!compatible_brands.empty()) {
ss << "(";
- srs_dumps_array(compatible_brands, ss, dc, srs_pfn_types, srs_delimiter_inline);
+ srs_dumps_array(compatible_brands, ss, dc, srs_mp4_pfn_type, srs_mp4_delimiter_inline);
ss << ")";
}
return ss;
@@ -1121,7 +1074,7 @@ SrsMp4TrunEntry::~SrsMp4TrunEntry()
{
}
-int SrsMp4TrunEntry::nb_header()
+int SrsMp4TrunEntry::nb_bytes()
{
int size = 0;
@@ -1141,7 +1094,7 @@ int SrsMp4TrunEntry::nb_header()
return size;
}
-srs_error_t SrsMp4TrunEntry::encode_header(SrsBuffer* buf)
+srs_error_t SrsMp4TrunEntry::encode(SrsBuffer* buf)
{
srs_error_t err = srs_success;
@@ -1167,7 +1120,7 @@ srs_error_t SrsMp4TrunEntry::encode_header(SrsBuffer* buf)
return err;
}
-srs_error_t SrsMp4TrunEntry::decode_header(SrsBuffer* buf)
+srs_error_t SrsMp4TrunEntry::decode(SrsBuffer* buf)
{
srs_error_t err = srs_success;
@@ -1193,7 +1146,7 @@ srs_error_t SrsMp4TrunEntry::decode_header(SrsBuffer* buf)
return err;
}
-stringstream& SrsMp4TrunEntry::dumps_detail(stringstream& ss, SrsMp4DumpContext dc)
+stringstream& SrsMp4TrunEntry::dumps(stringstream& ss, SrsMp4DumpContext dc)
{
if ((owner->flags&SrsMp4TrunFlagsSampleDuration) == SrsMp4TrunFlagsSampleDuration) {
ss << "duration=" << sample_duration;
@@ -1213,7 +1166,7 @@ stringstream& SrsMp4TrunEntry::dumps_detail(stringstream& ss, SrsMp4DumpContext
SrsMp4TrackFragmentRunBox::SrsMp4TrackFragmentRunBox()
{
type = SrsMp4BoxTypeTRUN;
- sample_count = first_sample_flags = 0;
+ first_sample_flags = 0;
data_offset = 0;
}
@@ -1240,7 +1193,7 @@ int SrsMp4TrackFragmentRunBox::nb_header()
vector::iterator it;
for (it = entries.begin(); it != entries.end(); ++it) {
SrsMp4TrunEntry* entry = *it;
- size += entry->nb_header();
+ size += entry->nb_bytes();
}
return size;
@@ -1253,7 +1206,8 @@ srs_error_t SrsMp4TrackFragmentRunBox::encode_header(SrsBuffer* buf)
if ((err = SrsMp4FullBox::encode_header(buf)) != srs_success) {
return srs_error_wrap(err, "encode header");
}
-
+
+ uint32_t sample_count = (uint32_t)entries.size();
buf->write_4bytes(sample_count);
if ((flags&SrsMp4TrunFlagsDataOffset) == SrsMp4TrunFlagsDataOffset) {
@@ -1266,7 +1220,7 @@ srs_error_t SrsMp4TrackFragmentRunBox::encode_header(SrsBuffer* buf)
vector::iterator it;
for (it = entries.begin(); it != entries.end(); ++it) {
SrsMp4TrunEntry* entry = *it;
- if ((err = entry->encode_header(buf)) != srs_success) {
+ if ((err = entry->encode(buf)) != srs_success) {
return srs_error_wrap(err, "encode entry");
}
}
@@ -1282,7 +1236,7 @@ srs_error_t SrsMp4TrackFragmentRunBox::decode_header(SrsBuffer* buf)
return srs_error_wrap(err, "decode header");
}
- sample_count = buf->read_4bytes();
+ uint32_t sample_count = buf->read_4bytes();
if ((flags&SrsMp4TrunFlagsDataOffset) == SrsMp4TrunFlagsDataOffset) {
data_offset = buf->read_4bytes();
@@ -1294,8 +1248,12 @@ srs_error_t SrsMp4TrackFragmentRunBox::decode_header(SrsBuffer* buf)
for (int i = 0; i < (int)sample_count; i++) {
SrsMp4TrunEntry* entry = new SrsMp4TrunEntry(this);
entries.push_back(entry);
+
+ if (!buf->require(entry->nb_bytes())) {
+ return srs_error_new(ERROR_MP4_BOX_REQUIRE_SPACE, "trun entry requires %d bytes", entry->nb_bytes());
+ }
- if ((err = entry->decode_header(buf)) != srs_success) {
+ if ((err = entry->decode(buf)) != srs_success) {
return srs_error_wrap(err, "decode entry");
}
}
@@ -1306,7 +1264,8 @@ srs_error_t SrsMp4TrackFragmentRunBox::decode_header(SrsBuffer* buf)
stringstream& SrsMp4TrackFragmentRunBox::dumps_detail(stringstream& ss, SrsMp4DumpContext dc)
{
SrsMp4FullBox::dumps_detail(ss, dc);
-
+
+ uint32_t sample_count = (uint32_t)entries.size();
ss << ", samples=" << sample_count;
if ((flags&SrsMp4TrunFlagsDataOffset) == SrsMp4TrunFlagsDataOffset) {
@@ -1318,8 +1277,8 @@ stringstream& SrsMp4TrackFragmentRunBox::dumps_detail(stringstream& ss, SrsMp4Du
if (sample_count > 0) {
ss << endl;
- srs_padding(ss, dc.indent());
- srs_dumps_array(entries, ss, dc.indent(), srs_pfn_pdetail, srs_delimiter_newline);
+ srs_mp4_padding(ss, dc.indent());
+ srs_dumps_array(entries, ss, dc.indent(), srs_mp4_pfn_box2, srs_mp4_delimiter_newline);
}
return ss;
@@ -1437,8 +1396,8 @@ stringstream& SrsMp4FreeSpaceBox::dumps_detail(stringstream& ss, SrsMp4DumpConte
if (!data.empty()) {
ss << endl;
- srs_padding(ss, dc.indent());
- srs_dumps_array(&data[0], (int)data.size(), ss, dc.indent(), srs_pfn_hex, srs_delimiter_inlinespace);
+ srs_mp4_padding(ss, dc.indent());
+ srs_dumps_array(&data[0], (int)data.size(), ss, dc.indent(), srs_mp4_pfn_hex, srs_mp4_delimiter_inspace);
}
return ss;
}
@@ -2149,13 +2108,22 @@ srs_error_t SrsMp4EditListBox::decode_header(SrsBuffer* buf)
SrsMp4ElstEntry& entry = entries[i];
if (version == 1) {
+ if (!buf->require(16)) {
+ return srs_error_new(ERROR_MP4_BOX_REQUIRE_SPACE, "no space");
+ }
entry.segment_duration = buf->read_8bytes();
entry.media_time = buf->read_8bytes();
} else {
+ if (!buf->require(8)) {
+ return srs_error_new(ERROR_MP4_BOX_REQUIRE_SPACE, "no space");
+ }
entry.segment_duration = buf->read_4bytes();
entry.media_time = buf->read_4bytes();
}
-
+
+ if (!buf->require(4)) {
+ return srs_error_new(ERROR_MP4_BOX_REQUIRE_SPACE, "no space");
+ }
entry.media_rate_integer = buf->read_2bytes();
entry.media_rate_fraction = buf->read_2bytes();
}
@@ -2171,8 +2139,8 @@ stringstream& SrsMp4EditListBox::dumps_detail(stringstream& ss, SrsMp4DumpContex
if (!entries.empty()) {
ss << "(+)" << endl;
- srs_padding(ss, dc.indent());
- srs_dumps_array(entries, ss, dc.indent(), srs_pfn_detail, srs_delimiter_newline);
+ srs_mp4_padding(ss, dc.indent());
+ srs_dumps_array(entries, ss, dc.indent(), srs_mp4_pfn_detail, srs_mp4_delimiter_newline);
}
return ss;
@@ -2240,7 +2208,7 @@ void SrsMp4MediaBox::set_minf(SrsMp4MediaInformationBox* v)
boxes.push_back(v);
}
-SrsMp4MediaHeaderBox::SrsMp4MediaHeaderBox() : creation_time(0), modification_time(0), duration(0)
+SrsMp4MediaHeaderBox::SrsMp4MediaHeaderBox() : creation_time(0), modification_time(0), timescale(0), duration(0)
{
type = SrsMp4BoxTypeMDHD;
language = 0;
@@ -2431,7 +2399,9 @@ stringstream& SrsMp4HandlerReferenceBox::dumps_detail(stringstream& ss, SrsMp4Du
ss << ", ";
srs_print_mp4_type(ss, (uint32_t)handler_type);
- ss << ", " << name;
+ if (!name.empty()) {
+ ss << ", " << name;
+ }
return ss;
}
@@ -2851,8 +2821,8 @@ stringstream& SrsMp4DataReferenceBox::dumps_detail(stringstream& ss, SrsMp4DumpC
ss << ", " << entries.size() << " childs";
if (!entries.empty()) {
ss << "(+)" << endl;
- srs_padding(ss, dc.indent());
- srs_dumps_array(entries, ss, dc.indent(), srs_pfn_pdetail, srs_delimiter_newline);
+ srs_mp4_padding(ss, dc.indent());
+ srs_dumps_array(entries, ss, dc.indent(), srs_mp4_pfn_detail2, srs_mp4_delimiter_newline);
}
return ss;
}
@@ -3175,8 +3145,8 @@ stringstream& SrsMp4AvccBox::dumps_detail(stringstream& ss, SrsMp4DumpContext dc
SrsMp4Box::dumps_detail(ss, dc);
ss << ", AVC Config: " << (int)avc_config.size() << "B" << endl;
- srs_padding(ss, dc.indent());
- srs_print_bytes(ss, (const char*)&avc_config[0], (int)avc_config.size(), dc.indent());
+ srs_mp4_padding(ss, dc.indent());
+ srs_mp4_print_bytes(ss, (const char*)&avc_config[0], (int)avc_config.size(), dc.indent());
return ss;
}
@@ -3276,7 +3246,8 @@ SrsMp4BaseDescriptor::~SrsMp4BaseDescriptor()
int SrsMp4BaseDescriptor::left_space(SrsBuffer* buf)
{
- return vlen - (buf->pos() - start_pos);
+ int left = vlen - (buf->pos() - start_pos);
+ return srs_max(0, left);
}
int SrsMp4BaseDescriptor::nb_bytes()
@@ -3423,8 +3394,8 @@ stringstream& SrsMp4DecoderSpecificInfo::dumps_detail(stringstream& ss, SrsMp4Du
ss << ", ASC " << asc.size() << "B";
ss << endl;
- srs_padding(ss, dc.indent());
- return srs_print_bytes(ss, (const char*)&asc[0], (int)asc.size(), dc.indent());
+ srs_mp4_padding(ss, dc.indent());
+ return srs_mp4_print_bytes(ss, (const char*)&asc[0], (int)asc.size(), dc.indent());
}
SrsMp4DecoderConfigDescriptor::SrsMp4DecoderConfigDescriptor() : upStream(0), bufferSizeDB(0), maxBitrate(0), avgBitrate(0)
@@ -3501,7 +3472,7 @@ stringstream& SrsMp4DecoderConfigDescriptor::dumps_detail(stringstream& ss, SrsM
ss << ", type=" << objectTypeIndication << ", stream=" << streamType;
ss << endl;
- srs_padding(ss, dc.indent());
+ srs_mp4_padding(ss, dc.indent());
ss << "decoder specific";
return decSpecificInfo->dumps_detail(ss, dc.indent());
@@ -3660,7 +3631,7 @@ stringstream& SrsMp4ES_Descriptor::dumps_detail(stringstream& ss, SrsMp4DumpCont
ss << ", ID=" << ES_ID;
ss << endl;
- srs_padding(ss, dc.indent());
+ srs_mp4_padding(ss, dc.indent());
ss << "decoder config";
decConfigDescr.dumps_detail(ss, dc.indent());
@@ -3866,7 +3837,7 @@ stringstream& SrsMp4SampleDescriptionBox::dumps_detail(stringstream& ss, SrsMp4D
ss << ", " << entries.size() << " childs";
if (!entries.empty()) {
ss << "(+)" << endl;
- srs_dumps_array(entries, ss, dc.indent(), srs_pfn_pbox, srs_delimiter_newline);
+ srs_dumps_array(entries, ss, dc.indent(), srs_mp4_pfn_box2, srs_mp4_delimiter_newline);
}
return ss;
}
@@ -3933,7 +3904,7 @@ srs_error_t SrsMp4DecodingTime2SampleBox::on_sample(uint32_t sample_index, SrsMp
int SrsMp4DecodingTime2SampleBox::nb_header()
{
- return SrsMp4FullBox::nb_header() + 4 + 8 * (int)entries.size();
+ return SrsMp4FullBox::nb_header() + 4 + 8*(int)entries.size();
}
srs_error_t SrsMp4DecodingTime2SampleBox::encode_header(SrsBuffer* buf)
@@ -3967,6 +3938,10 @@ srs_error_t SrsMp4DecodingTime2SampleBox::decode_header(SrsBuffer* buf)
entries.resize(entry_count);
}
for (size_t i = 0; i < (size_t)entry_count; i++) {
+ if (!buf->require(8)) {
+ return srs_error_new(ERROR_MP4_BOX_REQUIRE_SPACE, "no space");
+ }
+
SrsMp4SttsEntry& entry = entries[i];
entry.sample_count = buf->read_4bytes();
entry.sample_delta = buf->read_4bytes();
@@ -3982,8 +3957,8 @@ stringstream& SrsMp4DecodingTime2SampleBox::dumps_detail(stringstream& ss, SrsMp
ss << ", " << entries.size() << " childs (+)";
if (!entries.empty()) {
ss << endl;
- srs_padding(ss, dc.indent());
- srs_dumps_array(entries, ss, dc.indent(), srs_pfn_detail, srs_delimiter_newline);
+ srs_mp4_padding(ss, dc.indent());
+ srs_dumps_array(entries, ss, dc.indent(), srs_mp4_pfn_detail, srs_mp4_delimiter_newline);
}
return ss;
}
@@ -4107,8 +4082,8 @@ stringstream& SrsMp4CompositionTime2SampleBox::dumps_detail(stringstream& ss, Sr
ss << ", " << entries.size() << " childs (+)";
if (!entries.empty()) {
ss << endl;
- srs_padding(ss, dc.indent());
- srs_dumps_array(entries, ss, dc.indent(), srs_pfn_detail, srs_delimiter_newline);
+ srs_mp4_padding(ss, dc.indent());
+ srs_dumps_array(entries, ss, dc.indent(), srs_mp4_pfn_detail, srs_mp4_delimiter_newline);
}
return ss;
}
@@ -4184,8 +4159,8 @@ stringstream& SrsMp4SyncSampleBox::dumps_detail(stringstream& ss, SrsMp4DumpCont
ss << ", count=" << entry_count;
if (entry_count > 0) {
ss << endl;
- srs_padding(ss, dc.indent());
- srs_dumps_array(sample_numbers, entry_count, ss, dc.indent(), srs_pfn_elems, srs_delimiter_inlinespace);
+ srs_mp4_padding(ss, dc.indent());
+ srs_dumps_array(sample_numbers, entry_count, ss, dc.indent(), srs_mp4_pfn_elem, srs_mp4_delimiter_inspace);
}
return ss;
}
@@ -4289,8 +4264,8 @@ stringstream& SrsMp4Sample2ChunkBox::dumps_detail(stringstream& ss, SrsMp4DumpCo
ss << ", " << entry_count << " childs (+)";
if (entry_count > 0) {
ss << endl;
- srs_padding(ss, dc.indent());
- srs_dumps_array(entries, entry_count, ss, dc.indent(), srs_pfn_detail, srs_delimiter_newline);
+ srs_mp4_padding(ss, dc.indent());
+ srs_dumps_array(entries, entry_count, ss, dc.indent(), srs_mp4_pfn_detail, srs_mp4_delimiter_newline);
}
return ss;
}
@@ -4355,8 +4330,8 @@ stringstream& SrsMp4ChunkOffsetBox::dumps_detail(stringstream& ss, SrsMp4DumpCon
ss << ", " << entry_count << " childs (+)";
if (entry_count > 0) {
ss << endl;
- srs_padding(ss, dc.indent());
- srs_dumps_array(entries, entry_count, ss, dc.indent(), srs_pfn_elems, srs_delimiter_inlinespace);
+ srs_mp4_padding(ss, dc.indent());
+ srs_dumps_array(entries, entry_count, ss, dc.indent(), srs_mp4_pfn_elem, srs_mp4_delimiter_inspace);
}
return ss;
}
@@ -4421,8 +4396,8 @@ stringstream& SrsMp4ChunkLargeOffsetBox::dumps_detail(stringstream& ss, SrsMp4Du
ss << ", " << entry_count << " childs (+)";
if (entry_count > 0) {
ss << endl;
- srs_padding(ss, dc.indent());
- srs_dumps_array(entries, entry_count, ss, dc.indent(), srs_pfn_elems, srs_delimiter_inlinespace);
+ srs_mp4_padding(ss, dc.indent());
+ srs_dumps_array(entries, entry_count, ss, dc.indent(), srs_mp4_pfn_elem, srs_mp4_delimiter_inspace);
}
return ss;
}
@@ -4510,8 +4485,8 @@ stringstream& SrsMp4SampleSizeBox::dumps_detail(stringstream& ss, SrsMp4DumpCont
ss << ", size=" << sample_size << ", " << sample_count << " childs (+)";
if (!sample_size && sample_count> 0) {
ss << endl;
- srs_padding(ss, dc.indent());
- srs_dumps_array(entry_sizes, sample_count, ss, dc.indent(), srs_pfn_elems, srs_delimiter_inlinespace);
+ srs_mp4_padding(ss, dc.indent());
+ srs_dumps_array(entry_sizes, sample_count, ss, dc.indent(), srs_mp4_pfn_elem, srs_mp4_delimiter_inspace);
}
return ss;
}
@@ -4570,8 +4545,8 @@ stringstream& SrsMp4UserDataBox::dumps_detail(stringstream& ss, SrsMp4DumpContex
if (!data.empty()) {
ss << endl;
- srs_padding(ss, dc.indent());
- srs_dumps_array(&data[0], (int)data.size(), ss, dc.indent(), srs_pfn_hex, srs_delimiter_inlinespace);
+ srs_mp4_padding(ss, dc.indent());
+ srs_dumps_array(&data[0], (int)data.size(), ss, dc.indent(), srs_mp4_pfn_hex, srs_mp4_delimiter_inspace);
}
return ss;
}
@@ -4587,7 +4562,7 @@ SrsMp4SegmentIndexBox::~SrsMp4SegmentIndexBox()
int SrsMp4SegmentIndexBox::nb_header()
{
- return SrsMp4Box::nb_header() + 4+4+4 + (version? 4:8) + 4+4 + 12*entries.size();
+ return SrsMp4Box::nb_header() + 4+4+4 + (!version? 8:16) + 4 + 12*entries.size();
}
srs_error_t SrsMp4SegmentIndexBox::encode_header(SrsBuffer* buf)
@@ -4641,16 +4616,27 @@ srs_error_t SrsMp4SegmentIndexBox::decode_header(SrsBuffer* buf)
flags = buf->read_3bytes();
reference_id = buf->read_4bytes();
timescale = buf->read_4bytes();
+
if (!version) {
+ if (!buf->require(8)) {
+ return srs_error_new(ERROR_MP4_BOX_REQUIRE_SPACE, "no space");
+ }
earliest_presentation_time = buf->read_4bytes();
first_offset = buf->read_4bytes();
} else {
+ if (!buf->require(16)) {
+ return srs_error_new(ERROR_MP4_BOX_REQUIRE_SPACE, "no space");
+ }
earliest_presentation_time = buf->read_8bytes();
first_offset = buf->read_8bytes();
}
uint32_t nn_entries = (uint32_t)(buf->read_4bytes() & 0xffff);
for (uint32_t i = 0; i < nn_entries; i++) {
+ if (!buf->require(12)) {
+ return srs_error_new(ERROR_MP4_BOX_REQUIRE_SPACE, "no space");
+ }
+
SrsMp4SegmentIndexEntry entry;
uint32_t v = buf->read_4bytes();
@@ -4681,7 +4667,7 @@ stringstream& SrsMp4SegmentIndexBox::dumps_detail(stringstream& ss, SrsMp4DumpCo
SrsMp4SegmentIndexEntry& entry = entries.at(i);
ss << endl;
- srs_padding(ss, dc.indent());
+ srs_mp4_padding(ss, dc.indent());
ss << "#" << i << ", ref=" << (int)entry.reference_type << "/" << entry.referenced_size
<< ", duration=" << entry.subsegment_duration << ", SAP=" << (int)entry.starts_with_SAP
<< "/" << (int)entry.SAP_type << "/" << entry.SAP_delta_time;
@@ -4883,8 +4869,7 @@ srs_error_t SrsMp4SampleManager::write(SrsMp4MovieFragmentBox* moof, uint64_t& d
trun->flags = SrsMp4TrunFlagsDataOffset | SrsMp4TrunFlagsSampleDuration
| SrsMp4TrunFlagsSampleSize | SrsMp4TrunFlagsSampleFlag | SrsMp4TrunFlagsSampleCtsOffset;
- trun->sample_count = (uint32_t)samples.size();
-
+
SrsMp4Sample* previous = NULL;
vector::iterator it;
@@ -6041,18 +6026,24 @@ srs_error_t SrsMp4M2tsInitEncoder::write(SrsFormat* format, bool video, int tid)
srs_error_t err = srs_success;
// Write ftyp box.
- SrsMp4FileTypeBox* ftyp = new SrsMp4FileTypeBox();
- SrsAutoFree(SrsMp4FileTypeBox, ftyp);
if (true) {
+ SrsMp4FileTypeBox* ftyp = new SrsMp4FileTypeBox();
+ SrsAutoFree(SrsMp4FileTypeBox, ftyp);
+
ftyp->major_brand = SrsMp4BoxBrandISO5;
ftyp->minor_version = 512;
ftyp->set_compatible_brands(SrsMp4BoxBrandISO6, SrsMp4BoxBrandMP41);
+
+ if ((err = srs_mp4_write_box(writer, ftyp)) != srs_success) {
+ return srs_error_wrap(err, "write ftyp");
+ }
}
// Write moov.
- SrsMp4MovieBox* moov = new SrsMp4MovieBox();
- SrsAutoFree(SrsMp4MovieBox, moov);
if (true) {
+ SrsMp4MovieBox* moov = new SrsMp4MovieBox();
+ SrsAutoFree(SrsMp4MovieBox, moov);
+
SrsMp4MovieHeaderBox* mvhd = new SrsMp4MovieHeaderBox();
moov->set_mvhd(mvhd);
@@ -6244,24 +6235,10 @@ srs_error_t SrsMp4M2tsInitEncoder::write(SrsFormat* format, bool video, int tid)
trex->track_ID = tid;
trex->default_sample_description_index = 1;
}
- }
-
- int nb_data = ftyp->nb_bytes() + moov->nb_bytes();
- uint8_t* data = new uint8_t[nb_data];
- SrsAutoFreeA(uint8_t, data);
-
- SrsBuffer* buffer = new SrsBuffer((char*)data, nb_data);
- SrsAutoFree(SrsBuffer, buffer);
-
- if ((err = ftyp->encode(buffer)) != srs_success) {
- return srs_error_wrap(err, "encode ftyp");
- }
- if ((err = moov->encode(buffer)) != srs_success) {
- return srs_error_wrap(err, "encode moov");
- }
-
- if ((err = writer->write(data, nb_data, NULL)) != srs_success) {
- return srs_error_wrap(err, "write ftyp and moov");
+
+ if ((err = srs_mp4_write_box(writer, moov)) != srs_success) {
+ return srs_error_wrap(err, "write moov");
+ }
}
return err;
@@ -6275,6 +6252,7 @@ SrsMp4M2tsSegmentEncoder::SrsMp4M2tsSegmentEncoder()
buffer = new SrsBuffer();
sequence_number = 0;
decode_basetime = 0;
+ styp_bytes = 0;
mdat_bytes = 0;
}
@@ -6301,19 +6279,11 @@ srs_error_t SrsMp4M2tsSegmentEncoder::initialize(ISrsWriter* w, uint32_t sequenc
styp->major_brand = SrsMp4BoxBrandMSDH;
styp->minor_version = 0;
styp->set_compatible_brands(SrsMp4BoxBrandMSDH, SrsMp4BoxBrandMSIX);
-
- int nb_data = styp->nb_bytes();
- std::vector data(nb_data);
-
- SrsBuffer* buffer = new SrsBuffer(&data[0], nb_data);
- SrsAutoFree(SrsBuffer, buffer);
-
- if ((err = styp->encode(buffer)) != srs_success) {
- return srs_error_wrap(err, "encode styp");
- }
-
- // TODO: FIXME: Ensure write ok.
- if ((err = writer->write(&data[0], nb_data, NULL)) != srs_success) {
+
+ // Used for sidx to calcalute the referenced size.
+ styp_bytes = styp->nb_bytes();
+
+ if ((err = srs_mp4_write_box(writer, styp)) != srs_success) {
return srs_error_wrap(err, "write styp");
}
}
@@ -6365,16 +6335,36 @@ srs_error_t SrsMp4M2tsSegmentEncoder::flush(uint64_t& dts)
if (!nb_audios && !nb_videos) {
return srs_error_new(ERROR_MP4_ILLEGAL_MOOF, "Missing audio and video track");
}
-
+
+ // Although the sidx is not required to start play DASH, but it's required for AV sync.
+ SrsMp4SegmentIndexBox* sidx = new SrsMp4SegmentIndexBox();
+ SrsAutoFree(SrsMp4SegmentIndexBox, sidx);
+ if (true) {
+ sidx->version = 1;
+ sidx->reference_id = 1;
+ sidx->timescale = 1000;
+ sidx->earliest_presentation_time = uint64_t(decode_basetime / sidx->timescale);
+
+ uint64_t duration = 0;
+ if (samples && !samples->samples.empty()) {
+ SrsMp4Sample* first = samples->samples[0];
+ SrsMp4Sample* last = samples->samples[samples->samples.size() - 1];
+ duration = srs_max(0, last->dts - first->dts);
+ }
+
+ SrsMp4SegmentIndexEntry entry;
+ memset(&entry, 0, sizeof(entry));
+ entry.subsegment_duration = duration;
+ entry.starts_with_SAP = 1;
+ sidx->entries.push_back(entry);
+ }
+
// Create a mdat box.
// its payload will be writen by samples,
// and we will update its header(size) when flush.
SrsMp4MediaDataBox* mdat = new SrsMp4MediaDataBox();
SrsAutoFree(SrsMp4MediaDataBox, mdat);
- // Although the sidx is not required to start play DASH, but it's required for AV sync.
- // TODO: FIXME: Insert a sidx box.
-
// Write moof.
if (true) {
SrsMp4MovieFragmentBox* moof = new SrsMp4MovieFragmentBox();
@@ -6407,30 +6397,25 @@ srs_error_t SrsMp4M2tsSegmentEncoder::flush(uint64_t& dts)
return srs_error_wrap(err, "write samples");
}
- int nb_data = moof->nb_bytes();
// @remark Remember the data_offset of turn is size(moof)+header(mdat), not including styp or sidx.
- trun->data_offset = (int32_t)(nb_data + mdat->sz_header());
-
- uint8_t* data = new uint8_t[nb_data];
- SrsAutoFreeA(uint8_t, data);
-
- SrsBuffer* buffer = new SrsBuffer((char*)data, nb_data);
- SrsAutoFree(SrsBuffer, buffer);
-
- if ((err = moof->encode(buffer)) != srs_success) {
- return srs_error_wrap(err, "encode moof");
+ int moof_bytes = moof->nb_bytes();
+ trun->data_offset = (int32_t)(moof_bytes + mdat->sz_header());
+ mdat->nb_data = (int)mdat_bytes;
+
+ // Update the size of sidx.
+ SrsMp4SegmentIndexEntry* entry = &sidx->entries[0];
+ entry->referenced_size = moof_bytes + mdat->nb_bytes();
+ if ((err = srs_mp4_write_box(writer, sidx)) != srs_success) {
+ return srs_error_wrap(err, "write sidx");
}
-
- // TODO: FIXME: Ensure all bytes are writen.
- if ((err = writer->write(data, nb_data, NULL)) != srs_success) {
+
+ if ((err = srs_mp4_write_box(writer, moof)) != srs_success) {
return srs_error_wrap(err, "write moof");
}
}
// Write mdat.
if (true) {
- mdat->nb_data = (int)mdat_bytes;
-
int nb_data = mdat->sz_header();
uint8_t* data = new uint8_t[nb_data];
SrsAutoFreeA(uint8_t, data);
diff --git a/trunk/src/kernel/srs_kernel_mp4.hpp b/trunk/src/kernel/srs_kernel_mp4.hpp
index c51e30ad0..a0f965456 100644
--- a/trunk/src/kernel/srs_kernel_mp4.hpp
+++ b/trunk/src/kernel/srs_kernel_mp4.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
@@ -28,6 +28,7 @@
#include
#include
+#include
#include
#include
@@ -159,7 +160,10 @@ class SrsMp4DumpContext
public:
int level;
bool summary;
-
+
+ SrsMp4DumpContext();
+ virtual ~SrsMp4DumpContext();
+
SrsMp4DumpContext indent();
};
@@ -182,10 +186,8 @@ public:
// An extended type; in this case, the type field is set to ‘uuid’.
SrsMp4BoxType type;
// For box 'uuid'.
- // TODO: FIXME: Should double check buffer.
std::vector usertype;
protected:
- // TODO: FIXME: Should double check buffer.
std::vector boxes;
private:
// The position at buffer to start demux the box.
@@ -200,6 +202,8 @@ public:
// Get the size of header, without contained boxes.
// @remark For mdat box, we must codec its header, use this instead of sz().
virtual int sz_header();
+ // Update the size of box.
+ virtual int update_size();
// Get the left space of box, for decoder.
virtual int left_space(SrsBuffer* buf);
// Box type helper.
@@ -212,6 +216,8 @@ public:
// Remove the contained box of specified type.
// @return The removed count.
virtual int remove(SrsMp4BoxType bt);
+ // Append a child box.
+ virtual void append(SrsMp4Box* box);
// Dumps the box and all contained boxes.
virtual std::stringstream& dumps(std::stringstream& ss, SrsMp4DumpContext dc);
// Discovery the box from buffer.
@@ -279,7 +285,6 @@ public:
uint32_t minor_version;
private:
// A list, to the end of the box, of brands
- // TODO: FIXME: Should double check buffer.
std::vector compatible_brands;
public:
SrsMp4FileTypeBox();
@@ -474,7 +479,7 @@ enum SrsMp4TrunFlags
// Entry for trun.
// ISO_IEC_14496-12-base-format-2012.pdf, page 69
-class SrsMp4TrunEntry
+class SrsMp4TrunEntry : public ISrsCodec
{
public:
SrsMp4FullBox* owner;
@@ -488,10 +493,11 @@ public:
SrsMp4TrunEntry(SrsMp4FullBox* o);
virtual ~SrsMp4TrunEntry();
- virtual int nb_header();
- virtual srs_error_t encode_header(SrsBuffer* buf);
- virtual srs_error_t decode_header(SrsBuffer* buf);
- virtual std::stringstream& dumps_detail(std::stringstream& ss, SrsMp4DumpContext dc);
+ virtual int nb_bytes();
+ virtual srs_error_t encode(SrsBuffer* buf);
+ virtual srs_error_t decode(SrsBuffer* buf);
+
+ virtual std::stringstream& dumps(std::stringstream& ss, SrsMp4DumpContext dc);
};
// 8.8.8 Track Fragment Run Box (trun)
@@ -503,7 +509,7 @@ class SrsMp4TrackFragmentRunBox : public SrsMp4FullBox
public:
// The number of samples being added in this run; also the number of rows in the following
// table (the rows can be empty)
- uint32_t sample_count;
+ //uint32_t sample_count;
// The following are optional fields
public:
// added to the implicit or explicit data_offset established in the track fragment header.
@@ -512,7 +518,6 @@ public:
uint32_t first_sample_flags;
// all fields in the following array are optional
public:
- // TODO: FIXME: Should double check buffer.
std::vector entries;
public:
SrsMp4TrackFragmentRunBox();
@@ -602,7 +607,6 @@ public:
class SrsMp4FreeSpaceBox : public SrsMp4Box
{
private:
- // TODO: FIXME: Should double check buffer.
std::vector data;
public:
SrsMp4FreeSpaceBox(SrsMp4BoxType v);
@@ -910,7 +914,6 @@ class SrsMp4EditListBox : public SrsMp4FullBox
{
public:
// An integer that gives the number of entries in the following table
- // TODO: FIXME: Should double check buffer.
std::vector entries;
public:
SrsMp4EditListBox();
@@ -1161,7 +1164,6 @@ public:
class SrsMp4DataReferenceBox : public SrsMp4FullBox
{
private:
- // TODO: FIXME: Should double check buffer.
std::vector entries;
public:
SrsMp4DataReferenceBox();
@@ -1283,7 +1285,6 @@ public:
class SrsMp4AvccBox : public SrsMp4Box
{
public:
- // TODO: FIXME: Should double check buffer.
std::vector avc_config;
public:
SrsMp4AvccBox();
@@ -1394,7 +1395,6 @@ class SrsMp4DecoderSpecificInfo : public SrsMp4BaseDescriptor
public:
// AAC Audio Specific Config.
// 1.6.2.1 AudioSpecificConfig, in ISO_IEC_14496-3-AAC-2001.pdf, page 33.
- // TODO: FIXME: Should double check buffer.
std::vector asc;
public:
SrsMp4DecoderSpecificInfo();
@@ -1461,7 +1461,6 @@ public:
// if (streamDependenceFlag)
uint16_t dependsOn_ES_ID;
// if (URL_Flag)
- // TODO: FIXME: Should double check buffer.
std::vector URLstring;
// if (OCRstreamFlag)
uint16_t OCR_ES_Id;
@@ -1507,7 +1506,6 @@ public:
class SrsMp4SampleDescriptionBox : public SrsMp4FullBox
{
private:
- // TODO: FIXME: Should double check buffer.
std::vector entries;
public:
SrsMp4SampleDescriptionBox();
@@ -1557,7 +1555,6 @@ class SrsMp4DecodingTime2SampleBox : public SrsMp4FullBox
{
public:
// An integer that gives the number of entries in the following table.
- // TODO: FIXME: Should double check buffer.
std::vector entries;
private:
// The index for counter to calc the dts for samples.
@@ -1798,7 +1795,6 @@ public:
class SrsMp4UserDataBox : public SrsMp4Box
{
public:
- // TODO: FIXME: Should double check buffer.
std::vector data;
public:
SrsMp4UserDataBox();
@@ -1835,8 +1831,7 @@ public:
uint32_t reference_id;
uint32_t timescale;
uint64_t earliest_presentation_time;
- uint32_t first_offset;
- // TODO: FIXME: Should double check buffer.
+ uint64_t first_offset;
std::vector entries;
public:
SrsMp4SegmentIndexBox();
@@ -2115,6 +2110,7 @@ private:
private:
uint32_t nb_audios;
uint32_t nb_videos;
+ uint32_t styp_bytes;
uint64_t mdat_bytes;
SrsMp4SampleManager* samples;
public:
@@ -2137,5 +2133,113 @@ public:
virtual srs_error_t flush(uint64_t& dts);
};
+// LCOV_EXCL_START
+/////////////////////////////////////////////////////////////////////////////////
+// MP4 dumps functions.
+/////////////////////////////////////////////////////////////////////////////////
+
+#include
+
+#define SrsMp4SummaryCount 8
+
+extern std::stringstream& srs_mp4_padding(std::stringstream& ss, SrsMp4DumpContext dc, int tab = 4);
+
+extern void srs_mp4_delimiter_inline(std::stringstream& ss, SrsMp4DumpContext dc);
+extern void srs_mp4_delimiter_inspace(std::stringstream& ss, SrsMp4DumpContext dc);
+extern void srs_mp4_delimiter_newline(std::stringstream& ss, SrsMp4DumpContext dc);
+
+extern std::stringstream& srs_print_mp4_type(std::stringstream& ss, uint32_t v);
+extern std::stringstream& srs_mp4_print_bytes(std::stringstream& ss, const char* p, int size, SrsMp4DumpContext dc, int line = SrsMp4SummaryCount, int max = -1);
+
+// TODO: FIXME: Extract to common utility.
+template
+std::stringstream& srs_dumps_array(std::vector&arr, std::stringstream& ss, SrsMp4DumpContext dc,
+ void (*pfn)(T&, std::stringstream&, SrsMp4DumpContext),
+ void (*delimiter)(std::stringstream&, SrsMp4DumpContext))
+{
+ int limit = arr.size();
+ if (dc.summary) {
+ limit = srs_min(SrsMp4SummaryCount, limit);
+ }
+
+ for (size_t i = 0; i < (size_t)limit; i++) {
+ T& elem = arr[i];
+
+ pfn(elem, ss, dc);
+
+ if (i < limit - 1) {
+ delimiter(ss, dc);
+ }
+ }
+ return ss;
+}
+
+// TODO: FIXME: Extract to common utility.
+template
+std::stringstream& srs_dumps_array(T* arr, int size, std::stringstream& ss, SrsMp4DumpContext dc,
+ void (*pfn)(T&, std::stringstream&, SrsMp4DumpContext),
+ void (*delimiter)(std::stringstream&, SrsMp4DumpContext))
+{
+ int limit = size;
+ if (dc.summary) {
+ limit = srs_min(SrsMp4SummaryCount, limit);
+ }
+
+ for (size_t i = 0; i < (size_t)limit; i++) {
+ T& elem = arr[i];
+
+ pfn(elem, ss, dc);
+
+ if (i < limit - 1) {
+ delimiter(ss, dc);
+ }
+ }
+ return ss;
+}
+
+template
+void srs_mp4_pfn_box(T& elem, std::stringstream& ss, SrsMp4DumpContext dc)
+{
+ elem.dumps(ss, dc);
+}
+
+template
+void srs_mp4_pfn_detail(T& elem, std::stringstream& ss, SrsMp4DumpContext dc)
+{
+ elem.dumps_detail(ss, dc);
+}
+
+template
+void srs_mp4_pfn_box2(T*& elem, std::stringstream& ss, SrsMp4DumpContext dc)
+{
+ elem->dumps(ss, dc);
+}
+
+template
+void srs_mp4_pfn_detail2(T*& elem, std::stringstream& ss, SrsMp4DumpContext dc)
+{
+ elem->dumps_detail(ss, dc);
+}
+
+template
+void srs_mp4_pfn_type(T& elem, std::stringstream& ss, SrsMp4DumpContext /*dc*/)
+{
+ srs_print_mp4_type(ss, (uint32_t)elem);
+}
+
+template
+void srs_mp4_pfn_hex(T& elem, std::stringstream& ss, SrsMp4DumpContext /*dc*/)
+{
+ ss << "0x" << std::setw(2) << std::setfill('0') << std::hex << (uint32_t)(uint8_t)elem << std::dec;
+}
+
+template
+void srs_mp4_pfn_elem(T& elem, std::stringstream& ss, SrsMp4DumpContext /*dc*/)
+{
+ ss << elem;
+}
+
+// LCOV_EXCL_STOP
+
#endif
diff --git a/trunk/src/kernel/srs_kernel_stream.cpp b/trunk/src/kernel/srs_kernel_stream.cpp
index 97cc7d9d3..3a32bd159 100755
--- a/trunk/src/kernel/srs_kernel_stream.cpp
+++ b/trunk/src/kernel/srs_kernel_stream.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/kernel/srs_kernel_stream.hpp b/trunk/src/kernel/srs_kernel_stream.hpp
index 67e57ccb5..eb786559e 100644
--- a/trunk/src/kernel/srs_kernel_stream.hpp
+++ b/trunk/src/kernel/srs_kernel_stream.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/kernel/srs_kernel_ts.cpp b/trunk/src/kernel/srs_kernel_ts.cpp
index c691e5175..81328dd8d 100644
--- a/trunk/src/kernel/srs_kernel_ts.cpp
+++ b/trunk/src/kernel/srs_kernel_ts.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/kernel/srs_kernel_ts.hpp b/trunk/src/kernel/srs_kernel_ts.hpp
index d076bfbe7..0f505206a 100644
--- a/trunk/src/kernel/srs_kernel_ts.hpp
+++ b/trunk/src/kernel/srs_kernel_ts.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/kernel/srs_kernel_utility.cpp b/trunk/src/kernel/srs_kernel_utility.cpp
index 25a1683b8..1a38c7e1e 100644
--- a/trunk/src/kernel/srs_kernel_utility.cpp
+++ b/trunk/src/kernel/srs_kernel_utility.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/kernel/srs_kernel_utility.hpp b/trunk/src/kernel/srs_kernel_utility.hpp
index 30a8b5568..765a86546 100644
--- a/trunk/src/kernel/srs_kernel_utility.hpp
+++ b/trunk/src/kernel/srs_kernel_utility.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/libs/srs_lib_bandwidth.cpp b/trunk/src/libs/srs_lib_bandwidth.cpp
index 757912e7e..611c2c6b8 100644
--- a/trunk/src/libs/srs_lib_bandwidth.cpp
+++ b/trunk/src/libs/srs_lib_bandwidth.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/libs/srs_lib_bandwidth.hpp b/trunk/src/libs/srs_lib_bandwidth.hpp
index a4baa44c8..2bcf57956 100644
--- a/trunk/src/libs/srs_lib_bandwidth.hpp
+++ b/trunk/src/libs/srs_lib_bandwidth.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/libs/srs_lib_simple_socket.cpp b/trunk/src/libs/srs_lib_simple_socket.cpp
index 127d99200..d67a48308 100644
--- a/trunk/src/libs/srs_lib_simple_socket.cpp
+++ b/trunk/src/libs/srs_lib_simple_socket.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/libs/srs_lib_simple_socket.hpp b/trunk/src/libs/srs_lib_simple_socket.hpp
index 3045d2c22..021aeeea5 100644
--- a/trunk/src/libs/srs_lib_simple_socket.hpp
+++ b/trunk/src/libs/srs_lib_simple_socket.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/libs/srs_librtmp.cpp b/trunk/src/libs/srs_librtmp.cpp
index 012c2637d..ee49069f4 100644
--- a/trunk/src/libs/srs_librtmp.cpp
+++ b/trunk/src/libs/srs_librtmp.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/libs/srs_librtmp.hpp b/trunk/src/libs/srs_librtmp.hpp
index 143dc426e..9184c1840 100644
--- a/trunk/src/libs/srs_librtmp.hpp
+++ b/trunk/src/libs/srs_librtmp.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/main/srs_main_ingest_hls.cpp b/trunk/src/main/srs_main_ingest_hls.cpp
index 1c7f02955..d5f8c458a 100644
--- a/trunk/src/main/srs_main_ingest_hls.cpp
+++ b/trunk/src/main/srs_main_ingest_hls.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/main/srs_main_mp4_parser.cpp b/trunk/src/main/srs_main_mp4_parser.cpp
index 8518e10d0..66b5ea525 100644
--- a/trunk/src/main/srs_main_mp4_parser.cpp
+++ b/trunk/src/main/srs_main_mp4_parser.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/main/srs_main_server.cpp b/trunk/src/main/srs_main_server.cpp
index 5c2f7195a..3bfd9ebb1 100644
--- a/trunk/src/main/srs_main_server.cpp
+++ b/trunk/src/main/srs_main_server.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/protocol/srs_http_stack.cpp b/trunk/src/protocol/srs_http_stack.cpp
index 7979744e9..ad4f94168 100644
--- a/trunk/src/protocol/srs_http_stack.cpp
+++ b/trunk/src/protocol/srs_http_stack.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/protocol/srs_http_stack.hpp b/trunk/src/protocol/srs_http_stack.hpp
index 34eb7ae45..9413c32af 100644
--- a/trunk/src/protocol/srs_http_stack.hpp
+++ b/trunk/src/protocol/srs_http_stack.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/protocol/srs_protocol_amf0.cpp b/trunk/src/protocol/srs_protocol_amf0.cpp
index ae98a41c2..3af4d2d7e 100644
--- a/trunk/src/protocol/srs_protocol_amf0.cpp
+++ b/trunk/src/protocol/srs_protocol_amf0.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/protocol/srs_protocol_amf0.hpp b/trunk/src/protocol/srs_protocol_amf0.hpp
index 84593c557..7af7c700b 100644
--- a/trunk/src/protocol/srs_protocol_amf0.hpp
+++ b/trunk/src/protocol/srs_protocol_amf0.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/protocol/srs_protocol_format.cpp b/trunk/src/protocol/srs_protocol_format.cpp
index 8c5809b8d..96c08c926 100644
--- a/trunk/src/protocol/srs_protocol_format.cpp
+++ b/trunk/src/protocol/srs_protocol_format.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/protocol/srs_protocol_format.hpp b/trunk/src/protocol/srs_protocol_format.hpp
index 0e548e9cc..1804256b3 100644
--- a/trunk/src/protocol/srs_protocol_format.hpp
+++ b/trunk/src/protocol/srs_protocol_format.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/protocol/srs_protocol_io.cpp b/trunk/src/protocol/srs_protocol_io.cpp
index 948547be5..52f3d0c06 100644
--- a/trunk/src/protocol/srs_protocol_io.cpp
+++ b/trunk/src/protocol/srs_protocol_io.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/protocol/srs_protocol_io.hpp b/trunk/src/protocol/srs_protocol_io.hpp
index abcd14c7c..756e5667d 100644
--- a/trunk/src/protocol/srs_protocol_io.hpp
+++ b/trunk/src/protocol/srs_protocol_io.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/protocol/srs_protocol_json.cpp b/trunk/src/protocol/srs_protocol_json.cpp
index aae9412e1..82f099114 100644
--- a/trunk/src/protocol/srs_protocol_json.cpp
+++ b/trunk/src/protocol/srs_protocol_json.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
@@ -1320,7 +1320,7 @@ void json_value_free (json_value * value)
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/protocol/srs_protocol_json.hpp b/trunk/src/protocol/srs_protocol_json.hpp
index 0e3d8cab0..cac07a8d5 100644
--- a/trunk/src/protocol/srs_protocol_json.hpp
+++ b/trunk/src/protocol/srs_protocol_json.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/protocol/srs_protocol_kbps.cpp b/trunk/src/protocol/srs_protocol_kbps.cpp
index 019edca70..063b0dfae 100644
--- a/trunk/src/protocol/srs_protocol_kbps.cpp
+++ b/trunk/src/protocol/srs_protocol_kbps.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/protocol/srs_protocol_kbps.hpp b/trunk/src/protocol/srs_protocol_kbps.hpp
index 64d689307..22c3d032b 100644
--- a/trunk/src/protocol/srs_protocol_kbps.hpp
+++ b/trunk/src/protocol/srs_protocol_kbps.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/protocol/srs_protocol_stream.cpp b/trunk/src/protocol/srs_protocol_stream.cpp
index 96a55c265..6fa9cfb1a 100755
--- a/trunk/src/protocol/srs_protocol_stream.cpp
+++ b/trunk/src/protocol/srs_protocol_stream.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/protocol/srs_protocol_stream.hpp b/trunk/src/protocol/srs_protocol_stream.hpp
index 247d75aef..237cf00fc 100644
--- a/trunk/src/protocol/srs_protocol_stream.hpp
+++ b/trunk/src/protocol/srs_protocol_stream.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/protocol/srs_protocol_utility.cpp b/trunk/src/protocol/srs_protocol_utility.cpp
index 1044236a3..28141f625 100644
--- a/trunk/src/protocol/srs_protocol_utility.cpp
+++ b/trunk/src/protocol/srs_protocol_utility.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/protocol/srs_protocol_utility.hpp b/trunk/src/protocol/srs_protocol_utility.hpp
index a958703f4..3f4cc03d2 100644
--- a/trunk/src/protocol/srs_protocol_utility.hpp
+++ b/trunk/src/protocol/srs_protocol_utility.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/protocol/srs_raw_avc.cpp b/trunk/src/protocol/srs_raw_avc.cpp
index 6b8f24b9a..8f4acbd76 100644
--- a/trunk/src/protocol/srs_raw_avc.cpp
+++ b/trunk/src/protocol/srs_raw_avc.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/protocol/srs_raw_avc.hpp b/trunk/src/protocol/srs_raw_avc.hpp
index 36fbfe411..de81bf2ad 100644
--- a/trunk/src/protocol/srs_raw_avc.hpp
+++ b/trunk/src/protocol/srs_raw_avc.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/protocol/srs_rtmp_handshake.cpp b/trunk/src/protocol/srs_rtmp_handshake.cpp
index 3d69fdb6e..3d0a8a9b1 100644
--- a/trunk/src/protocol/srs_rtmp_handshake.cpp
+++ b/trunk/src/protocol/srs_rtmp_handshake.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/protocol/srs_rtmp_handshake.hpp b/trunk/src/protocol/srs_rtmp_handshake.hpp
index 9029e55fd..bfe7b1bd0 100644
--- a/trunk/src/protocol/srs_rtmp_handshake.hpp
+++ b/trunk/src/protocol/srs_rtmp_handshake.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/protocol/srs_rtmp_msg_array.cpp b/trunk/src/protocol/srs_rtmp_msg_array.cpp
index 538d3ddbe..b7f86f436 100644
--- a/trunk/src/protocol/srs_rtmp_msg_array.cpp
+++ b/trunk/src/protocol/srs_rtmp_msg_array.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/protocol/srs_rtmp_msg_array.hpp b/trunk/src/protocol/srs_rtmp_msg_array.hpp
index 6364829fd..cdfdae209 100644
--- a/trunk/src/protocol/srs_rtmp_msg_array.hpp
+++ b/trunk/src/protocol/srs_rtmp_msg_array.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/protocol/srs_rtmp_stack.cpp b/trunk/src/protocol/srs_rtmp_stack.cpp
index 3465d0b19..ae43916ce 100644
--- a/trunk/src/protocol/srs_rtmp_stack.cpp
+++ b/trunk/src/protocol/srs_rtmp_stack.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/protocol/srs_rtmp_stack.hpp b/trunk/src/protocol/srs_rtmp_stack.hpp
index 3a64d47bc..82c9bf006 100644
--- a/trunk/src/protocol/srs_rtmp_stack.hpp
+++ b/trunk/src/protocol/srs_rtmp_stack.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/protocol/srs_rtsp_stack.cpp b/trunk/src/protocol/srs_rtsp_stack.cpp
index d3f5d7366..d4c3cdc3a 100644
--- a/trunk/src/protocol/srs_rtsp_stack.cpp
+++ b/trunk/src/protocol/srs_rtsp_stack.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/protocol/srs_rtsp_stack.hpp b/trunk/src/protocol/srs_rtsp_stack.hpp
index 7732c4138..87c07ce55 100644
--- a/trunk/src/protocol/srs_rtsp_stack.hpp
+++ b/trunk/src/protocol/srs_rtsp_stack.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/service/srs_service_conn.cpp b/trunk/src/service/srs_service_conn.cpp
index 4c3d8009a..1269acdca 100644
--- a/trunk/src/service/srs_service_conn.cpp
+++ b/trunk/src/service/srs_service_conn.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/service/srs_service_conn.hpp b/trunk/src/service/srs_service_conn.hpp
index 6a7308f00..806acb8dd 100644
--- a/trunk/src/service/srs_service_conn.hpp
+++ b/trunk/src/service/srs_service_conn.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/service/srs_service_http_client.cpp b/trunk/src/service/srs_service_http_client.cpp
index c111220e0..21fe27307 100644
--- a/trunk/src/service/srs_service_http_client.cpp
+++ b/trunk/src/service/srs_service_http_client.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/service/srs_service_http_client.hpp b/trunk/src/service/srs_service_http_client.hpp
index 9781cbced..d11b1fb8e 100644
--- a/trunk/src/service/srs_service_http_client.hpp
+++ b/trunk/src/service/srs_service_http_client.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/service/srs_service_http_conn.cpp b/trunk/src/service/srs_service_http_conn.cpp
index 2d0cb3ba2..08eca160f 100644
--- a/trunk/src/service/srs_service_http_conn.cpp
+++ b/trunk/src/service/srs_service_http_conn.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
@@ -491,6 +491,16 @@ string SrsHttpMessage::url()
string SrsHttpMessage::host()
{
+ std::map::iterator it = _query.find("vhost");
+ if (it != _query.end() && !it->second.empty()) {
+ return it->second;
+ }
+
+ it = _query.find("domain");
+ if (it != _query.end() && !it->second.empty()) {
+ return it->second;
+ }
+
return _uri->get_host();
}
diff --git a/trunk/src/service/srs_service_http_conn.hpp b/trunk/src/service/srs_service_http_conn.hpp
index e93b2fa48..2fbba8a04 100644
--- a/trunk/src/service/srs_service_http_conn.hpp
+++ b/trunk/src/service/srs_service_http_conn.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/service/srs_service_log.cpp b/trunk/src/service/srs_service_log.cpp
index 0ed454fd4..dd45a3a89 100644
--- a/trunk/src/service/srs_service_log.cpp
+++ b/trunk/src/service/srs_service_log.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/service/srs_service_log.hpp b/trunk/src/service/srs_service_log.hpp
index 7ed23ba32..c262e968e 100644
--- a/trunk/src/service/srs_service_log.hpp
+++ b/trunk/src/service/srs_service_log.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/service/srs_service_rtmp_conn.cpp b/trunk/src/service/srs_service_rtmp_conn.cpp
index b5525e4fa..57ec4c05f 100644
--- a/trunk/src/service/srs_service_rtmp_conn.cpp
+++ b/trunk/src/service/srs_service_rtmp_conn.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/service/srs_service_rtmp_conn.hpp b/trunk/src/service/srs_service_rtmp_conn.hpp
index 105f3fcc2..6aed7e74d 100644
--- a/trunk/src/service/srs_service_rtmp_conn.hpp
+++ b/trunk/src/service/srs_service_rtmp_conn.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/service/srs_service_st.cpp b/trunk/src/service/srs_service_st.cpp
index 1f6d2266c..512ec563c 100644
--- a/trunk/src/service/srs_service_st.cpp
+++ b/trunk/src/service/srs_service_st.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/service/srs_service_st.hpp b/trunk/src/service/srs_service_st.hpp
index 2c8174ab2..ebeb833ad 100644
--- a/trunk/src/service/srs_service_st.hpp
+++ b/trunk/src/service/srs_service_st.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/service/srs_service_utility.cpp b/trunk/src/service/srs_service_utility.cpp
index 6c140dd1b..cc3eade17 100644
--- a/trunk/src/service/srs_service_utility.cpp
+++ b/trunk/src/service/srs_service_utility.cpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/service/srs_service_utility.hpp b/trunk/src/service/srs_service_utility.hpp
index 70b56547e..c41a86215 100644
--- a/trunk/src/service/srs_service_utility.hpp
+++ b/trunk/src/service/srs_service_utility.hpp
@@ -1,7 +1,7 @@
/**
* The MIT License (MIT)
*
- * Copyright (c) 2013-2019 Winlin
+ * Copyright (c) 2013-2020 Winlin
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/utest/srs_utest.cpp b/trunk/src/utest/srs_utest.cpp
index 6e1fda1f2..74b702167 100644
--- a/trunk/src/utest/srs_utest.cpp
+++ b/trunk/src/utest/srs_utest.cpp
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) 2013-2019 Winlin
+Copyright (c) 2013-2020 Winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/utest/srs_utest.hpp b/trunk/src/utest/srs_utest.hpp
index d054d71a6..fb8c03eea 100644
--- a/trunk/src/utest/srs_utest.hpp
+++ b/trunk/src/utest/srs_utest.hpp
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) 2013-2019 Winlin
+Copyright (c) 2013-2020 Winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/utest/srs_utest_amf0.cpp b/trunk/src/utest/srs_utest_amf0.cpp
index 0ca210ab5..a76f22464 100644
--- a/trunk/src/utest/srs_utest_amf0.cpp
+++ b/trunk/src/utest/srs_utest_amf0.cpp
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) 2013-2019 Winlin
+Copyright (c) 2013-2020 Winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/utest/srs_utest_amf0.hpp b/trunk/src/utest/srs_utest_amf0.hpp
index 093ec7d7c..6e7f205d9 100644
--- a/trunk/src/utest/srs_utest_amf0.hpp
+++ b/trunk/src/utest/srs_utest_amf0.hpp
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) 2013-2019 Winlin
+Copyright (c) 2013-2020 Winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/utest/srs_utest_app.cpp b/trunk/src/utest/srs_utest_app.cpp
index 7a2f01dd7..344cc0f43 100644
--- a/trunk/src/utest/srs_utest_app.cpp
+++ b/trunk/src/utest/srs_utest_app.cpp
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) 2013-2019 Winlin
+Copyright (c) 2013-2020 Winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/utest/srs_utest_app.hpp b/trunk/src/utest/srs_utest_app.hpp
index 20c793c4c..45b3dadf0 100644
--- a/trunk/src/utest/srs_utest_app.hpp
+++ b/trunk/src/utest/srs_utest_app.hpp
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) 2013-2019 Winlin
+Copyright (c) 2013-2020 Winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/utest/srs_utest_avc.cpp b/trunk/src/utest/srs_utest_avc.cpp
index 26f39e8be..4b33b2ccf 100644
--- a/trunk/src/utest/srs_utest_avc.cpp
+++ b/trunk/src/utest/srs_utest_avc.cpp
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) 2013-2019 Winlin
+Copyright (c) 2013-2020 Winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/utest/srs_utest_avc.hpp b/trunk/src/utest/srs_utest_avc.hpp
index 9013781cb..1a77a1fb4 100644
--- a/trunk/src/utest/srs_utest_avc.hpp
+++ b/trunk/src/utest/srs_utest_avc.hpp
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) 2013-2019 Winlin
+Copyright (c) 2013-2020 Winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/utest/srs_utest_config.cpp b/trunk/src/utest/srs_utest_config.cpp
index 4f40459fe..43622c3a7 100644
--- a/trunk/src/utest/srs_utest_config.cpp
+++ b/trunk/src/utest/srs_utest_config.cpp
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) 2013-2019 Winlin
+Copyright (c) 2013-2020 Winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
@@ -1820,9 +1820,9 @@ VOID TEST(ConfigUnitTest, CheckDefaultValuesVhost)
if (true) {
EXPECT_TRUE(ERROR_SUCCESS == conf.parse(_MIN_OK_CONF));
- EXPECT_EQ(3 * SRS_UTIME_SECONDS, conf.get_dash_fragment(""));
- EXPECT_EQ(30 * SRS_UTIME_SECONDS, conf.get_dash_update_period(""));
- EXPECT_EQ(60 * SRS_UTIME_SECONDS, conf.get_dash_timeshift(""));
+ EXPECT_EQ(30 * SRS_UTIME_SECONDS, conf.get_dash_fragment(""));
+ EXPECT_EQ(150 * SRS_UTIME_SECONDS, conf.get_dash_update_period(""));
+ EXPECT_EQ(300 * SRS_UTIME_SECONDS, conf.get_dash_timeshift(""));
EXPECT_TRUE(ERROR_SUCCESS == conf.parse(_MIN_OK_CONF"vhost v{dash{dash_fragment 4;dash_update_period 40;dash_timeshift 70;}}"));
EXPECT_EQ(4 * SRS_UTIME_SECONDS, conf.get_dash_fragment("v"));
diff --git a/trunk/src/utest/srs_utest_config.hpp b/trunk/src/utest/srs_utest_config.hpp
index 4fedb4496..b3355691c 100644
--- a/trunk/src/utest/srs_utest_config.hpp
+++ b/trunk/src/utest/srs_utest_config.hpp
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) 2013-2019 Winlin
+Copyright (c) 2013-2020 Winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/utest/srs_utest_core.cpp b/trunk/src/utest/srs_utest_core.cpp
index 1c5339a3c..2dce41d36 100644
--- a/trunk/src/utest/srs_utest_core.cpp
+++ b/trunk/src/utest/srs_utest_core.cpp
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) 2013-2019 Winlin
+Copyright (c) 2013-2020 Winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/utest/srs_utest_core.hpp b/trunk/src/utest/srs_utest_core.hpp
index 5560d86df..02c86a186 100644
--- a/trunk/src/utest/srs_utest_core.hpp
+++ b/trunk/src/utest/srs_utest_core.hpp
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) 2013-2019 Winlin
+Copyright (c) 2013-2020 Winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/utest/srs_utest_http.cpp b/trunk/src/utest/srs_utest_http.cpp
index fdff6743e..69b78177e 100644
--- a/trunk/src/utest/srs_utest_http.cpp
+++ b/trunk/src/utest/srs_utest_http.cpp
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) 2013-2019 Winlin
+Copyright (c) 2013-2020 Winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
@@ -1550,10 +1550,71 @@ VOID TEST(ProtocolHTTPTest, HTTPMessageParser)
}
}
+VOID TEST(ProtocolHTTPTest, VhostInQuery)
+{
+ srs_error_t err;
+
+ if (true) {
+ SrsHttpHeader h;
+
+ SrsHttpMessage m;
+ HELPER_ASSERT_SUCCESS(m.set_url("/api/v1?vhost=rt.ossrs.net&token=xxx", false));
+ m.set_header(&h, false);
+ EXPECT_STREQ("rt.ossrs.net", m.host().c_str());
+ }
+
+ if (true) {
+ SrsHttpHeader h;
+
+ SrsHttpMessage m;
+ HELPER_ASSERT_SUCCESS(m.set_url("/api/v1?vhost=rt.ossrs.net&&token=xxx", false));
+ m.set_header(&h, false);
+ EXPECT_STREQ("rt.ossrs.net", m.host().c_str());
+ }
+
+ if (true) {
+ SrsHttpHeader h;
+ h.set("Host", "ossrs.net:-1");
+
+ SrsHttpMessage m;
+ HELPER_ASSERT_SUCCESS(m.set_url("/api/v1?vhost=rt.ossrs.net", false));
+ m.set_header(&h, false);
+ EXPECT_STREQ("rt.ossrs.net", m.host().c_str());
+ }
+
+ if (true) {
+ SrsHttpHeader h;
+
+ SrsHttpMessage m;
+ HELPER_ASSERT_SUCCESS(m.set_url("/api/v1?vhost=ossrs.net", false));
+ m.set_header(&h, false);
+ EXPECT_STREQ("ossrs.net", m.host().c_str());
+ }
+
+ if (true) {
+ SrsHttpHeader h;
+ h.set("Host", "ossrs.net");
+
+ SrsHttpMessage m;
+ m.set_header(&h, false);
+ HELPER_ASSERT_SUCCESS(m.set_url("/api/v1", false));
+ EXPECT_STREQ("ossrs.net", m.host().c_str());
+ }
+}
+
VOID TEST(ProtocolHTTPTest, HTTPMessageUpdate)
{
srs_error_t err;
+ if (true) {
+ SrsHttpHeader h;
+
+ SrsHttpMessage m;
+ HELPER_ASSERT_SUCCESS(m.set_url("/api/v1?vhost=ossrs.net", false));
+ m.set_header(&h, false);
+ EXPECT_STREQ("ossrs.net", m.host().c_str());
+ }
+
if (true) {
SrsHttpHeader h;
h.set("Host", "ossrs.net:-1");
diff --git a/trunk/src/utest/srs_utest_http.hpp b/trunk/src/utest/srs_utest_http.hpp
index ac93867d5..0ca97496f 100644
--- a/trunk/src/utest/srs_utest_http.hpp
+++ b/trunk/src/utest/srs_utest_http.hpp
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) 2013-2019 Winlin
+Copyright (c) 2013-2020 Winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/utest/srs_utest_kernel.cpp b/trunk/src/utest/srs_utest_kernel.cpp
index 18ac72b10..9816da8c7 100644
--- a/trunk/src/utest/srs_utest_kernel.cpp
+++ b/trunk/src/utest/srs_utest_kernel.cpp
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) 2013-2019 Winlin
+Copyright (c) 2013-2020 Winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/utest/srs_utest_kernel.hpp b/trunk/src/utest/srs_utest_kernel.hpp
index f50906d78..fc59cf2bb 100644
--- a/trunk/src/utest/srs_utest_kernel.hpp
+++ b/trunk/src/utest/srs_utest_kernel.hpp
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) 2013-2019 Winlin
+Copyright (c) 2013-2020 Winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/utest/srs_utest_mp4.cpp b/trunk/src/utest/srs_utest_mp4.cpp
new file mode 100644
index 000000000..5f4ce4cb1
--- /dev/null
+++ b/trunk/src/utest/srs_utest_mp4.cpp
@@ -0,0 +1,1238 @@
+/*
+The MIT License (MIT)
+
+Copyright (c) 2013-2020 Winlin
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+#include
+
+#include
+using namespace std;
+
+#include
+#include
+#include
+
+VOID TEST(KernelMp4Test, PrintPadding)
+{
+ stringstream ss;
+ SrsMp4DumpContext dc;
+
+ srs_mp4_padding(ss, dc);
+ EXPECT_STREQ("", ss.str().c_str());
+
+ srs_mp4_padding(ss, dc.indent());
+ EXPECT_STREQ(" ", ss.str().c_str());
+
+ srs_mp4_padding(ss, dc.indent());
+ EXPECT_STREQ(" ", ss.str().c_str());
+}
+
+struct MockBox
+{
+public:
+ MockBox() {
+ }
+ virtual ~MockBox() {
+ }
+ virtual void dumps(stringstream&ss, SrsMp4DumpContext /*dc*/) {
+ ss << "mock";
+ }
+ virtual void dumps_detail(stringstream&ss, SrsMp4DumpContext /*dc*/) {
+ ss << "mock-detail";
+ }
+};
+
+VOID TEST(KernelMp4Test, DumpsArray)
+{
+ if (true) {
+ char* p = (char*)"srs";
+ vector arr(p, p+3);
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ srs_dumps_array(arr, ss, dc, srs_mp4_pfn_elem, srs_mp4_delimiter_inline);
+
+ EXPECT_STREQ("s,r,s", ss.str().c_str());
+ }
+
+ if (true) {
+ char arr[] = {'s', 'r', 's'};
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ srs_dumps_array(arr, 3, ss, dc, srs_mp4_pfn_elem, srs_mp4_delimiter_inline);
+
+ EXPECT_STREQ("s,r,s", ss.str().c_str());
+ }
+
+ if (true) {
+ char arr[] = {'s', 'r', 's'};
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ srs_dumps_array(arr, 3, ss, dc, srs_mp4_pfn_elem, srs_mp4_delimiter_inspace);
+
+ EXPECT_STREQ("s, r, s", ss.str().c_str());
+ }
+
+ if (true) {
+ char arr[] = {'s', 'r', 's'};
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ srs_dumps_array(arr, 3, ss, dc, srs_mp4_pfn_elem, srs_mp4_delimiter_newline);
+
+ EXPECT_STREQ("s\nr\ns", ss.str().c_str());
+ }
+
+ if (true) {
+ MockBox arr[1];
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ srs_dumps_array(arr, 1, ss, dc, srs_mp4_pfn_box, srs_mp4_delimiter_inline);
+
+ EXPECT_STREQ("mock", ss.str().c_str());
+ }
+
+ if (true) {
+ MockBox arr[1];
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ srs_dumps_array(arr, 1, ss, dc, srs_mp4_pfn_detail, srs_mp4_delimiter_inline);
+
+ EXPECT_STREQ("mock-detail", ss.str().c_str());
+ }
+
+ if (true) {
+ MockBox* arr[1] = {new MockBox()};
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ srs_dumps_array(arr, 1, ss, dc, srs_mp4_pfn_box2, srs_mp4_delimiter_inline);
+
+ EXPECT_STREQ("mock", ss.str().c_str());
+ srs_freep(arr[0]);
+ }
+
+ if (true) {
+ MockBox* arr[1] = {new MockBox()};
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ srs_dumps_array(arr, 1, ss, dc, srs_mp4_pfn_detail2, srs_mp4_delimiter_inline);
+
+ EXPECT_STREQ("mock-detail", ss.str().c_str());
+ srs_freep(arr[0]);
+ }
+
+ if (true) {
+ SrsMp4BoxType arr[] = {SrsMp4BoxTypeUUID};
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ srs_dumps_array(arr, 1, ss, dc, srs_mp4_pfn_type, srs_mp4_delimiter_inline);
+
+ EXPECT_STREQ("uuid", ss.str().c_str());
+ }
+
+ if (true) {
+ uint8_t arr[] = {0xec};
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ srs_dumps_array(arr, 1, ss, dc, srs_mp4_pfn_hex, srs_mp4_delimiter_inline);
+
+ EXPECT_STREQ("0xec", ss.str().c_str());
+ }
+}
+
+VOID TEST(KernelMp4Test, PrintBytes)
+{
+ if (true) {
+ uint8_t arr[] = {0xec};
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ srs_mp4_print_bytes(ss, (const char*)arr, 1, dc, 4, 8);
+
+ EXPECT_STREQ("0xec", ss.str().c_str());
+ }
+
+ if (true) {
+ uint8_t arr[] = {0xc};
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ srs_mp4_print_bytes(ss, (const char*)arr, 1, dc, 4, 8);
+
+ EXPECT_STREQ("0x0c", ss.str().c_str());
+ }
+
+ if (true) {
+ uint8_t arr[] = {0xec, 0xb1, 0xa3, 0xe1, 0xab};
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ srs_mp4_print_bytes(ss, (const char*)arr, 5, dc, 4, 8);
+
+ EXPECT_STREQ("0xec, 0xb1, 0xa3, 0xe1,\n0xab", ss.str().c_str());
+ }
+}
+
+VOID TEST(KernelMp4Test, ChildBoxes)
+{
+ SrsMp4Box* box = new SrsMp4Box();
+ EXPECT_TRUE(box->get(SrsMp4BoxTypeFTYP) == NULL);
+
+ SrsMp4Box* ftyp = new SrsMp4FileTypeBox();
+ box->append(ftyp);
+ EXPECT_TRUE(box->get(SrsMp4BoxTypeFTYP) == ftyp);
+
+ box->remove(SrsMp4BoxTypeFTYP);
+ EXPECT_TRUE(box->get(SrsMp4BoxTypeFTYP) == NULL);
+
+ srs_freep(box);
+}
+
+VOID TEST(KernelMp4Test, DiscoveryBox)
+{
+ srs_error_t err;
+ SrsMp4Box* pbox;
+
+ if (true) {
+ SrsBuffer b;
+ HELPER_ASSERT_FAILED(SrsMp4Box::discovery(&b, &pbox));
+ }
+
+ if (true) {
+ uint8_t data[] = {0,0,0,1, 0,0,0,0};
+ SrsBuffer b((char*)data, sizeof(data));
+ HELPER_ASSERT_FAILED(SrsMp4Box::discovery(&b, &pbox));
+ }
+
+ if (true) {
+ uint8_t data[] = {0,0,0,1, 0,0,0,1,0,0,0,0};
+ SrsBuffer b((char*)data, sizeof(data));
+ HELPER_ASSERT_FAILED(SrsMp4Box::discovery(&b, &pbox));
+ }
+
+ if (true) {
+ uint8_t data[8];
+ SrsBuffer b((char*)data, sizeof(data));
+ b.write_4bytes(8); b.write_4bytes(SrsMp4BoxTypeEDTS); b.skip(-8);
+ HELPER_ASSERT_SUCCESS(SrsMp4Box::discovery(&b, &pbox));
+ ASSERT_EQ(SrsMp4BoxTypeEDTS, pbox->type);
+ srs_freep(pbox);
+ }
+
+ if (true) {
+ uint8_t data[8];
+ SrsBuffer b((char*)data, sizeof(data));
+ b.write_4bytes(8); b.write_4bytes(SrsMp4BoxTypeELST); b.skip(-8);
+ HELPER_ASSERT_SUCCESS(SrsMp4Box::discovery(&b, &pbox));
+ ASSERT_EQ(SrsMp4BoxTypeELST, pbox->type);
+ srs_freep(pbox);
+ }
+
+ if (true) {
+ uint8_t data[8];
+ SrsBuffer b((char*)data, sizeof(data));
+ b.write_4bytes(8); b.write_4bytes(SrsMp4BoxTypeURN); b.skip(-8);
+ HELPER_ASSERT_SUCCESS(SrsMp4Box::discovery(&b, &pbox));
+ ASSERT_EQ(SrsMp4BoxTypeURN, pbox->type);
+ srs_freep(pbox);
+ }
+
+ if (true) {
+ uint8_t data[8];
+ SrsBuffer b((char*)data, sizeof(data));
+ b.write_4bytes(8); b.write_4bytes(SrsMp4BoxTypeCTTS); b.skip(-8);
+ HELPER_ASSERT_SUCCESS(SrsMp4Box::discovery(&b, &pbox));
+ ASSERT_EQ(SrsMp4BoxTypeCTTS, pbox->type);
+ srs_freep(pbox);
+ }
+
+ if (true) {
+ uint8_t data[8];
+ SrsBuffer b((char*)data, sizeof(data));
+ b.write_4bytes(8); b.write_4bytes(SrsMp4BoxTypeCO64); b.skip(-8);
+ HELPER_ASSERT_SUCCESS(SrsMp4Box::discovery(&b, &pbox));
+ ASSERT_EQ(SrsMp4BoxTypeCO64, pbox->type);
+ srs_freep(pbox);
+ }
+
+ if (true) {
+ uint8_t data[8];
+ SrsBuffer b((char*)data, sizeof(data));
+ b.write_4bytes(8); b.write_4bytes(SrsMp4BoxTypeUDTA); b.skip(-8);
+ HELPER_ASSERT_SUCCESS(SrsMp4Box::discovery(&b, &pbox));
+ ASSERT_EQ(SrsMp4BoxTypeUDTA, pbox->type);
+ srs_freep(pbox);
+ }
+
+ if (true) {
+ uint8_t data[8];
+ SrsBuffer b((char*)data, sizeof(data));
+ b.write_4bytes(8); b.write_4bytes(SrsMp4BoxTypeMVEX); b.skip(-8);
+ HELPER_ASSERT_SUCCESS(SrsMp4Box::discovery(&b, &pbox));
+ ASSERT_EQ(SrsMp4BoxTypeMVEX, pbox->type);
+ srs_freep(pbox);
+ }
+
+ if (true) {
+ uint8_t data[8];
+ SrsBuffer b((char*)data, sizeof(data));
+ b.write_4bytes(8); b.write_4bytes(SrsMp4BoxTypeTREX); b.skip(-8);
+ HELPER_ASSERT_SUCCESS(SrsMp4Box::discovery(&b, &pbox));
+ ASSERT_EQ(SrsMp4BoxTypeTREX, pbox->type);
+ srs_freep(pbox);
+ }
+
+ if (true) {
+ uint8_t data[8];
+ SrsBuffer b((char*)data, sizeof(data));
+ b.write_4bytes(8); b.write_4bytes(SrsMp4BoxTypeSTYP); b.skip(-8);
+ HELPER_ASSERT_SUCCESS(SrsMp4Box::discovery(&b, &pbox));
+ ASSERT_EQ(SrsMp4BoxTypeSTYP, pbox->type);
+ srs_freep(pbox);
+ }
+
+ if (true) {
+ uint8_t data[8];
+ SrsBuffer b((char*)data, sizeof(data));
+ b.write_4bytes(8); b.write_4bytes(SrsMp4BoxTypeMOOF); b.skip(-8);
+ HELPER_ASSERT_SUCCESS(SrsMp4Box::discovery(&b, &pbox));
+ ASSERT_EQ(SrsMp4BoxTypeMOOF, pbox->type);
+ srs_freep(pbox);
+ }
+
+ if (true) {
+ uint8_t data[8];
+ SrsBuffer b((char*)data, sizeof(data));
+ b.write_4bytes(8); b.write_4bytes(SrsMp4BoxTypeMFHD); b.skip(-8);
+ HELPER_ASSERT_SUCCESS(SrsMp4Box::discovery(&b, &pbox));
+ ASSERT_EQ(SrsMp4BoxTypeMFHD, pbox->type);
+ srs_freep(pbox);
+ }
+
+ if (true) {
+ uint8_t data[8];
+ SrsBuffer b((char*)data, sizeof(data));
+ b.write_4bytes(8); b.write_4bytes(SrsMp4BoxTypeTRAF); b.skip(-8);
+ HELPER_ASSERT_SUCCESS(SrsMp4Box::discovery(&b, &pbox));
+ ASSERT_EQ(SrsMp4BoxTypeTRAF, pbox->type);
+ srs_freep(pbox);
+ }
+
+ if (true) {
+ uint8_t data[8];
+ SrsBuffer b((char*)data, sizeof(data));
+ b.write_4bytes(8); b.write_4bytes(SrsMp4BoxTypeTFHD); b.skip(-8);
+ HELPER_ASSERT_SUCCESS(SrsMp4Box::discovery(&b, &pbox));
+ ASSERT_EQ(SrsMp4BoxTypeTFHD, pbox->type);
+ srs_freep(pbox);
+ }
+
+ if (true) {
+ uint8_t data[8];
+ SrsBuffer b((char*)data, sizeof(data));
+ b.write_4bytes(8); b.write_4bytes(SrsMp4BoxTypeTFDT); b.skip(-8);
+ HELPER_ASSERT_SUCCESS(SrsMp4Box::discovery(&b, &pbox));
+ ASSERT_EQ(SrsMp4BoxTypeTFDT, pbox->type);
+ srs_freep(pbox);
+ }
+
+ if (true) {
+ uint8_t data[8];
+ SrsBuffer b((char*)data, sizeof(data));
+ b.write_4bytes(8); b.write_4bytes(SrsMp4BoxTypeTRUN); b.skip(-8);
+ HELPER_ASSERT_SUCCESS(SrsMp4Box::discovery(&b, &pbox));
+ ASSERT_EQ(SrsMp4BoxTypeTRUN, pbox->type);
+ srs_freep(pbox);
+ }
+
+ if (true) {
+ uint8_t data[8];
+ SrsBuffer b((char*)data, sizeof(data));
+ b.write_4bytes(8); b.write_4bytes(SrsMp4BoxTypeSIDX); b.skip(-8);
+ HELPER_ASSERT_SUCCESS(SrsMp4Box::discovery(&b, &pbox));
+ ASSERT_EQ(SrsMp4BoxTypeSIDX, pbox->type);
+ srs_freep(pbox);
+ }
+}
+
+VOID TEST(KernelMp4Test, UUIDBoxDecode)
+{
+ srs_error_t err;
+ SrsMp4Box* pbox;
+
+ if (true) {
+ uint8_t data[24];
+ SrsBuffer b((char*)data, sizeof(data));
+ b.write_4bytes(8); b.write_4bytes(SrsMp4BoxTypeUUID); b.skip(-24);
+ SrsMp4Box box;
+ HELPER_ASSERT_FAILED(box.decode(&b));
+ }
+
+ if (true) {
+ uint8_t data[8];
+ SrsBuffer b((char*)data, sizeof(data));
+ b.write_4bytes(8); b.write_4bytes(SrsMp4BoxTypeUUID); b.skip(-8);
+ SrsMp4Box box;
+ HELPER_ASSERT_FAILED(box.decode(&b));
+ }
+
+ if (true) {
+ uint8_t data[16];
+ SrsBuffer b((char*)data, sizeof(data));
+ b.write_4bytes(1); b.write_8bytes(0x80000000LL); b.write_4bytes(SrsMp4BoxTypeUUID); b.skip(-16);
+ SrsMp4Box box;
+ HELPER_ASSERT_FAILED(box.decode(&b));
+ }
+
+ if (true) {
+ uint8_t data[8];
+ SrsBuffer b((char*)data, sizeof(data));
+ b.write_4bytes(1); b.write_4bytes(SrsMp4BoxTypeUUID); b.skip(-8);
+ SrsMp4Box box;
+ HELPER_ASSERT_FAILED(box.decode(&b));
+ }
+
+ if (true) {
+ SrsBuffer b;
+ SrsMp4Box box;
+ HELPER_ASSERT_FAILED(box.decode(&b));
+ }
+
+ if (true) {
+ uint8_t data[8];
+ SrsBuffer b((char*)data, sizeof(data));
+ b.write_4bytes(0); b.write_4bytes(SrsMp4BoxTypeUUID); b.skip(-8);
+ HELPER_ASSERT_SUCCESS(SrsMp4Box::discovery(&b, &pbox));
+ ASSERT_EQ(SrsMp4BoxTypeUUID, pbox->type);
+ HELPER_EXPECT_SUCCESS(pbox->decode(&b));
+ srs_freep(pbox);
+ }
+
+ if (true) {
+ uint8_t data[8];
+ SrsBuffer b((char*)data, sizeof(data));
+ b.write_4bytes(8); b.write_4bytes(SrsMp4BoxTypeUUID); b.skip(-8);
+ HELPER_ASSERT_SUCCESS(SrsMp4Box::discovery(&b, &pbox));
+ ASSERT_EQ(SrsMp4BoxTypeUUID, pbox->type);
+ srs_freep(pbox);
+ }
+
+ if (true) {
+ uint8_t data[8];
+ SrsBuffer b((char*)data, sizeof(data));
+ b.write_4bytes(0); b.write_4bytes(SrsMp4BoxTypeUUID); b.skip(-8);
+ HELPER_ASSERT_SUCCESS(SrsMp4Box::discovery(&b, &pbox));
+ ASSERT_EQ(SrsMp4BoxTypeUUID, pbox->type);
+ srs_freep(pbox);
+ }
+}
+
+VOID TEST(KernelMp4Test, UUIDBoxEncode)
+{
+ srs_error_t err;
+
+ if (true) {
+ char data[8];
+ SrsBuffer b(data, 8);
+
+ SrsMp4Box box;
+ box.type = SrsMp4BoxTypeFREE;
+ box.usertype.resize(8);
+ ASSERT_EQ(8, box.nb_bytes());
+ HELPER_ASSERT_SUCCESS(box.encode(&b));
+ }
+
+ if (true) {
+ char data[24];
+ SrsBuffer b(data, 24);
+
+ SrsMp4Box box;
+ box.type = SrsMp4BoxTypeUUID;
+ box.usertype.resize(16);
+ ASSERT_EQ(24, box.nb_bytes());
+ HELPER_ASSERT_SUCCESS(box.encode(&b));
+ }
+}
+
+VOID TEST(KernelMp4Test, FullBoxDump)
+{
+ srs_error_t err;
+
+ if (true) {
+ uint8_t data[12];
+ SrsBuffer b((char*)data, sizeof(data));
+ b.write_4bytes(12); b.write_4bytes(SrsMp4BoxTypeMFHD); b.write_1bytes(1); b.write_3bytes(2); b.skip(-12);
+
+ SrsMp4FullBox box;
+ HELPER_ASSERT_SUCCESS(box.decode(&b));
+ EXPECT_EQ(1, box.version);
+ EXPECT_EQ(2, box.flags);
+ }
+
+ if (true) {
+ SrsMp4FileTypeBox box;
+ box.major_brand = SrsMp4BoxBrandISO2;
+ box.compatible_brands.push_back(SrsMp4BoxBrandISOM);
+ EXPECT_EQ(20, box.update_size());
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ box.dumps(ss, dc);
+
+ string v = ss.str();
+ EXPECT_STREQ("ftyp, 20B, brands:iso2,0(isom)\n", v.c_str());
+ }
+
+ if (true) {
+ SrsMp4FullBox box;
+ box.type = SrsMp4BoxTypeFTYP;
+ box.version = 1;
+ box.flags = 0x02;
+ EXPECT_EQ(12, box.update_size());
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ box.dumps(ss, dc);
+
+ string v = ss.str();
+ EXPECT_STREQ("ftyp, 12B, FB(4B,V1,0x02)\n", v.c_str());
+ }
+
+ if (true) {
+ SrsMp4FullBox box;
+ box.type = SrsMp4BoxTypeFTYP;
+ box.version = 1;
+ EXPECT_EQ(12, box.update_size());
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ box.dumps(ss, dc);
+
+ string v = ss.str();
+ EXPECT_STREQ("ftyp, 12B, FB(4B,V1,0x00)\n", v.c_str());
+ }
+
+ if (true) {
+ SrsMp4FullBox box;
+ box.type = SrsMp4BoxTypeFTYP;
+ EXPECT_EQ(12, box.update_size());
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ box.dumps(ss, dc);
+
+ string v = ss.str();
+ EXPECT_STREQ("ftyp, 12B, FB(4B)\n", v.c_str());
+ }
+}
+
+VOID TEST(KernelMp4Test, MFHDBox)
+{
+ srs_error_t err;
+
+ if (true) {
+ uint8_t data[12+4];
+ SrsBuffer b((char*)data, sizeof(data));
+ b.write_4bytes(16); b.write_4bytes(SrsMp4BoxTypeMFHD); b.write_1bytes(0); b.write_3bytes(0);
+ b.write_4bytes(3); b.skip(-16);
+
+ SrsMp4MovieFragmentHeaderBox box;
+ HELPER_ASSERT_SUCCESS(box.decode(&b));
+ EXPECT_EQ(3, box.sequence_number);
+ }
+
+ if (true) {
+ SrsMp4MovieFragmentHeaderBox box;
+ box.sequence_number = 3;
+ EXPECT_EQ(16, box.update_size());
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ box.dumps(ss, dc);
+
+ string v = ss.str();
+ EXPECT_STREQ("mfhd, 16B, FB(4B), sequence=3\n", v.c_str());
+ }
+
+ SrsMp4TrackFragmentBox box;
+ EXPECT_TRUE(NULL == box.tfhd());
+ EXPECT_TRUE(NULL == box.tfdt());
+}
+
+VOID TEST(KernelMp4Test, TFHDBox)
+{
+ srs_error_t err;
+
+ if (true) {
+ char buf[12+4];
+ SrsBuffer b(buf, sizeof(buf));
+
+ if (true) {
+ SrsMp4TrackFragmentHeaderBox box;
+ box.track_id = 100;
+ EXPECT_EQ(sizeof(buf), box.nb_bytes());
+ HELPER_EXPECT_SUCCESS(box.encode(&b));
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ box.dumps(ss, dc);
+
+ string v = ss.str();
+ EXPECT_STREQ("tfhd, 16B, FB(4B), track=100\n", v.c_str());
+ }
+
+ if (true) {
+ b.skip(-1 * b.pos());
+ SrsMp4TrackFragmentHeaderBox box;
+ HELPER_EXPECT_SUCCESS(box.decode(&b));
+ EXPECT_EQ(100, box.track_id);
+ }
+ }
+
+ if (true) {
+ char buf[12+28];
+ SrsBuffer b(buf, sizeof(buf));
+
+ if (true) {
+ SrsMp4TrackFragmentHeaderBox box;
+ box.track_id = 100;
+ box.flags = SrsMp4TfhdFlagsBaseDataOffset | SrsMp4TfhdFlagsSampleDescriptionIndex
+ | SrsMp4TfhdFlagsDefaultSampleDuration | SrsMp4TfhdFlagsDefautlSampleSize
+ | SrsMp4TfhdFlagsDefaultSampleFlags | SrsMp4TfhdFlagsDurationIsEmpty
+ | SrsMp4TfhdFlagsDefaultBaseIsMoof;
+ box.base_data_offset = 10;
+ box.sample_description_index = 11;
+ box.default_sample_duration = 12;
+ box.default_sample_size = 13;
+ box.default_sample_flags = 14;
+ EXPECT_EQ(sizeof(buf), box.nb_bytes());
+ HELPER_EXPECT_SUCCESS(box.encode(&b));
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ box.dumps(ss, dc);
+
+ string v = ss.str();
+ EXPECT_STREQ("tfhd, 40B, FB(4B,V0,0x3003b), track=100, bdo=10, sdi=11, dsu=12, dss=13, dsf=14, empty-duration, moof-base\n", v.c_str());
+ }
+
+ if (true) {
+ b.skip(-1 * b.pos());
+ SrsMp4TrackFragmentHeaderBox box;
+ HELPER_EXPECT_SUCCESS(box.decode(&b));
+ EXPECT_EQ(100, box.track_id);
+ EXPECT_EQ(box.base_data_offset, 10);
+ EXPECT_EQ(box.sample_description_index, 11);
+ EXPECT_EQ(box.default_sample_duration, 12);
+ EXPECT_EQ(box.default_sample_size, 13);
+ EXPECT_EQ(box.default_sample_flags, 14);
+ }
+ }
+}
+
+VOID TEST(KernelMp4Test, TFDTBox)
+{
+ srs_error_t err;
+
+ if (true) {
+ char buf[12+4];
+ SrsBuffer b(buf, sizeof(buf));
+
+ if (true) {
+ SrsMp4TrackFragmentDecodeTimeBox box;
+ box.base_media_decode_time = 100;
+ EXPECT_EQ(sizeof(buf), box.nb_bytes());
+ HELPER_EXPECT_SUCCESS(box.encode(&b));
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ box.dumps(ss, dc);
+
+ string v = ss.str();
+ EXPECT_STREQ("tfdt, 16B, FB(4B), bmdt=100\n", v.c_str());
+ }
+
+ if (true) {
+ b.skip(-1 * b.pos());
+ SrsMp4TrackFragmentDecodeTimeBox box;
+ HELPER_EXPECT_SUCCESS(box.decode(&b));
+ EXPECT_EQ(100, box.base_media_decode_time);
+ }
+ }
+
+ if (true) {
+ char buf[12+8];
+ SrsBuffer b(buf, sizeof(buf));
+
+ if (true) {
+ SrsMp4TrackFragmentDecodeTimeBox box;
+ box.version = 1;
+ box.base_media_decode_time = 100;
+ EXPECT_EQ(sizeof(buf), box.nb_bytes());
+ HELPER_EXPECT_SUCCESS(box.encode(&b));
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ box.dumps(ss, dc);
+
+ string v = ss.str();
+ EXPECT_STREQ("tfdt, 20B, FB(4B,V1,0x00), bmdt=100\n", v.c_str());
+ }
+
+ if (true) {
+ b.skip(-1 * b.pos());
+ SrsMp4TrackFragmentDecodeTimeBox box;
+ HELPER_EXPECT_SUCCESS(box.decode(&b));
+ EXPECT_EQ(100, box.base_media_decode_time);
+ }
+ }
+}
+
+VOID TEST(KernelMp4Test, TRUNBox)
+{
+ srs_error_t err;
+
+ if (true) {
+ char buf[12+4];
+ SrsBuffer b(buf, sizeof(buf));
+
+ if (true) {
+ SrsMp4TrackFragmentRunBox box;
+ EXPECT_EQ(sizeof(buf), box.nb_bytes());
+ HELPER_EXPECT_SUCCESS(box.encode(&b));
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ box.dumps(ss, dc);
+
+ string v = ss.str();
+ EXPECT_STREQ("trun, 16B, FB(4B), samples=0\n", v.c_str());
+ }
+
+ if (true) {
+ b.skip(-1 * b.pos());
+ SrsMp4TrackFragmentDecodeTimeBox box;
+ HELPER_EXPECT_SUCCESS(box.decode(&b));
+ }
+ }
+
+ if (true) {
+ char buf[12+8];
+ SrsBuffer b(buf, sizeof(buf));
+
+ if (true) {
+ SrsMp4TrackFragmentRunBox box;
+ box.flags = SrsMp4TrunFlagsSampleDuration;
+
+ SrsMp4TrunEntry* entry = new SrsMp4TrunEntry(&box);
+ entry->sample_duration = 1000;
+ box.entries.push_back(entry);
+
+ EXPECT_EQ(sizeof(buf), box.nb_bytes());
+ HELPER_EXPECT_SUCCESS(box.encode(&b));
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ box.dumps(ss, dc);
+
+ string v = ss.str();
+ EXPECT_STREQ("trun, 20B, FB(4B,V0,0x100), samples=1\n duration=1000\n", v.c_str());
+ }
+
+ if (true) {
+ b.skip(-1 * b.pos());
+ SrsMp4TrackFragmentRunBox box;
+ HELPER_EXPECT_SUCCESS(box.decode(&b));
+ ASSERT_EQ(1, box.entries.size());
+
+ SrsMp4TrunEntry* entry = box.entries.at(0);
+ EXPECT_EQ(1000, entry->sample_duration);
+ }
+ }
+}
+
+VOID TEST(KernelMp4Test, FreeBox)
+{
+ srs_error_t err;
+
+ if (true) {
+ char buf[8+4];
+ SrsBuffer b(buf, sizeof(buf));
+
+ if (true) {
+ SrsMp4FreeSpaceBox box(SrsMp4BoxTypeFREE);
+ box.data.resize(4);
+ EXPECT_EQ(sizeof(buf), box.nb_bytes());
+ HELPER_EXPECT_SUCCESS(box.encode(&b));
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ box.dumps(ss, dc);
+
+ string v = ss.str();
+ EXPECT_STREQ("free, 12B, free 4B\n 0x00, 0x00, 0x00, 0x00\n", v.c_str());
+ }
+
+ if (true) {
+ b.skip(-1 * b.pos());
+ SrsMp4FreeSpaceBox box(SrsMp4BoxTypeSKIP);
+ HELPER_EXPECT_SUCCESS(box.decode(&b));
+ EXPECT_EQ(4, box.data.size());
+ }
+ }
+}
+
+VOID TEST(KernelMp4Test, MOOVBox)
+{
+ srs_error_t err;
+
+ if (true) {
+ char buf[8];
+ SrsBuffer b(buf, sizeof(buf));
+
+ if (true) {
+ SrsMp4MovieBox box;
+ EXPECT_EQ(sizeof(buf), box.nb_bytes());
+ HELPER_EXPECT_SUCCESS(box.encode(&b));
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ box.dumps(ss, dc);
+
+ string v = ss.str();
+ EXPECT_STREQ("moov, 8B\n", v.c_str());
+ }
+
+ if (true) {
+ b.skip(-1 * b.pos());
+ SrsMp4MovieBox box;
+ HELPER_EXPECT_SUCCESS(box.decode(&b));
+ }
+ }
+
+ if (true) {
+ SrsMp4MovieBox box;
+ EXPECT_TRUE(NULL == box.mvhd());
+ EXPECT_TRUE(NULL == box.mvex());
+ EXPECT_TRUE(NULL == box.video());
+ EXPECT_TRUE(NULL == box.audio());
+ EXPECT_EQ(0, box.nb_vide_tracks());
+ EXPECT_EQ(0, box.nb_soun_tracks());
+
+ SrsMp4MovieHeaderBox* mvhd = new SrsMp4MovieHeaderBox();
+ box.set_mvhd(mvhd);
+ EXPECT_TRUE(mvhd == box.mvhd());
+
+ SrsMp4MovieExtendsBox* mvex = new SrsMp4MovieExtendsBox();
+ box.set_mvex(mvex);
+ EXPECT_TRUE(mvex == box.mvex());
+
+ SrsMp4TrackBox* video = new SrsMp4TrackBox();
+ if (true) {
+ SrsMp4MediaBox* media = new SrsMp4MediaBox();
+ SrsMp4HandlerReferenceBox* hdr = new SrsMp4HandlerReferenceBox();
+ hdr->handler_type = SrsMp4HandlerTypeVIDE;
+ media->set_hdlr(hdr);
+ video->set_mdia(media);
+ }
+ box.add_trak(video);
+ EXPECT_TRUE(video == box.video());
+ EXPECT_EQ(1, box.nb_vide_tracks());
+
+ SrsMp4TrackBox* audio = new SrsMp4TrackBox();
+ if (true) {
+ SrsMp4MediaBox* media = new SrsMp4MediaBox();
+ SrsMp4HandlerReferenceBox* hdr = new SrsMp4HandlerReferenceBox();
+ hdr->handler_type = SrsMp4HandlerTypeSOUN;
+ media->set_hdlr(hdr);
+ audio->set_mdia(media);
+ }
+ box.add_trak(audio);
+ EXPECT_TRUE(audio == box.audio());
+ EXPECT_EQ(1, box.nb_soun_tracks());
+ }
+}
+
+VOID TEST(KernelMp4Test, TREXBox)
+{
+ srs_error_t err;
+
+ if (true) {
+ char buf[12+20];
+ SrsBuffer b(buf, sizeof(buf));
+
+ if (true) {
+ SrsMp4TrackExtendsBox box;
+ box.track_ID = 1; box.default_sample_description_index = 2; box.default_sample_size = 3;
+ box.default_sample_duration = 4; box.default_sample_flags = 5;
+ EXPECT_EQ(sizeof(buf), box.nb_bytes());
+ HELPER_EXPECT_SUCCESS(box.encode(&b));
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ box.dumps(ss, dc);
+
+ string v = ss.str();
+ EXPECT_STREQ("trex, 32B, FB(4B), track=#1, default-sample(index:2, size:3, duration:4, flags:5)\n", v.c_str());
+ }
+
+ if (true) {
+ b.skip(-1 * b.pos());
+ SrsMp4TrackExtendsBox box;
+ HELPER_EXPECT_SUCCESS(box.decode(&b));
+ EXPECT_EQ(box.track_ID, 1);
+ EXPECT_EQ(box.default_sample_description_index, 2);
+ EXPECT_EQ(box.default_sample_size, 3);
+ EXPECT_EQ(box.default_sample_duration, 4);
+ EXPECT_EQ(box.default_sample_flags, 5);
+ }
+ }
+
+ SrsMp4MovieExtendsBox box;
+ EXPECT_TRUE(NULL == box.trex());
+
+ SrsMp4TrackExtendsBox* trex = new SrsMp4TrackExtendsBox();
+ box.set_trex(trex);
+ EXPECT_TRUE(trex == box.trex());
+}
+
+VOID TEST(KernelMp4Test, TKHDBox)
+{
+ srs_error_t err;
+
+ if (true) {
+ char buf[12+20+60];
+ SrsBuffer b(buf, sizeof(buf));
+
+ if (true) {
+ SrsMp4TrackHeaderBox box;
+ box.track_ID = 1;
+ EXPECT_EQ(sizeof(buf), box.nb_bytes());
+ HELPER_EXPECT_SUCCESS(box.encode(&b));
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ box.dumps(ss, dc);
+
+ string v = ss.str();
+ EXPECT_STREQ("tkhd, 92B, FB(4B,V0,0x03), track #1, 0TBN, size=0x0\n", v.c_str());
+ }
+
+ if (true) {
+ b.skip(-1 * b.pos());
+ SrsMp4TrackHeaderBox box;
+ HELPER_EXPECT_SUCCESS(box.decode(&b));
+ EXPECT_EQ(box.track_ID, 1);
+ }
+ }
+
+ if (true) {
+ char buf[12+32+60];
+ SrsBuffer b(buf, sizeof(buf));
+
+ if (true) {
+ SrsMp4TrackHeaderBox box;
+ box.version = 1;
+ box.track_ID = 1;
+ EXPECT_EQ(sizeof(buf), box.nb_bytes());
+ HELPER_EXPECT_SUCCESS(box.encode(&b));
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ box.dumps(ss, dc);
+
+ string v = ss.str();
+ EXPECT_STREQ("tkhd, 104B, FB(4B,V1,0x03), track #1, 0TBN, size=0x0\n", v.c_str());
+ }
+
+ if (true) {
+ b.skip(-1 * b.pos());
+ SrsMp4TrackHeaderBox box;
+ HELPER_EXPECT_SUCCESS(box.decode(&b));
+ EXPECT_EQ(box.track_ID, 1);
+ }
+ }
+}
+
+VOID TEST(KernelMp4Test, ELSTBox)
+{
+ srs_error_t err;
+
+ if (true) {
+ char buf[12+4];
+ SrsBuffer b(buf, sizeof(buf));
+
+ if (true) {
+ SrsMp4EditListBox box;
+ EXPECT_EQ(sizeof(buf), box.nb_bytes());
+ HELPER_EXPECT_SUCCESS(box.encode(&b));
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ box.dumps(ss, dc);
+
+ string v = ss.str();
+ EXPECT_STREQ("elst, 16B, FB(4B), 0 childs\n", v.c_str());
+ }
+
+ if (true) {
+ b.skip(-1 * b.pos());
+ SrsMp4EditListBox box;
+ HELPER_EXPECT_SUCCESS(box.decode(&b));
+ }
+ }
+
+ if (true) {
+ char buf[12+4+12];
+ SrsBuffer b(buf, sizeof(buf));
+
+ if (true) {
+ SrsMp4EditListBox box;
+ if (true) {
+ SrsMp4ElstEntry entry;
+ box.entries.push_back(entry);
+ }
+ EXPECT_EQ(sizeof(buf), box.nb_bytes());
+ HELPER_EXPECT_SUCCESS(box.encode(&b));
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ box.dumps(ss, dc);
+
+ string v = ss.str();
+ EXPECT_STREQ("elst, 28B, FB(4B), 1 childs(+)\n Entry, 0TBN, start=0TBN, rate=0,0\n", v.c_str());
+ }
+
+ if (true) {
+ b.skip(-1 * b.pos());
+ SrsMp4EditListBox box;
+ HELPER_EXPECT_SUCCESS(box.decode(&b));
+ }
+ }
+
+ if (true) {
+ SrsMp4MediaBox box;
+ SrsMp4HandlerReferenceBox* hdlr = new SrsMp4HandlerReferenceBox();
+ box.set_hdlr(hdlr);
+ EXPECT_TRUE(hdlr == box.hdlr());
+ }
+}
+
+VOID TEST(KernelMp4Test, MDHDBox)
+{
+ srs_error_t err;
+
+ if (true) {
+ char buf[12+20];
+ SrsBuffer b(buf, sizeof(buf));
+
+ if (true) {
+ SrsMp4MediaHeaderBox box;
+ EXPECT_EQ(sizeof(buf), box.nb_bytes());
+ HELPER_EXPECT_SUCCESS(box.encode(&b));
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ box.dumps(ss, dc);
+
+ string v = ss.str();
+ EXPECT_STREQ("mdhd, 32B, FB(4B), TBN=0, 0TBN\n", v.c_str());
+ }
+
+ if (true) {
+ b.skip(-1 * b.pos());
+ SrsMp4MediaHeaderBox box;
+ HELPER_EXPECT_SUCCESS(box.decode(&b));
+ }
+ }
+
+ if (true) {
+ char buf[12+20];
+ SrsBuffer b(buf, sizeof(buf));
+
+ if (true) {
+ SrsMp4MediaHeaderBox box;
+ box.set_language0('C');
+ box.set_language1('N');
+ box.set_language2('E');
+ EXPECT_EQ(sizeof(buf), box.nb_bytes());
+ HELPER_EXPECT_SUCCESS(box.encode(&b));
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ box.dumps(ss, dc);
+
+ string v = ss.str();
+ EXPECT_STREQ("mdhd, 32B, FB(4B), TBN=0, 0TBN, LANG=cne\n", v.c_str());
+ }
+
+ if (true) {
+ b.skip(-1 * b.pos());
+ SrsMp4MediaHeaderBox box;
+ HELPER_EXPECT_SUCCESS(box.decode(&b));
+ }
+ }
+
+ if (true) {
+ SrsMp4MediaHeaderBox box;
+
+ box.set_language0('C');
+ EXPECT_EQ('c', box.language0());
+
+ box.set_language1('N');
+ EXPECT_EQ('n', box.language1());
+
+ box.set_language2('E');
+ EXPECT_EQ('e', box.language2());
+ }
+
+ if (true) {
+ SrsMp4HandlerReferenceBox box;
+ box.handler_type = SrsMp4HandlerTypeVIDE;
+ EXPECT_TRUE(box.is_video());
+ }
+
+ if (true) {
+ SrsMp4HandlerReferenceBox box;
+ box.handler_type = SrsMp4HandlerTypeSOUN;
+ EXPECT_TRUE(box.is_audio());
+ }
+}
+
+VOID TEST(KernelMp4Test, HDLRBox)
+{
+ srs_error_t err;
+
+ if (true) {
+ char buf[12+21];
+ SrsBuffer b(buf, sizeof(buf));
+
+ if (true) {
+ SrsMp4HandlerReferenceBox box;
+ box.handler_type = SrsMp4HandlerTypeSOUN;
+ EXPECT_EQ(sizeof(buf), box.nb_bytes());
+ HELPER_EXPECT_SUCCESS(box.encode(&b));
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ box.dumps(ss, dc);
+
+ string v = ss.str();
+ EXPECT_STREQ("hdlr, 33B, FB(4B), soun\n", v.c_str());
+ }
+
+ if (true) {
+ b.skip(-1 * b.pos());
+ SrsMp4HandlerReferenceBox box;
+ HELPER_EXPECT_SUCCESS(box.decode(&b));
+ EXPECT_EQ(SrsMp4HandlerTypeSOUN, box.handler_type);
+ }
+ }
+
+ if (true) {
+ char buf[12+21];
+ SrsBuffer b(buf, sizeof(buf));
+
+ if (true) {
+ SrsMp4HandlerReferenceBox box;
+ box.handler_type = SrsMp4HandlerTypeVIDE;
+ EXPECT_EQ(sizeof(buf), box.nb_bytes());
+ HELPER_EXPECT_SUCCESS(box.encode(&b));
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ box.dumps(ss, dc);
+
+ string v = ss.str();
+ EXPECT_STREQ("hdlr, 33B, FB(4B), vide\n", v.c_str());
+ }
+
+ if (true) {
+ b.skip(-1 * b.pos());
+ SrsMp4HandlerReferenceBox box;
+ HELPER_EXPECT_SUCCESS(box.decode(&b));
+ EXPECT_EQ(SrsMp4HandlerTypeVIDE, box.handler_type);
+ }
+ }
+
+ if (true) {
+ char buf[12+24];
+ SrsBuffer b(buf, sizeof(buf));
+
+ if (true) {
+ SrsMp4HandlerReferenceBox box;
+ box.handler_type = SrsMp4HandlerTypeVIDE;
+ box.name = "srs";
+ EXPECT_EQ(sizeof(buf), box.nb_bytes());
+ HELPER_EXPECT_SUCCESS(box.encode(&b));
+
+ stringstream ss;
+ SrsMp4DumpContext dc;
+ box.dumps(ss, dc);
+
+ string v = ss.str();
+ EXPECT_STREQ("hdlr, 36B, FB(4B), vide, srs\n", v.c_str());
+ }
+
+ if (true) {
+ b.skip(-1 * b.pos());
+ SrsMp4HandlerReferenceBox box;
+ HELPER_EXPECT_SUCCESS(box.decode(&b));
+ EXPECT_EQ(SrsMp4HandlerTypeVIDE, box.handler_type);
+ }
+ }
+
+ if (true) {
+ SrsMp4MediaInformationBox box;
+ SrsMp4VideoMeidaHeaderBox* vmhd = new SrsMp4VideoMeidaHeaderBox();
+ box.set_vmhd(vmhd);
+ EXPECT_TRUE(vmhd == box.vmhd());
+ }
+
+ if (true) {
+ SrsMp4MediaInformationBox box;
+ SrsMp4SoundMeidaHeaderBox* smhd = new SrsMp4SoundMeidaHeaderBox();
+ box.set_smhd(smhd);
+ EXPECT_TRUE(smhd == box.smhd());
+ }
+
+ if (true) {
+ SrsMp4MediaInformationBox box;
+ SrsMp4DataInformationBox* dinf = new SrsMp4DataInformationBox();
+ box.set_dinf(dinf);
+ EXPECT_TRUE(dinf == box.dinf());
+ }
+
+ if (true) {
+ SrsMp4DataInformationBox box;
+ SrsMp4DataReferenceBox* dref = new SrsMp4DataReferenceBox();
+ box.set_dref(dref);
+ EXPECT_TRUE(dref == box.dref());
+ }
+}
+
diff --git a/trunk/src/utest/srs_utest_mp4.hpp b/trunk/src/utest/srs_utest_mp4.hpp
new file mode 100644
index 000000000..e5ba3d2fa
--- /dev/null
+++ b/trunk/src/utest/srs_utest_mp4.hpp
@@ -0,0 +1,33 @@
+/*
+The MIT License (MIT)
+
+Copyright (c) 2013-2020 Winlin
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#ifndef SRS_UTEST_MP4_HPP
+#define SRS_UTEST_MP4_HPP
+
+/*
+#include
+*/
+#include
+
+#endif
+
diff --git a/trunk/src/utest/srs_utest_protocol.cpp b/trunk/src/utest/srs_utest_protocol.cpp
index 8201fb2f5..028cd4510 100644
--- a/trunk/src/utest/srs_utest_protocol.cpp
+++ b/trunk/src/utest/srs_utest_protocol.cpp
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) 2013-2019 Winlin
+Copyright (c) 2013-2020 Winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/utest/srs_utest_protocol.hpp b/trunk/src/utest/srs_utest_protocol.hpp
index 21d068e35..4a133127d 100644
--- a/trunk/src/utest/srs_utest_protocol.hpp
+++ b/trunk/src/utest/srs_utest_protocol.hpp
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) 2013-2019 Winlin
+Copyright (c) 2013-2020 Winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/utest/srs_utest_reload.cpp b/trunk/src/utest/srs_utest_reload.cpp
index 4897b48a0..115951755 100644
--- a/trunk/src/utest/srs_utest_reload.cpp
+++ b/trunk/src/utest/srs_utest_reload.cpp
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) 2013-2019 Winlin
+Copyright (c) 2013-2020 Winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/utest/srs_utest_reload.hpp b/trunk/src/utest/srs_utest_reload.hpp
index 836ac8991..ff8d7894f 100644
--- a/trunk/src/utest/srs_utest_reload.hpp
+++ b/trunk/src/utest/srs_utest_reload.hpp
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) 2013-2019 Winlin
+Copyright (c) 2013-2020 Winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/utest/srs_utest_rtmp.cpp b/trunk/src/utest/srs_utest_rtmp.cpp
index 09ea6cd5c..11a2df3ab 100644
--- a/trunk/src/utest/srs_utest_rtmp.cpp
+++ b/trunk/src/utest/srs_utest_rtmp.cpp
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) 2013-2019 Winlin
+Copyright (c) 2013-2020 Winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/utest/srs_utest_rtmp.hpp b/trunk/src/utest/srs_utest_rtmp.hpp
index f18488104..9a850d261 100644
--- a/trunk/src/utest/srs_utest_rtmp.hpp
+++ b/trunk/src/utest/srs_utest_rtmp.hpp
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) 2013-2019 Winlin
+Copyright (c) 2013-2020 Winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/utest/srs_utest_service.cpp b/trunk/src/utest/srs_utest_service.cpp
index 5d1acb102..77218d982 100644
--- a/trunk/src/utest/srs_utest_service.cpp
+++ b/trunk/src/utest/srs_utest_service.cpp
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) 2013-2019 Winlin
+Copyright (c) 2013-2020 Winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/trunk/src/utest/srs_utest_service.hpp b/trunk/src/utest/srs_utest_service.hpp
index e6e2e2228..819272dc6 100644
--- a/trunk/src/utest/srs_utest_service.hpp
+++ b/trunk/src/utest/srs_utest_service.hpp
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) 2013-2019 Winlin
+Copyright (c) 2013-2020 Winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in