Commit Graph

5 Commits

Author SHA1 Message Date
Haibo Chen(陈海博)
33b0a0fe7d Fix error about TestRtcPublish_HttpFlvPlay. v7.0.36 (#4363)
In the scenario of converting WebRTC to RTMP, this conversion will not
proceed until an SenderReport is received; for reference, see:
https://github.com/ossrs/srs/pull/2470.
Thus, if HTTP-FLV streaming is attempted before the SR is received, the
FLV Header will contain only audio, devoid of video content.
This error can be resolved by disabling `guess_has_av` in the
configuration file, since we can guarantee that both audio and video are
present in the test cases.

However, in the original regression tests, the
`TestRtcPublish_HttpFlvPlay` test case contains a bug:

5a404c089b/trunk/3rdparty/srs-bench/srs/rtc_test.go (L2421-L2424)

The test would pass when `hasAudio` is true and `hasVideo` is false,
which is actually incorrect. Therefore, it has been revised so that the
test now only passes if both values are true.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: winlin <winlinvip@gmail.com>
2025-05-29 14:07:56 -04:00
Haibo Chen(陈海博)
9c559dcb48 VSCode: Support GDB on Linux and LLDB on macOS. v7.0.35 (#4362)
Co-authored-by: winlin <winlinvip@gmail.com>
2025-05-29 08:44:44 -04:00
winlin
5a404c089b VSCode: Support debug and run utest in VSC. 2025-05-28 18:38:56 -04:00
Winlin
4e55bc83b7 Support custom deleter for SrsUniquePtr. (#4309)
SrsUniquePtr does not support array or object created by malloc, because
we only use delete to dispose the resource. You can use a custom
function to free the memory allocated by malloc or other allocators.
```cpp
      char* p = (char*)malloc(1024);
      SrsUniquePtr<char> ptr(p, your_free_chars);
```

This is used to replace the SrsAutoFreeH. For example:
```cpp
      addrinfo* r = NULL;
      SrsAutoFreeH(addrinfo, r, freeaddrinfo);
      getaddrinfo("127.0.0.1", NULL, &hints, &r);
```

Now, this can be replaced by:
```cpp
      addrinfo* r = NULL;
      getaddrinfo("127.0.0.1", NULL, &hints, &r);
      SrsUniquePtr<addrinfo> r2(r, freeaddrinfo);
```

Please aware that there is a slight difference between SrsAutoFreeH and
SrsUniquePtr. SrsAutoFreeH will track the address of pointer, while
SrsUniquePtr will not.
```cpp
      addrinfo* r = NULL;
      SrsAutoFreeH(addrinfo, r, freeaddrinfo); // r will be freed even r is changed later.
      SrsUniquePtr<addrinfo> ptr(r, freeaddrinfo); // crash because r is an invalid pointer.
```

---------

Co-authored-by: Haibo Chen <495810242@qq.com>
Co-authored-by: john <hondaxiao@tencent.com>
2025-04-26 00:01:34 -04:00
winlin
40e8ed4586 VSCode: Support IDE vscode to run and debug. 2024-09-10 17:46:54 +08:00