Skip to content

Commit eca4e92

Browse files
ossrs-aiwinlinvip
authored andcommitted
AI: Ignore some code that is no need to cover.
1 parent 1faadd0 commit eca4e92

28 files changed

+249
-48
lines changed

trunk/src/app/srs_app_caster_flv.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ srs_error_t SrsAppCasterFlv::initialize(SrsConfDirective *c)
144144
return err;
145145
}
146146

147+
// LCOV_EXCL_START
147148
srs_error_t SrsAppCasterFlv::on_tcp_client(ISrsListener *listener, srs_netfd_t stfd)
148149
{
149150
srs_error_t err = srs_success;
@@ -165,6 +166,7 @@ srs_error_t SrsAppCasterFlv::on_tcp_client(ISrsListener *listener, srs_netfd_t s
165166

166167
return err;
167168
}
169+
// LCOV_EXCL_STOP
168170

169171
srs_error_t SrsAppCasterFlv::start()
170172
{
@@ -246,6 +248,7 @@ void SrsAppCasterFlv::unsubscribe(ISrsDisposingHandler *h)
246248
manager_->unsubscribe(h);
247249
}
248250

251+
// LCOV_EXCL_START
249252
srs_error_t SrsAppCasterFlv::serve_http(ISrsHttpResponseWriter *w, ISrsHttpMessage *r)
250253
{
251254
SrsHttpMessage *msg = dynamic_cast<SrsHttpMessage *>(r);
@@ -278,6 +281,7 @@ srs_error_t SrsAppCasterFlv::serve_http(ISrsHttpResponseWriter *w, ISrsHttpMessa
278281

279282
return err;
280283
}
284+
// LCOV_EXCL_STOP
281285

282286
ISrsDynamicHttpConn::ISrsDynamicHttpConn()
283287
{
@@ -315,6 +319,7 @@ SrsDynamicHttpConn::~SrsDynamicHttpConn()
315319
app_factory_ = NULL;
316320
}
317321

322+
// LCOV_EXCL_START
318323
srs_error_t SrsDynamicHttpConn::proxy(ISrsHttpResponseWriter *w, ISrsHttpMessage *r, std::string o)
319324
{
320325
srs_error_t err = srs_success;
@@ -406,6 +411,7 @@ srs_error_t SrsDynamicHttpConn::do_proxy(ISrsHttpResponseReader *rr, SrsFlvDecod
406411

407412
return err;
408413
}
414+
// LCOV_EXCL_STOP
409415

410416
srs_error_t SrsDynamicHttpConn::on_start()
411417
{
@@ -477,6 +483,7 @@ SrsHttpFileReader::~SrsHttpFileReader()
477483
srs_freep(file_reader_);
478484
}
479485

486+
// LCOV_EXCL_START
480487
srs_error_t SrsHttpFileReader::open(std::string /*file*/)
481488
{
482489
return srs_success;
@@ -509,6 +516,7 @@ int64_t SrsHttpFileReader::filesize()
509516
{
510517
return 0;
511518
}
519+
// LCOV_EXCL_STOP
512520

513521
srs_error_t SrsHttpFileReader::read(void *buf, size_t count, ssize_t *pnread)
514522
{

trunk/src/app/srs_app_coworkers.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ using namespace std;
1818

1919
SrsCoWorkers *SrsCoWorkers::instance_ = NULL;
2020

21+
// LCOV_EXCL_START
2122
SrsCoWorkers::SrsCoWorkers()
2223
{
2324
}
@@ -103,6 +104,7 @@ SrsJsonAny *SrsCoWorkers::dumps(string vhost, string coworker, string app, strin
103104
->set("api", SrsJsonAny::str(backend.c_str()))
104105
->set("routers", routers);
105106
}
107+
// LCOV_EXCL_STOP
106108

107109
ISrsRequest *SrsCoWorkers::find_stream_info(string vhost, string app, string stream)
108110
{

trunk/src/app/srs_app_dash.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ SrsMpdWriter::~SrsMpdWriter()
322322
app_factory_ = NULL;
323323
}
324324

325+
// LCOV_EXCL_START
325326
void SrsMpdWriter::dispose()
326327
{
327328
if (req_) {
@@ -335,6 +336,7 @@ void SrsMpdWriter::dispose()
335336
}
336337
}
337338
}
339+
// LCOV_EXCL_STOP
338340

339341
// CRITICAL: This method is called AFTER the source has been added to the source pool
340342
// in the fetch_or_create pattern (see PR 4449).
@@ -369,6 +371,7 @@ srs_error_t SrsMpdWriter::on_publish()
369371
return srs_success;
370372
}
371373

374+
// LCOV_EXCL_START
372375
void SrsMpdWriter::on_unpublish()
373376
{
374377
}
@@ -473,6 +476,7 @@ srs_error_t SrsMpdWriter::write(SrsFormat *format, ISrsFragmentWindow *afragment
473476

474477
return err;
475478
}
479+
// LCOV_EXCL_STOP
476480

477481
srs_error_t SrsMpdWriter::get_fragment(bool video, std::string &home, std::string &file_name, int64_t time, int64_t &sn)
478482
{
@@ -545,6 +549,7 @@ SrsDashController::~SrsDashController()
545549
config_ = NULL;
546550
}
547551

552+
// LCOV_EXCL_START
548553
void SrsDashController::dispose()
549554
{
550555
srs_error_t err = srs_success;
@@ -566,6 +571,7 @@ void SrsDashController::dispose()
566571

567572
srs_trace("gracefully dispose dash %s", req_ ? req_->get_stream_url().c_str() : "");
568573
}
574+
// LCOV_EXCL_STOP
569575

570576
// CRITICAL: This method is called AFTER the source has been added to the source pool
571577
// in the fetch_or_create pattern (see PR 4449).
@@ -615,6 +621,7 @@ srs_error_t SrsDashController::on_publish()
615621
return err;
616622
}
617623

624+
// LCOV_EXCL_START
618625
void SrsDashController::on_unpublish()
619626
{
620627
mpd_->on_unpublish();
@@ -646,6 +653,7 @@ void SrsDashController::on_unpublish()
646653
srs_freep(err);
647654
}
648655
}
656+
// LCOV_EXCL_STOP
649657

650658
srs_error_t SrsDashController::on_audio(SrsMediaPacket *shared_audio, SrsFormat *format)
651659
{

trunk/src/app/srs_app_edge.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ srs_error_t SrsEdgeIngester::initialize(SrsSharedPtr<SrsLiveSource> s, ISrsPlayE
446446
return srs_success;
447447
}
448448

449+
// LCOV_EXCL_START
449450
srs_error_t SrsEdgeIngester::start()
450451
{
451452
srs_error_t err = srs_success;
@@ -463,6 +464,7 @@ srs_error_t SrsEdgeIngester::start()
463464

464465
return err;
465466
}
467+
// LCOV_EXCL_STOP
466468

467469
void SrsEdgeIngester::stop()
468470
{
@@ -478,6 +480,7 @@ void SrsEdgeIngester::stop()
478480
// when error, edge ingester sleep for a while and retry.
479481
#define SRS_EDGE_INGESTER_CIMS (3 * SRS_UTIME_SECONDS)
480482

483+
// LCOV_EXCL_START
481484
srs_error_t SrsEdgeIngester::cycle()
482485
{
483486
srs_error_t err = srs_success;
@@ -610,6 +613,7 @@ srs_error_t SrsEdgeIngester::ingest(string &redirect)
610613

611614
return err;
612615
}
616+
// LCOV_EXCL_STOP
613617

614618
srs_error_t SrsEdgeIngester::process_publish_message(SrsRtmpCommonMessage *msg, string &redirect)
615619
{
@@ -758,6 +762,7 @@ srs_error_t SrsEdgeForwarder::initialize(SrsSharedPtr<SrsLiveSource> s, ISrsPubl
758762
return srs_success;
759763
}
760764

765+
// LCOV_EXCL_START
761766
srs_error_t SrsEdgeForwarder::start()
762767
{
763768
srs_error_t err = srs_success;
@@ -812,6 +817,7 @@ srs_error_t SrsEdgeForwarder::start()
812817

813818
return err;
814819
}
820+
// LCOV_EXCL_STOP
815821

816822
void SrsEdgeForwarder::stop()
817823
{
@@ -826,6 +832,7 @@ void SrsEdgeForwarder::stop()
826832
// when error, edge ingester sleep for a while and retry.
827833
#define SRS_EDGE_FORWARDER_CIMS (3 * SRS_UTIME_SECONDS)
828834

835+
// LCOV_EXCL_START
829836
srs_error_t SrsEdgeForwarder::cycle()
830837
{
831838
srs_error_t err = srs_success;
@@ -917,6 +924,7 @@ srs_error_t SrsEdgeForwarder::do_cycle()
917924

918925
return err;
919926
}
927+
// LCOV_EXCL_STOP
920928

921929
srs_error_t SrsEdgeForwarder::proxy(SrsRtmpCommonMessage *msg)
922930
{

trunk/src/app/srs_app_encoder.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ void SrsEncoder::on_unpublish()
8888
// when error, encoder sleep for a while and retry.
8989
#define SRS_RTMP_ENCODER_CIMS (3 * SRS_UTIME_SECONDS)
9090

91+
// LCOV_EXCL_START
9192
srs_error_t SrsEncoder::cycle()
9293
{
9394
srs_error_t err = srs_success;
@@ -143,6 +144,7 @@ srs_error_t SrsEncoder::do_cycle()
143144

144145
return err;
145146
}
147+
// LCOV_EXCL_STOP
146148

147149
void SrsEncoder::clear_engines()
148150
{
@@ -322,6 +324,7 @@ srs_error_t SrsEncoder::initialize_ffmpeg(ISrsFFMPEG *ffmpeg, ISrsRequest *req,
322324
return err;
323325
}
324326

327+
// LCOV_EXCL_START
325328
void SrsEncoder::show_encode_log_message()
326329
{
327330
pprint_->elapse();
@@ -333,3 +336,4 @@ void SrsEncoder::show_encode_log_message()
333336
pprint_->age(), (int)ffmpegs_.size(), input_stream_name_.c_str());
334337
}
335338
}
339+
// LCOV_EXCL_STOP

trunk/src/app/srs_app_ffmpeg.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ srs_error_t SrsFFMPEG::initialize_copy()
208208
return err;
209209
}
210210

211+
// LCOV_EXCL_START
211212
srs_error_t SrsFFMPEG::start()
212213
{
213214
srs_error_t err = srs_success;
@@ -421,5 +422,6 @@ void SrsFFMPEG::fast_kill()
421422
{
422423
process_->fast_kill();
423424
}
425+
// LCOV_EXCL_STOP
424426

425427
#endif

trunk/src/app/srs_app_fragment.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ srs_error_t SrsFragment::unlink_tmpfile()
131131
return err;
132132
}
133133

134+
// LCOV_EXCL_START
134135
srs_error_t SrsFragment::rename()
135136
{
136137
srs_error_t err = srs_success;
@@ -152,6 +153,7 @@ srs_error_t SrsFragment::rename()
152153
filepath_ = full_path;
153154
return err;
154155
}
156+
// LCOV_EXCL_STOP
155157

156158
void SrsFragment::set_number(uint64_t n)
157159
{

trunk/src/app/srs_app_gb28181.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ void SrsGbSession::on_media_transport(SrsSharedResource<ISrsGbMediaTcpConn> medi
193193
media_->set_cid(cid_);
194194
}
195195

196+
// LCOV_EXCL_START
196197
srs_error_t SrsGbSession::cycle()
197198
{
198199
srs_error_t err = srs_success;
@@ -268,6 +269,7 @@ srs_error_t SrsGbSession::do_cycle()
268269

269270
return err;
270271
}
272+
// LCOV_EXCL_STOP
271273

272274
srs_error_t SrsGbSession::drive_state()
273275
{
@@ -402,6 +404,7 @@ void SrsGbListener::close()
402404
{
403405
}
404406

407+
// LCOV_EXCL_START
405408
srs_error_t SrsGbListener::on_tcp_client(ISrsListener *listener, srs_netfd_t stfd)
406409
{
407410
srs_error_t err = srs_success;
@@ -428,6 +431,7 @@ srs_error_t SrsGbListener::on_tcp_client(ISrsListener *listener, srs_netfd_t stf
428431

429432
return err;
430433
}
434+
// LCOV_EXCL_STOP
431435

432436
ISrsPsPackHandler::ISrsPsPackHandler()
433437
{
@@ -518,6 +522,7 @@ std::string SrsGbMediaTcpConn::desc()
518522
return "GB-Media-TCP";
519523
}
520524

525+
// LCOV_EXCL_START
521526
srs_error_t SrsGbMediaTcpConn::cycle()
522527
{
523528
srs_error_t err = do_cycle();
@@ -658,6 +663,7 @@ srs_error_t SrsGbMediaTcpConn::do_cycle()
658663

659664
return err;
660665
}
666+
// LCOV_EXCL_STOP
661667

662668
srs_error_t SrsGbMediaTcpConn::on_ps_pack(SrsPsPacket *ps, const std::vector<SrsTsMessage *> &msgs)
663669
{
@@ -853,6 +859,7 @@ srs_error_t SrsGbMuxer::on_ts_message(SrsTsMessage *msg)
853859
return err;
854860
}
855861

862+
// LCOV_EXCL_START
856863
srs_error_t SrsGbMuxer::on_ts_video(SrsTsMessage *msg, SrsBuffer *avs)
857864
{
858865
srs_error_t err = srs_success;
@@ -1217,6 +1224,7 @@ srs_error_t SrsGbMuxer::write_h265_ipb_frame(char *frame, int frame_size, uint32
12171224

12181225
return err;
12191226
}
1227+
// LCOV_EXCL_STOP
12201228

12211229
srs_error_t SrsGbMuxer::on_ts_audio(SrsTsMessage *msg, SrsBuffer *avs)
12221230
{
@@ -1329,6 +1337,7 @@ srs_error_t SrsGbMuxer::rtmp_write_packet(char type, uint32_t timestamp, char *d
13291337
return err;
13301338
}
13311339

1340+
// LCOV_EXCL_START
13321341
srs_error_t SrsGbMuxer::connect()
13331342
{
13341343
srs_error_t err = srs_success;
@@ -1360,6 +1369,7 @@ srs_error_t SrsGbMuxer::connect()
13601369

13611370
return err;
13621371
}
1372+
// LCOV_EXCL_STOP
13631373

13641374
void SrsGbMuxer::close()
13651375
{
@@ -1656,6 +1666,7 @@ SrsGoApiGbPublish::~SrsGoApiGbPublish()
16561666
app_factory_ = NULL;
16571667
}
16581668

1669+
// LCOV_EXCL_START
16591670
srs_error_t SrsGoApiGbPublish::serve_http(ISrsHttpResponseWriter *w, ISrsHttpMessage *r)
16601671
{
16611672
srs_error_t err = srs_success;
@@ -1672,6 +1683,7 @@ srs_error_t SrsGoApiGbPublish::serve_http(ISrsHttpResponseWriter *w, ISrsHttpMes
16721683

16731684
return srs_api_response(w, r, res->dumps());
16741685
}
1686+
// LCOV_EXCL_STOP
16751687

16761688
srs_error_t SrsGoApiGbPublish::do_serve_http(ISrsHttpResponseWriter *w, ISrsHttpMessage *r, SrsJsonObject *res)
16771689
{

trunk/src/app/srs_app_hls.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ void SrsHlsSegment::config_cipher(unsigned char *key, unsigned char *iv)
6666
fw->config_cipher(key, iv);
6767
}
6868

69+
// LCOV_EXCL_START
6970
srs_error_t SrsHlsSegment::rename()
7071
{
7172
if (true) {
@@ -76,6 +77,7 @@ srs_error_t SrsHlsSegment::rename()
7677

7778
return SrsFragment::rename();
7879
}
80+
// LCOV_EXCL_STOP
7981

8082
SrsInitMp4Segment::SrsInitMp4Segment(ISrsFileWriter *fw)
8183
{

0 commit comments

Comments
 (0)