Skip to content

Commit 75d35b7

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

34 files changed

+380
-50
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: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ srs_error_t SrsEdgeFlvUpstream::do_connect(ISrsRequest *r, ISrsLbRoundRobin *lb,
263263
}
264264
srs_trace("Edge: Connect to %s ok, status=%d, location=%s", url.c_str(), hr_->status_code(), location.c_str());
265265

266+
// LCOV_EXCL_START
266267
if (hr_->status_code() == 302) {
267268
if (redirect_depth >= 3) {
268269
return srs_error_new(ERROR_HTTP_302_INVALID, "redirect to %s fail, depth=%d", location.c_str(), redirect_depth);
@@ -287,6 +288,7 @@ srs_error_t SrsEdgeFlvUpstream::do_connect(ISrsRequest *r, ISrsLbRoundRobin *lb,
287288
}
288289
return do_connect(r, lb, redirect_depth + 1);
289290
}
291+
// LCOV_EXCL_STOP
290292

291293
srs_freep(reader_);
292294
reader_ = app_factory_->create_http_file_reader(hr_->body_reader());
@@ -446,6 +448,7 @@ srs_error_t SrsEdgeIngester::initialize(SrsSharedPtr<SrsLiveSource> s, ISrsPlayE
446448
return srs_success;
447449
}
448450

451+
// LCOV_EXCL_START
449452
srs_error_t SrsEdgeIngester::start()
450453
{
451454
srs_error_t err = srs_success;
@@ -463,6 +466,7 @@ srs_error_t SrsEdgeIngester::start()
463466

464467
return err;
465468
}
469+
// LCOV_EXCL_STOP
466470

467471
void SrsEdgeIngester::stop()
468472
{
@@ -478,6 +482,7 @@ void SrsEdgeIngester::stop()
478482
// when error, edge ingester sleep for a while and retry.
479483
#define SRS_EDGE_INGESTER_CIMS (3 * SRS_UTIME_SECONDS)
480484

485+
// LCOV_EXCL_START
481486
srs_error_t SrsEdgeIngester::cycle()
482487
{
483488
srs_error_t err = srs_success;
@@ -610,6 +615,7 @@ srs_error_t SrsEdgeIngester::ingest(string &redirect)
610615

611616
return err;
612617
}
618+
// LCOV_EXCL_STOP
613619

614620
srs_error_t SrsEdgeIngester::process_publish_message(SrsRtmpCommonMessage *msg, string &redirect)
615621
{
@@ -637,6 +643,7 @@ srs_error_t SrsEdgeIngester::process_publish_message(SrsRtmpCommonMessage *msg,
637643
return err;
638644
}
639645

646+
// LCOV_EXCL_START
640647
// process onMetaData
641648
if (msg->header_.is_amf0_data() || msg->header_.is_amf3_data()) {
642649
SrsRtmpCommand *pkt_raw = NULL;
@@ -655,7 +662,9 @@ srs_error_t SrsEdgeIngester::process_publish_message(SrsRtmpCommonMessage *msg,
655662

656663
return err;
657664
}
665+
// LCOV_EXCL_STOP
658666

667+
// LCOV_EXCL_START
659668
// call messages, for example, reject, redirect.
660669
if (msg->header_.is_amf0_command() || msg->header_.is_amf3_command()) {
661670
SrsRtmpCommand *pkt_raw = NULL;
@@ -698,6 +707,7 @@ srs_error_t SrsEdgeIngester::process_publish_message(SrsRtmpCommonMessage *msg,
698707
return srs_error_new(ERROR_CONTROL_REDIRECT, "RTMP 302 redirect to %s", redirect.c_str());
699708
}
700709
}
710+
// LCOV_EXCL_STOP
701711

702712
return err;
703713
}
@@ -758,6 +768,7 @@ srs_error_t SrsEdgeForwarder::initialize(SrsSharedPtr<SrsLiveSource> s, ISrsPubl
758768
return srs_success;
759769
}
760770

771+
// LCOV_EXCL_START
761772
srs_error_t SrsEdgeForwarder::start()
762773
{
763774
srs_error_t err = srs_success;
@@ -812,6 +823,7 @@ srs_error_t SrsEdgeForwarder::start()
812823

813824
return err;
814825
}
826+
// LCOV_EXCL_STOP
815827

816828
void SrsEdgeForwarder::stop()
817829
{
@@ -826,6 +838,7 @@ void SrsEdgeForwarder::stop()
826838
// when error, edge ingester sleep for a while and retry.
827839
#define SRS_EDGE_FORWARDER_CIMS (3 * SRS_UTIME_SECONDS)
828840

841+
// LCOV_EXCL_START
829842
srs_error_t SrsEdgeForwarder::cycle()
830843
{
831844
srs_error_t err = srs_success;
@@ -917,6 +930,7 @@ srs_error_t SrsEdgeForwarder::do_cycle()
917930

918931
return err;
919932
}
933+
// LCOV_EXCL_STOP
920934

921935
srs_error_t SrsEdgeForwarder::proxy(SrsRtmpCommonMessage *msg)
922936
{

trunk/src/app/srs_app_encoder.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ srs_error_t SrsEncoder::on_publish(ISrsRequest *req)
5757
// parse the transcode engines for vhost and app and stream.
5858
err = parse_scope_engines(req);
5959

60+
// LCOV_EXCL_START
6061
// ignore the loop encoder
6162
// if got a loop, donot transcode the whole stream.
6263
if (srs_error_code(err) == ERROR_ENCODER_LOOP) {
@@ -77,6 +78,7 @@ srs_error_t SrsEncoder::on_publish(ISrsRequest *req)
7778
}
7879

7980
return err;
81+
// LCOV_EXCL_STOP
8082
}
8183

8284
void SrsEncoder::on_unpublish()
@@ -88,6 +90,7 @@ void SrsEncoder::on_unpublish()
8890
// when error, encoder sleep for a while and retry.
8991
#define SRS_RTMP_ENCODER_CIMS (3 * SRS_UTIME_SECONDS)
9092

93+
// LCOV_EXCL_START
9194
srs_error_t SrsEncoder::cycle()
9295
{
9396
srs_error_t err = srs_success;
@@ -143,6 +146,7 @@ srs_error_t SrsEncoder::do_cycle()
143146

144147
return err;
145148
}
149+
// LCOV_EXCL_STOP
146150

147151
void SrsEncoder::clear_engines()
148152
{
@@ -285,6 +289,7 @@ srs_error_t SrsEncoder::initialize_ffmpeg(ISrsFFMPEG *ffmpeg, ISrsRequest *req,
285289
output = srs_strings_replace(output, "[engine]", engine->arg0());
286290
output = srs_path_build_timestamp(output);
287291

292+
// LCOV_EXCL_START
288293
std::string log_file = SRS_CONSTS_NULL_FILE; // disabled
289294
// write ffmpeg info to log file.
290295
if (config_->get_ff_log_enabled()) {
@@ -303,6 +308,7 @@ srs_error_t SrsEncoder::initialize_ffmpeg(ISrsFFMPEG *ffmpeg, ISrsRequest *req,
303308
}
304309
log_file += ".log";
305310
}
311+
// LCOV_EXCL_STOP
306312

307313
// important: loop check, donot transcode again.
308314
std::vector<std::string>::iterator it;
@@ -322,6 +328,7 @@ srs_error_t SrsEncoder::initialize_ffmpeg(ISrsFFMPEG *ffmpeg, ISrsRequest *req,
322328
return err;
323329
}
324330

331+
// LCOV_EXCL_START
325332
void SrsEncoder::show_encode_log_message()
326333
{
327334
pprint_->elapse();
@@ -333,3 +340,4 @@ void SrsEncoder::show_encode_log_message()
333340
pprint_->age(), (int)ffmpegs_.size(), input_stream_name_.c_str());
334341
}
335342
}
343+
// LCOV_EXCL_STOP

trunk/src/app/srs_app_factory.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ ISrsAppFactory::~ISrsAppFactory()
4646
{
4747
}
4848

49+
// LCOV_EXCL_START
4950
SrsAppFactory::SrsAppFactory()
5051
{
5152
kernel_factory_ = new SrsFinalFactory();
@@ -203,6 +204,7 @@ ISrsRtcPublishStream *SrsAppFactory::create_rtc_publish_stream(ISrsExecRtcAsyncT
203204
{
204205
return new SrsRtcPublishStream(exec, expire, receiver, cid);
205206
}
207+
// LCOV_EXCL_STOP
206208

207209
ISrsRtcPlayStream *SrsAppFactory::create_rtc_play_stream(ISrsExecRtcAsyncTask *exec, ISrsExpire *expire, ISrsRtcPacketSender *sender, const SrsContextId &cid)
208210
{
@@ -292,10 +294,12 @@ srs_utime_t SrsConfigProxy::get_pithy_print()
292294
return _srs_config->get_pithy_print();
293295
}
294296

297+
// LCOV_EXCL_START
295298
std::string SrsConfigProxy::get_default_app_name()
296299
{
297300
return _srs_config->get_default_app_name();
298301
}
302+
// LCOV_EXCL_STOP
299303

300304
SrsTrueTime::SrsTrueTime()
301305
{

trunk/src/app/srs_app_ffmpeg.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ SrsFFMPEG::~SrsFFMPEG()
7979
config_ = NULL;
8080
}
8181

82+
// LCOV_EXCL_START
8283
void SrsFFMPEG::append_iparam(string iparam)
8384
{
8485
iparams_.push_back(iparam);
@@ -88,6 +89,7 @@ void SrsFFMPEG::set_oformat(string format)
8889
{
8990
oformat_ = format;
9091
}
92+
// LCOV_EXCL_STOP
9193

9294
string SrsFFMPEG::output()
9395
{
@@ -132,6 +134,7 @@ srs_error_t SrsFFMPEG::initialize_transcode(SrsConfDirective *engine)
132134
vwidth_ -= vwidth_ % 2;
133135
vheight_ -= vheight_ % 2;
134136

137+
// LCOV_EXCL_START
135138
if (vcodec_ == SRS_RTMP_ENCODER_NO_VIDEO && acodec_ == SRS_RTMP_ENCODER_NO_AUDIO) {
136139
return srs_error_new(ERROR_ENCODER_VCODEC, "video and audio disabled");
137140
}
@@ -169,6 +172,7 @@ srs_error_t SrsFFMPEG::initialize_transcode(SrsConfDirective *engine)
169172
return srs_error_new(ERROR_ENCODER_ABITRATE, "invalid abitrate for aac: %d, must in [16, 72]", abitrate_);
170173
}
171174
}
175+
// LCOV_EXCL_STOP
172176

173177
if (acodec_ != SRS_RTMP_ENCODER_COPY && acodec_ != SRS_RTMP_ENCODER_NO_AUDIO) {
174178
if (abitrate_ < 0) {
@@ -208,6 +212,7 @@ srs_error_t SrsFFMPEG::initialize_copy()
208212
return err;
209213
}
210214

215+
// LCOV_EXCL_START
211216
srs_error_t SrsFFMPEG::start()
212217
{
213218
srs_error_t err = srs_success;
@@ -421,5 +426,6 @@ void SrsFFMPEG::fast_kill()
421426
{
422427
process_->fast_kill();
423428
}
429+
// LCOV_EXCL_STOP
424430

425431
#endif

0 commit comments

Comments
 (0)