Winlin
23d2602c34
UniquePtr: Support SrsUniquePtr to replace SrsAutoFree. v6.0.136 ( #4109 )
...
To manage an object:
```cpp
// Before
MyClass* ptr = new MyClass();
SrsAutoFree(MyClass, ptr);
ptr->do_something();
// Now
SrsUniquePtr<MyClass> ptr(new MyClass());
ptr->do_something();
```
To manage an array of objects:
```cpp
// Before
char* ptr = new char[10];
SrsAutoFreeA(char, ptr);
ptr[0] = 0xf;
// Now
SrsUniquePtr<char[]> ptr(new char[10]);
ptr[0] = 0xf;
```
In fact, SrsUniquePtr is a limited subset of SrsAutoFree, mainly
managing pointers and arrays. SrsUniquePtr is better than SrsAutoFree
because it has the same API to standard unique ptr.
```cpp
SrsUniquePtr<MyClass> ptr(new MyClass());
ptr->do_something();
MyClass* p = ptr.get();
```
SrsAutoFree actually uses a pointer to a pointer, so it can be set to
NULL, allowing the pointer's value to be changed later (this usage is
different from SrsUniquePtr).
```cpp
// OK to free ptr correctly.
MyClass* ptr;
SrsAutoFree(MyClass, ptr);
ptr = new MyClass();
// Crash because ptr is an invalid pointer.
MyClass* ptr;
SrsUniquePtr<MyClass> ptr(ptr);
ptr = new MyClass();
```
Additionally, SrsAutoFreeH can use specific release functions, which
SrsUniquePtr does not support.
---------
Co-authored-by: Jacob Su <suzp1984@gmail.com>
2024-07-09 10:29:36 +08:00
winlin
2a2da2253f
Switch to 2013-2024. v6.0.109
2024-01-01 10:51:24 +08:00
winlin
29eff1a242
Refine LICENSE.
2023-10-23 14:33:19 +08:00
winlin
c46ef81ff2
SRS5: Update license date to 2023. v5.0.123
...
PICK 72f8ed4916
2023-01-01 08:56:20 +08:00
winlin
378bffa34f
Micro changes and refines.
2022-09-30 17:57:48 +08:00
winlin
173c683566
GB28181: Refine SRS listeners without wrapper.
2022-09-30 12:38:02 +08:00
winlin
625069af7f
WebRTC: Extract SrsRtcNetwork layer for UDP/TCP.
2022-09-04 20:14:09 +08:00
winlin
1630918b0f
Refactor: Use compositor for ISrsKbpsDelta. v5.0.51
2022-08-30 09:26:51 +08:00
winlin
457738f6eb
Fix #2881 : HTTP: Support merging api to server. v5.0.47
2022-08-28 13:11:31 +08:00
winlin
d117145b95
Update date from 2021 to 2022.
2022-06-20 19:22:25 +08:00
winlin
fa78cf3354
Prefix with srs_protocol in protocol directory.
2022-06-09 20:26:58 +08:00
winlin
d5c86dc5fa
Switch LICENSE from MIT to **MIT or MulanPSL-2.0**. v5.0.21
2022-01-13 18:40:22 +08:00
winlin
40f8460929
Squash: Merge SRS 4.0
2021-09-17 14:48:22 +08:00
Winlin
c8a1e0f3da
Refine AUTHORS.txt to AUTHORS.md, etc. 5.0.8 ( #2464 )
...
* Refine AUTHORS.txt to AUTHORS.md, etc. 5.0.8
* Update README.md
* Update README.md
* Refine format for AUTHORS.md
2021-07-08 14:30:47 +08:00
winlin
15901cacee
SquashSRS4: Use SPDX-License-Identifier: MIT. 5.0.3
2021-05-31 13:42:20 +08:00
winlin
8b74c7cb89
SquashSRS4: Happy 2021
2021-04-16 09:29:43 +08:00
winlin
32c1832d64
For #1657 , refine code
2020-11-07 07:39:50 +08:00
winlin
7916214e27
For #1657 , refine api for http
2020-11-06 09:51:04 +08:00
winlin
c3d290013e
For #1657 , handle on_message_done
2020-11-05 18:34:56 +08:00
winlin
4b082ea96c
For #1657 , refine http api disconnect log
2020-11-05 18:19:43 +08:00
winlin
74799a31e3
For #1657 , refine on_http_message with response writer
2020-11-05 18:08:13 +08:00
winlin
fc21b31714
For #1657 , refine the context for disposing
2020-11-05 17:16:59 +08:00
winlin
0a3a38762a
For #1657 : Remove duplicated code, merge http api with conn
2020-11-05 16:46:16 +08:00
winlin
24125b9770
For #1657 : Refine connection arch, remove hierachy
2020-11-05 15:08:36 +08:00
winlin
4ba66b388b
For #1657 : Refine TCP connections arch
2020-11-05 11:47:24 +08:00
winlin
64705d1cc8
RTC: Refine resouce management
2020-09-19 10:30:05 +08:00
winlin
4eae93d27b
Rename SrsCoroutineManager to SrsConnectionManager
2020-09-11 17:20:41 +08:00
winlin
88826aae8f
Rename SrsConnection to SrsTcpConnection
2020-09-11 16:59:22 +08:00
winlin
81a7c252d6
TCP: Log the remote port for client.
2020-07-04 17:19:08 +08:00
winlin
20b9d6ab02
For #1598 , support SLB health checking by TCP. 3.0.123
2020-02-21 23:51:40 +08:00
winlin
d783a12f89
Happy 2020
2019-12-30 10:10:35 +08:00
winlin
7eccc9da26
For #1508 , support chunk length and content in multiple parts.
2019-12-24 14:58:35 +08:00
winlin
e436cc5665
Refine SrsBasicRtmpClient in time unit.
2019-04-22 08:03:12 +08:00
winlin
92980a0ca2
Refine SRS_CONSTS_RTMP_TMMS in time unit
2019-04-11 09:18:20 +08:00
winlin
5b0e0d0838
Refine SRS_CONSTS_RTMP_PULSE_TMMS in time unit
2019-04-11 08:43:42 +08:00
winlin
b2d1d84634
Change to 2019
2019-01-01 21:37:28 +08:00
winlin
2e9bf2af83
Always enable SRS_StreamCaster
2018-12-22 20:45:25 +08:00
winlin
68a1656e07
Fix #1031 , Always use vhost in stream query, the unify uri. 3.0.35
2018-08-02 09:17:49 +08:00
winlin
ca1395a807
Change date from 2017 to 2018
2018-01-07 10:58:53 +08:00
winlin
e2c1f58674
For #913 , APP support complex error.
2018-01-01 21:20:57 +08:00
winlin
9f5224c34a
For #913 , use complex error for http
2017-07-29 21:39:57 +08:00
winlin
5c9a12e72a
For #913 , use complex error for listener
2017-07-29 12:45:17 +08:00
winlin
9db2a04c3b
For #913 , coroutine support complex error.
2017-06-11 18:44:20 +08:00
winlin
a20e2c3ef6
For #913 , refine server utility
2017-06-10 15:20:48 +08:00
winlin
1bf99e8f3e
For #907 , Wrap ST, only use in service ST.
2017-05-30 09:05:02 +08:00
winlin
3ffb0980f5
For #906 , #902 , use connection manager to remove connection
2017-05-29 18:34:41 +08:00
HungMingWu
815d50f00a
Remove warning: C++11 requires a space between string literal and macro ( #874 )
...
On Ubuntu 17.04, the default gcc compiler version is 6.3.0.
It switch standard from c++98 to c++11.
So it would generate verbose warnings.
2017-05-06 14:05:22 +08:00
winlin
d6e28bde69
Merge from SRS2.
2017-04-15 17:09:50 +08:00
haofz
52b6823a90
fix #826 , fix memory leak in streamCasterFlv ( #836 )
2017-04-15 16:56:28 +08:00
winlin
e3526c0cf6
For #820 , modules use service only.
2017-03-26 13:40:39 +08:00