1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-15 04:42:04 +00:00
Commit graph

189 commits

Author SHA1 Message Date
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
Jacob Su
baf22d01c1
Refine config directive token parsing. v6.0.135 (#4042)
make sure one directive token don't span more than two lines.

try to fix #2228

---------

Co-authored-by: winlin <winlinvip@gmail.com>
2024-07-08 18:19:25 +08:00
winlin
4b5ae7b3d2 Package script support extra options. v5.0.102 2022-12-03 18:56:21 +08:00
ChenGH
961f701929
Sanitizer: Support address sanitizer for x86_64 platform (#3212)
* Sanitizer: Support address sanitizer for x86_64 platform
* Sanitizer: Not mac os need -static-libasan
* Sanitizer: Add script for docker test.
* Sanitizer: Refine build script.
* Santizer: Fix ossrs/srs:dev-gcc7-cache cannot find libasan bug
* Sanitizer: Support sanitizer when use ossrs/srs:dev-cache and ubuntuxx-cache
* Sanitizer: Add sanitizer-static config

Co-authored-by: winlin <winlin@vip.126.com>
2022-10-23 07:21:15 +08:00
winlin
c225c3f745 Merge branch '4.0release' into develop 2022-03-18 12:03:52 +08:00
winlin
06cff31b24 Update script. 2022-03-18 12:02:49 +08:00
winlin
93aa0eb5ba Squash: Fix bugs 2022-01-13 18:26:28 +08:00
winlin
6a5bc27f9b Support configure with --config as default config file. v4.0.227 2022-01-13 15:16:54 +08:00
winlin
4110fb14cb Squash: Fix bugs. v5.0.20 2022-01-11 08:40:37 +08:00
winlin
6919011e86 Update sync script, ignore gb28181 2022-01-05 14:36:42 +08:00
winlin
e16830e989 Squash: Merge 4.0.201 2021-12-04 10:43:04 +08:00
winlin
bc063945f1 Build: Change make utest for test 2021-12-02 20:15:28 +08:00
winlin
04a8a2866b Release v4.0-b0, 4.0 beta0, v4.0.201, 144022 lines. 2021-12-01 10:39:26 +08:00
winlin
da7fac0939 Release SRS v5.0.19, develop version, not stable 2021-10-28 08:06:26 +08:00
winlin
e8380cda29 Demos: Remove the unused H5 demo files. (#2469) 2021-10-27 18:40:43 +08:00
winlin
4e6a3321cd Squash: Merge SRS 4.0 2021-10-12 14:04:02 +08:00
Haibo Chen
eb3bbf1bca For #2549: Fix duration issue for HLS on_hls. v4.0.176 2021-10-12 09:18:39 +08:00
winlin
a81aa2edc5 Squash: Merge SRS 4.0 2021-10-10 12:05:26 +08:00
winlin
9edf63bd30 3rdparty: Sync httpx-static 2021-10-10 11:37:19 +08:00
winlin
38b0b1dab2 Squash: Fix ingest bug. Refine AUTHORS. 2021-08-25 08:11:44 +08:00
winlin
4ca433d3f8 Refine push script 2021-07-19 07:51:35 +08:00
winlin
9f5d011687 Squash: Fix build fail for arm/aarch64 2021-06-30 10:28:23 +08:00
winlin
81a5c1b8da Move AUTHORS.txt to trunk for docker to access it 2021-06-30 08:20:53 +08:00
winlin
a594678e3d Squash #1685, #1282, #1547: Support ARM platform. 5.0.5 2021-06-22 07:49:48 +08:00
winlin
fed57f6f17 Refine scripts 2021-06-22 07:45:26 +08:00
winlin
7e657ae654 Refine AUTHORS format 2021-06-01 09:36:28 +08:00
winlin
689100f651 Refine AUTHORS format 2021-06-01 09:04:38 +08:00
winlin
15901cacee SquashSRS4: Use SPDX-License-Identifier: MIT. 5.0.3 2021-05-31 13:42:20 +08:00
winlin
3cd22b6e6e Use SPDX-License-Identifier: MIT. 4.0.124 2021-05-31 12:59:21 +08:00
winlin
34aa11b72a SquashSRS4: Update doc 2021-05-18 11:47:50 +08:00
winlin
476e114cc4 Update doc 2021-05-18 11:42:01 +08:00
winlin
becbe45bcd SquashSRS4: Add demo for RTC 2021-05-05 13:26:25 +08:00
winlin
b42bf496c7 Tools: Update script 2021-05-03 16:11:11 +08:00
winlin
dea6136238 Copy demos to SRS release 2021-05-03 08:49:16 +08:00
winlin
0b62216999 SquashSRS4: Support av1 for Chrome M90 enabled it. 2021-04-30 08:13:38 +08:00
winlin
a5727c373a Script: Remove unused git2unix.sh 2021-04-29 08:26:32 +08:00
winlin
e67207f4b1 Script: Refine package and install script 2021-04-26 14:20:18 +08:00
winlin
d4a8a72388 SquashSRS4: Add console. Disable cherrypy by default. 2021-04-24 19:45:05 +08:00
winlin
de1c7522f0 SquashSRS3: Add console 2021-04-24 19:07:37 +08:00
winlin
9ed7565789 SquashSRS3: Package srs-console 2021-04-24 17:51:05 +08:00
winlin
8b74c7cb89 SquashSRS4: Happy 2021 2021-04-16 09:29:43 +08:00
winlin
124455be09 Update script 2021-04-16 09:27:47 +08:00
winlin
1ee77614fb Refine comments 2021-04-05 12:14:26 +08:00
winlin
5139816feb Remove unused files 2020-06-03 18:14:18 +08:00
winlin
23ddcbdaed Update authors 2020-05-17 21:49:15 +08:00
winlin
9e031c9932 Update script 2020-04-18 15:34:36 +08:00
winlin
e4eb501c57 Fix the perf stat bytes bug 2020-04-17 16:36:56 +08:00
winlin
cac5bbddf6 Refine comments 2020-04-17 12:48:05 +08:00
winlin
14e3ec2fe8 For #307, drop frame when VBR too high 2020-04-17 12:30:53 +08:00
winlin
ef48507e80 Support padding max to 127 2020-04-16 09:07:42 +08:00