Add ignore configuration for cursor. v7.0.115 (#4547)
Cursor ignored. --------- Co-authored-by: Haibo Chen <495810242@qq.com> Co-authored-by: ZhangWei <zhangwei@jlsoft.com> Co-authored-by: winlin <winlinvip@gmail.com>
This commit is contained in:
parent
abacd680ba
commit
57c74d1cdb
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -28,12 +28,13 @@
|
||||||
|
|
||||||
# Apple-specific garbage files.
|
# Apple-specific garbage files.
|
||||||
.AppleDouble
|
.AppleDouble
|
||||||
|
|
||||||
.idea
|
.idea
|
||||||
|
.cursor/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
*.heap
|
*.heap
|
||||||
*.exe
|
*.exe
|
||||||
|
|
||||||
|
|
||||||
cmake-build-debug
|
cmake-build-debug
|
||||||
/build/
|
/build/
|
||||||
/trunk/cmake/build
|
/trunk/cmake/build
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ The changelog for SRS.
|
||||||
<a name="v7-changes"></a>
|
<a name="v7-changes"></a>
|
||||||
|
|
||||||
## SRS 7.0 Changelog
|
## SRS 7.0 Changelog
|
||||||
|
* v7.0, 2025-10-31, Merge [#4547](https://github.com/ossrs/srs/pull/4547): Add ignore configuration for cursor. v7.0.115 (#4547)
|
||||||
* v7.0, 2025-10-30, WebRTC: Use realtime for TWCC timestamp accuracy. v7.0.114
|
* v7.0, 2025-10-30, WebRTC: Use realtime for TWCC timestamp accuracy. v7.0.114
|
||||||
* v7.0, 2025-10-30, AI: HLS: Fix crash when segment is not open by adding NULL checks. v7.0.113 (#3431)
|
* v7.0, 2025-10-30, AI: HLS: Fix crash when segment is not open by adding NULL checks. v7.0.113 (#3431)
|
||||||
* v7.0, 2025-10-29, AI: AAC: Fix mono audio reported as stereo in HTTP API. v7.0.112 (#3556)
|
* v7.0, 2025-10-29, AI: AAC: Fix mono audio reported as stereo in HTTP API. v7.0.112 (#3556)
|
||||||
|
|
|
||||||
|
|
@ -1132,7 +1132,7 @@ srs_error_t SrsHlsFmp4Muxer::do_refresh_m3u8_segment(SrsHlsM4sSegment *segment,
|
||||||
}
|
}
|
||||||
// ss << segment->uri << SRS_CONSTS_LF;
|
// ss << segment->uri << SRS_CONSTS_LF;
|
||||||
ss << path.filepath_base(seg_uri) << SRS_CONSTS_LF;
|
ss << path.filepath_base(seg_uri) << SRS_CONSTS_LF;
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2947,4 +2947,3 @@ void SrsHls::hls_show_mux_log()
|
||||||
srsu2msi(controller_->duration()), controller_->deviation());
|
srsu2msi(controller_->duration()), controller_->deviation());
|
||||||
}
|
}
|
||||||
// LCOV_EXCL_STOP
|
// LCOV_EXCL_STOP
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,9 @@
|
||||||
|
|
||||||
#include <srs_core.hpp>
|
#include <srs_core.hpp>
|
||||||
|
|
||||||
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <sstream>
|
|
||||||
|
|
||||||
#include <srs_app_async_call.hpp>
|
#include <srs_app_async_call.hpp>
|
||||||
#include <srs_app_fragment.hpp>
|
#include <srs_app_fragment.hpp>
|
||||||
|
|
|
||||||
|
|
@ -731,4 +731,3 @@ srs_error_t SrsHttpStaticServer::mount_vhost(string vhost, string &pmount)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
// LCOV_EXCL_STOP
|
// LCOV_EXCL_STOP
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -817,7 +817,7 @@ srs_error_t SrsUdpMuxListener::cycle()
|
||||||
pprint->elapse();
|
pprint->elapse();
|
||||||
if (pprint->can_print()) {
|
if (pprint->can_print()) {
|
||||||
// LCOV_EXCL_START
|
// LCOV_EXCL_START
|
||||||
|
|
||||||
// For performance, only restore context when output log.
|
// For performance, only restore context when output log.
|
||||||
_srs_context->set_id(cid_);
|
_srs_context->set_id(cid_);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -172,4 +172,3 @@ void SrsFileLog::open_log_file()
|
||||||
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
|
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
|
||||||
}
|
}
|
||||||
// LCOV_EXCL_STOP
|
// LCOV_EXCL_STOP
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -371,4 +371,3 @@ void SrsProcess::fast_kill()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// LCOV_EXCL_STOP
|
// LCOV_EXCL_STOP
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,4 +24,3 @@ srs_error_t ISrsReloadHandler::on_reload_vhost_chunk_size(string /*vhost*/)
|
||||||
return srs_success;
|
return srs_success;
|
||||||
}
|
}
|
||||||
// LCOV_EXCL_STOP
|
// LCOV_EXCL_STOP
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1532,10 +1532,10 @@ srs_error_t SrsRtcPublishStream::on_twcc(uint16_t sn)
|
||||||
{
|
{
|
||||||
srs_error_t err = srs_success;
|
srs_error_t err = srs_success;
|
||||||
|
|
||||||
// To get more accurate timestamp, and avoid deviation caused by coroutine scheduler,
|
// To get more accurate timestamp, and avoid deviation caused by coroutine scheduler,
|
||||||
// we use realtime for TWCC.
|
// we use realtime for TWCC.
|
||||||
srs_utime_t now = srs_time_now_realtime();
|
srs_utime_t now = srs_time_now_realtime();
|
||||||
|
|
||||||
err = rtcp_twcc_->recv_packet(sn, now);
|
err = rtcp_twcc_->recv_packet(sn, now);
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -1129,4 +1129,3 @@ srs_error_t SrsSRTP::unprotect_rtcp(void *packet, int *nb_plaintext)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
// LCOV_EXCL_STOP
|
// LCOV_EXCL_STOP
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -596,4 +596,3 @@ srs_error_t SrsRtcSessionManager::on_udp_packet(ISrsUdpMuxSocket *skt)
|
||||||
return srs_error_new(ERROR_RTC_UDP, "unknown packet");
|
return srs_error_new(ERROR_RTC_UDP, "unknown packet");
|
||||||
}
|
}
|
||||||
// LCOV_EXCL_STOP
|
// LCOV_EXCL_STOP
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -634,7 +634,8 @@ srs_error_t SrsRtmpConn::stream_service_cycle()
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
return srs_error_new(ERROR_SYSTEM_CLIENT_INVALID, "rtmp: unknown client type=%d", info_->type_);
|
return srs_error_new(ERROR_SYSTEM_CLIENT_INVALID, "rtmp: unknown client type=%d", info_->type_);
|
||||||
}}
|
}
|
||||||
|
}
|
||||||
// LCOV_EXCL_STOP
|
// LCOV_EXCL_STOP
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
|
|
@ -759,7 +760,7 @@ srs_error_t SrsRtmpConn::redirect_to_origin_cluster(SrsSharedPtr<SrsLiveSource>
|
||||||
|
|
||||||
string rurl = srs_net_url_encode_rtmp_url(host, port, req->host_, req->vhost_, req->app_, req->stream_, req->param_);
|
string rurl = srs_net_url_encode_rtmp_url(host, port, req->host_, req->vhost_, req->app_, req->stream_, req->param_);
|
||||||
srs_trace("rtmp: redirect in cluster, from=%s:%d, target=%s:%d, url=%s, rurl=%s",
|
srs_trace("rtmp: redirect in cluster, from=%s:%d, target=%s:%d, url=%s, rurl=%s",
|
||||||
req->host_.c_str(), req->port_, host.c_str(), port, url.c_str(), rurl.c_str());
|
req->host_.c_str(), req->port_, host.c_str(), port, url.c_str(), rurl.c_str());
|
||||||
|
|
||||||
// Ignore if host or port is invalid.
|
// Ignore if host or port is invalid.
|
||||||
if (host.empty() || port == 0) {
|
if (host.empty() || port == 0) {
|
||||||
|
|
@ -1676,4 +1677,3 @@ void SrsRtmpConn::expire()
|
||||||
trd_->interrupt();
|
trd_->interrupt();
|
||||||
}
|
}
|
||||||
// LCOV_EXCL_STOP
|
// LCOV_EXCL_STOP
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2638,4 +2638,3 @@ void SrsLiveSource::on_edge_proxy_unpublish()
|
||||||
publish_edge_->on_proxy_unpublish();
|
publish_edge_->on_proxy_unpublish();
|
||||||
}
|
}
|
||||||
// LCOV_EXCL_STOP
|
// LCOV_EXCL_STOP
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2042,4 +2042,3 @@ void SrsPidFileLocker::close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// LCOV_EXCL_STOP
|
// LCOV_EXCL_STOP
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
#include <srs_core.hpp>
|
#include <srs_core.hpp>
|
||||||
|
|
||||||
// Unique ptr smart pointer, only support unique ptr, with limited APIs and features,
|
// Unique ptr smart pointer, only support unique ptr, with limited APIs and features,
|
||||||
// see https://github.com/ossrs/srs/discussions/3667#discussioncomment-8969107
|
// see https://github.com/ossrs/srs/issues/4551
|
||||||
//
|
//
|
||||||
// Usage:
|
// Usage:
|
||||||
// SrsUniquePtr<MyClass> ptr(new MyClass());
|
// SrsUniquePtr<MyClass> ptr(new MyClass());
|
||||||
|
|
@ -89,7 +89,7 @@ SRS_DECLARE_PRIVATE: // clang-format on
|
||||||
};
|
};
|
||||||
|
|
||||||
// The unique ptr for array objects, only support unique ptr, with limited APIs and features,
|
// The unique ptr for array objects, only support unique ptr, with limited APIs and features,
|
||||||
// see https://github.com/ossrs/srs/discussions/3667#discussioncomment-8969107
|
// see https://github.com/ossrs/srs/issues/4551
|
||||||
//
|
//
|
||||||
// Usage:
|
// Usage:
|
||||||
// SrsUniquePtr<MyClass[]> ptr(new MyClass[10]);
|
// SrsUniquePtr<MyClass[]> ptr(new MyClass[10]);
|
||||||
|
|
@ -156,7 +156,7 @@ SRS_DECLARE_PRIVATE: // clang-format on
|
||||||
};
|
};
|
||||||
|
|
||||||
// Shared ptr smart pointer, only support shared ptr, no weak ptr, no shared from this, no inheritance,
|
// Shared ptr smart pointer, only support shared ptr, no weak ptr, no shared from this, no inheritance,
|
||||||
// no comparing, see https://github.com/ossrs/srs/discussions/3667#discussioncomment-8969107
|
// no comparing, see https://github.com/ossrs/srs/issues/4551
|
||||||
//
|
//
|
||||||
// Usage:
|
// Usage:
|
||||||
// SrsSharedPtr<MyClass> ptr(new MyClass());
|
// SrsSharedPtr<MyClass> ptr(new MyClass());
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
// SrsAutoFree(MyClass, p); // p will be freed even p is changed later.
|
// SrsAutoFree(MyClass, p); // p will be freed even p is changed later.
|
||||||
// SrsUniquePtr ptr(p); // crash because p is an invalid pointer.
|
// SrsUniquePtr ptr(p); // crash because p is an invalid pointer.
|
||||||
//
|
//
|
||||||
// See https://github.com/ossrs/srs/discussions/3667#discussioncomment-8969107 for more details.
|
// See https://github.com/ossrs/srs/issues/4551 for more details.
|
||||||
//
|
//
|
||||||
// To delete array. Please use SrsUniquePtr instead. For example:
|
// To delete array. Please use SrsUniquePtr instead. For example:
|
||||||
// MyClass** pa = new MyClass*[size];
|
// MyClass** pa = new MyClass*[size];
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
// SrsAutoFreeA(MyClass*, pa); // pa will be freed even pa is changed later.
|
// SrsAutoFreeA(MyClass*, pa); // pa will be freed even pa is changed later.
|
||||||
// SrsUniquePtr<MyClass[]> ptr(pa); // crash because pa is an invalid pointer.
|
// SrsUniquePtr<MyClass[]> ptr(pa); // crash because pa is an invalid pointer.
|
||||||
//
|
//
|
||||||
// See https://github.com/ossrs/srs/discussions/3667#discussioncomment-8969107 for more details.
|
// See https://github.com/ossrs/srs/issues/4551 for more details.
|
||||||
//
|
//
|
||||||
// Use hook instead of delete. Please use SrsUniquePtr instead. For example:
|
// Use hook instead of delete. Please use SrsUniquePtr instead. For example:
|
||||||
// addrinfo* r = NULL;
|
// addrinfo* r = NULL;
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
// SrsAutoFreeH(addrinfo, r, freeaddrinfo); // r will be freed even r is changed later.
|
// 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.
|
// SrsUniquePtr<addrinfo> ptr(r, freeaddrinfo); // crash because r is an invalid pointer.
|
||||||
//
|
//
|
||||||
// See https://github.com/ossrs/srs/discussions/3667#discussioncomment-8969107 for more details.
|
// See https://github.com/ossrs/srs/issues/4551 for more details.
|
||||||
//
|
//
|
||||||
// The template implementation.
|
// The template implementation.
|
||||||
// template<class T>
|
// template<class T>
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,6 @@
|
||||||
|
|
||||||
#define VERSION_MAJOR 7
|
#define VERSION_MAJOR 7
|
||||||
#define VERSION_MINOR 0
|
#define VERSION_MINOR 0
|
||||||
#define VERSION_REVISION 114
|
#define VERSION_REVISION 115
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -484,4 +484,3 @@ srs_error_t run_srs_server()
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
// LCOV_EXCL_STOP
|
// LCOV_EXCL_STOP
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -613,7 +613,7 @@ void retrieve_local_ips(SrsProtocolUtility *utility)
|
||||||
bool loopback = (cur->ifa_flags & IFF_LOOPBACK);
|
bool loopback = (cur->ifa_flags & IFF_LOOPBACK);
|
||||||
if (ipv4 && ready && !ignored) {
|
if (ipv4 && ready && !ignored) {
|
||||||
discover_network_iface(utility, cur, ips, ss0, ss1, false, loopback);
|
discover_network_iface(utility, cur, ips, ss0, ss1, false, loopback);
|
||||||
}
|
}
|
||||||
// LCOV_EXCL_STOP
|
// LCOV_EXCL_STOP
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1103,7 +1103,7 @@ VOID TEST(AppHlsTest, HlsControllerWriteAudioTypicalScenario)
|
||||||
MockHlsRequest mock_request("__defaultVhost__", "live", "test");
|
MockHlsRequest mock_request("__defaultVhost__", "live", "test");
|
||||||
|
|
||||||
// Cast to concrete type to access private members for testing
|
// Cast to concrete type to access private members for testing
|
||||||
SrsHlsMuxer *muxer = dynamic_cast<SrsHlsMuxer*>(controller->muxer_);
|
SrsHlsMuxer *muxer = dynamic_cast<SrsHlsMuxer *>(controller->muxer_);
|
||||||
srs_assert(muxer);
|
srs_assert(muxer);
|
||||||
|
|
||||||
// Set up muxer with required fields
|
// Set up muxer with required fields
|
||||||
|
|
@ -1419,7 +1419,7 @@ VOID TEST(AppHlsTest, HlsControllerSelectionTypicalScenario)
|
||||||
HELPER_EXPECT_SUCCESS(controller->initialize());
|
HELPER_EXPECT_SUCCESS(controller->initialize());
|
||||||
|
|
||||||
// Cast to concrete type to access private members for testing
|
// Cast to concrete type to access private members for testing
|
||||||
SrsHlsMuxer *muxer = dynamic_cast<SrsHlsMuxer*>(controller->muxer_);
|
SrsHlsMuxer *muxer = dynamic_cast<SrsHlsMuxer *>(controller->muxer_);
|
||||||
srs_assert(muxer);
|
srs_assert(muxer);
|
||||||
|
|
||||||
// Test initial state - no current segment
|
// Test initial state - no current segment
|
||||||
|
|
@ -1490,7 +1490,7 @@ VOID TEST(AppHlsTest, HlsControllerOnPublishTypicalScenario)
|
||||||
HELPER_EXPECT_SUCCESS(controller->initialize());
|
HELPER_EXPECT_SUCCESS(controller->initialize());
|
||||||
|
|
||||||
// Cast to concrete type to access private members for testing
|
// Cast to concrete type to access private members for testing
|
||||||
SrsHlsMuxer *muxer = dynamic_cast<SrsHlsMuxer*>(controller->muxer_);
|
SrsHlsMuxer *muxer = dynamic_cast<SrsHlsMuxer *>(controller->muxer_);
|
||||||
srs_assert(muxer);
|
srs_assert(muxer);
|
||||||
|
|
||||||
// Create mock request
|
// Create mock request
|
||||||
|
|
@ -1560,7 +1560,7 @@ VOID TEST(AppHlsTest, HlsControllerOnUnpublishTypicalScenario)
|
||||||
HELPER_EXPECT_SUCCESS(controller->initialize());
|
HELPER_EXPECT_SUCCESS(controller->initialize());
|
||||||
|
|
||||||
// Cast to concrete type to access private members for testing
|
// Cast to concrete type to access private members for testing
|
||||||
SrsHlsMuxer *muxer = dynamic_cast<SrsHlsMuxer*>(controller->muxer_);
|
SrsHlsMuxer *muxer = dynamic_cast<SrsHlsMuxer *>(controller->muxer_);
|
||||||
srs_assert(muxer);
|
srs_assert(muxer);
|
||||||
|
|
||||||
// Create mock request
|
// Create mock request
|
||||||
|
|
@ -1616,7 +1616,7 @@ VOID TEST(AppHlsTest, HlsControllerWriteVideoTypicalScenario)
|
||||||
HELPER_EXPECT_SUCCESS(controller->initialize());
|
HELPER_EXPECT_SUCCESS(controller->initialize());
|
||||||
|
|
||||||
// Cast to concrete type to access private members for testing
|
// Cast to concrete type to access private members for testing
|
||||||
SrsHlsMuxer *muxer = dynamic_cast<SrsHlsMuxer*>(controller->muxer_);
|
SrsHlsMuxer *muxer = dynamic_cast<SrsHlsMuxer *>(controller->muxer_);
|
||||||
srs_assert(muxer);
|
srs_assert(muxer);
|
||||||
|
|
||||||
// Create mock request
|
// Create mock request
|
||||||
|
|
|
||||||
|
|
@ -5,22 +5,22 @@
|
||||||
//
|
//
|
||||||
#include <srs_utest_ai24.hpp>
|
#include <srs_utest_ai24.hpp>
|
||||||
|
|
||||||
#include <srs_app_rtc_source.hpp>
|
|
||||||
#include <srs_kernel_error.hpp>
|
|
||||||
#include <srs_kernel_rtc_rtcp.hpp>
|
|
||||||
#include <srs_protocol_sdp.hpp>
|
|
||||||
#include <srs_kernel_packet.hpp>
|
|
||||||
#include <srs_kernel_codec.hpp>
|
|
||||||
#include <srs_app_hls.hpp>
|
|
||||||
#include <srs_utest_manual_mock.hpp>
|
|
||||||
#include <srs_utest_manual_kernel.hpp>
|
|
||||||
#include <srs_app_config.hpp>
|
#include <srs_app_config.hpp>
|
||||||
#include <srs_app_http_hooks.hpp>
|
|
||||||
#include <srs_app_utility.hpp>
|
|
||||||
#include <srs_kernel_utility.hpp>
|
|
||||||
#include <srs_protocol_utility.hpp>
|
|
||||||
#include <srs_app_fragment.hpp>
|
#include <srs_app_fragment.hpp>
|
||||||
|
#include <srs_app_hls.hpp>
|
||||||
|
#include <srs_app_http_hooks.hpp>
|
||||||
|
#include <srs_app_rtc_source.hpp>
|
||||||
#include <srs_app_server.hpp>
|
#include <srs_app_server.hpp>
|
||||||
|
#include <srs_app_utility.hpp>
|
||||||
|
#include <srs_kernel_codec.hpp>
|
||||||
|
#include <srs_kernel_error.hpp>
|
||||||
|
#include <srs_kernel_packet.hpp>
|
||||||
|
#include <srs_kernel_rtc_rtcp.hpp>
|
||||||
|
#include <srs_kernel_utility.hpp>
|
||||||
|
#include <srs_protocol_sdp.hpp>
|
||||||
|
#include <srs_protocol_utility.hpp>
|
||||||
|
#include <srs_utest_manual_kernel.hpp>
|
||||||
|
#include <srs_utest_manual_mock.hpp>
|
||||||
|
|
||||||
#ifdef SRS_FFMPEG_FIT
|
#ifdef SRS_FFMPEG_FIT
|
||||||
#include <srs_app_rtc_codec.hpp>
|
#include <srs_app_rtc_codec.hpp>
|
||||||
|
|
@ -389,7 +389,7 @@ VOID TEST(ParsedPacketTest, CopyParsedVideoPacket)
|
||||||
|
|
||||||
// Add sample data
|
// Add sample data
|
||||||
uint8_t sample_data[] = {0x65, 0x88, 0x84, 0x00};
|
uint8_t sample_data[] = {0x65, 0x88, 0x84, 0x00};
|
||||||
HELPER_EXPECT_SUCCESS(packet.add_sample((char*)sample_data, sizeof(sample_data)));
|
HELPER_EXPECT_SUCCESS(packet.add_sample((char *)sample_data, sizeof(sample_data)));
|
||||||
|
|
||||||
// Copy the packet
|
// Copy the packet
|
||||||
SrsParsedVideoPacket *copied = packet.copy();
|
SrsParsedVideoPacket *copied = packet.copy();
|
||||||
|
|
@ -517,7 +517,7 @@ VOID TEST(DvrAsyncCallOnHlsTest, CallWithMultipleHooks)
|
||||||
// Mock HLS muxer for testing SrsHlsController::reap_segment
|
// Mock HLS muxer for testing SrsHlsController::reap_segment
|
||||||
class MockHlsMuxerForReapSegment : public ISrsHlsMuxer
|
class MockHlsMuxerForReapSegment : public ISrsHlsMuxer
|
||||||
{
|
{
|
||||||
SRS_DECLARE_PRIVATE:
|
SRS_DECLARE_PRIVATE:
|
||||||
int segment_close_count_;
|
int segment_close_count_;
|
||||||
int segment_open_count_;
|
int segment_open_count_;
|
||||||
int flush_video_count_;
|
int flush_video_count_;
|
||||||
|
|
@ -659,7 +659,7 @@ VOID TEST(HlsControllerTest, ReapSegmentSuccess)
|
||||||
// Mock HLS segment for testing do_segment_close
|
// Mock HLS segment for testing do_segment_close
|
||||||
class MockHlsSegmentForSegmentClose : public SrsHlsSegment
|
class MockHlsSegmentForSegmentClose : public SrsHlsSegment
|
||||||
{
|
{
|
||||||
SRS_DECLARE_PRIVATE:
|
SRS_DECLARE_PRIVATE:
|
||||||
srs_error_t rename_error_;
|
srs_error_t rename_error_;
|
||||||
srs_utime_t mock_duration_;
|
srs_utime_t mock_duration_;
|
||||||
bool rename_called_;
|
bool rename_called_;
|
||||||
|
|
@ -851,8 +851,8 @@ VOID TEST(HlsFmp4MuxerTest, DoRefreshM3u8SegmentWithEncryption)
|
||||||
|
|
||||||
// Create mock segment
|
// Create mock segment
|
||||||
MockHlsM4sSegment segment;
|
MockHlsM4sSegment segment;
|
||||||
segment.sequence_no_ = 10; // 10 % 5 == 0, so key should be written
|
segment.sequence_no_ = 10; // 10 % 5 == 0, so key should be written
|
||||||
segment.is_sequence_header_ = true; // Should write discontinuity
|
segment.is_sequence_header_ = true; // Should write discontinuity
|
||||||
segment.duration_ = 5000 * SRS_UTIME_MILLISECONDS; // 5 seconds
|
segment.duration_ = 5000 * SRS_UTIME_MILLISECONDS; // 5 seconds
|
||||||
segment.fullpath_ = "/path/to/segment-[duration].m4s";
|
segment.fullpath_ = "/path/to/segment-[duration].m4s";
|
||||||
|
|
||||||
|
|
@ -885,7 +885,7 @@ VOID TEST(HlsFmp4MuxerTest, DoRefreshM3u8SegmentWithEncryption)
|
||||||
// Mock HLS segment for testing SrsHlsMuxer::do_refresh_m3u8_segment
|
// Mock HLS segment for testing SrsHlsMuxer::do_refresh_m3u8_segment
|
||||||
class MockHlsSegmentForRefreshM3u8 : public SrsHlsSegment
|
class MockHlsSegmentForRefreshM3u8 : public SrsHlsSegment
|
||||||
{
|
{
|
||||||
SRS_DECLARE_PRIVATE:
|
SRS_DECLARE_PRIVATE:
|
||||||
bool is_sequence_header_;
|
bool is_sequence_header_;
|
||||||
srs_utime_t duration_;
|
srs_utime_t duration_;
|
||||||
|
|
||||||
|
|
@ -931,8 +931,8 @@ VOID TEST(HlsMuxerTest, DoRefreshM3u8SegmentWithEncryption)
|
||||||
|
|
||||||
// Create mock segment
|
// Create mock segment
|
||||||
MockHlsSegmentForRefreshM3u8 segment;
|
MockHlsSegmentForRefreshM3u8 segment;
|
||||||
segment.sequence_no_ = 10; // 10 % 5 == 0, so key should be written
|
segment.sequence_no_ = 10; // 10 % 5 == 0, so key should be written
|
||||||
segment.set_is_sequence_header(true); // Should write discontinuity
|
segment.set_is_sequence_header(true); // Should write discontinuity
|
||||||
segment.set_duration(5000 * SRS_UTIME_MILLISECONDS); // 5 seconds
|
segment.set_duration(5000 * SRS_UTIME_MILLISECONDS); // 5 seconds
|
||||||
|
|
||||||
// Call do_refresh_m3u8_segment
|
// Call do_refresh_m3u8_segment
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user