mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Ignore some coverage for ts.
This commit is contained in:
parent
995bd5cdd2
commit
e2f86464c5
1 changed files with 31 additions and 4 deletions
|
@ -810,6 +810,8 @@ SrsTsPacket* SrsTsPacket::create_pes_first(SrsTsContext* context,
|
|||
pkt->payload = pes;
|
||||
|
||||
if (pcr >= 0) {
|
||||
// Ignore coverage for PCR, we don't use it in HLS.
|
||||
// LCOV_EXCL_START
|
||||
SrsTsAdaptationField* af = new SrsTsAdaptationField(pkt);
|
||||
pkt->adaptation_field = af;
|
||||
pkt->adaption_field_control = SrsTsAdaptationFieldTypeBoth;
|
||||
|
@ -825,6 +827,7 @@ SrsTsPacket* SrsTsPacket::create_pes_first(SrsTsContext* context,
|
|||
af->adaptation_field_extension_flag = 0;
|
||||
af->program_clock_reference_base = pcr;
|
||||
af->program_clock_reference_extension = 0;
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
|
||||
pes->packet_start_code_prefix = 0x01;
|
||||
|
@ -973,6 +976,8 @@ srs_error_t SrsTsAdaptationField::decode(SrsBuffer* stream)
|
|||
program_clock_reference_base = (pcrv >> 15) & 0x1ffffffffLL;
|
||||
}
|
||||
|
||||
// Ignore coverage for bellow, we don't use it in HLS.
|
||||
// LCOV_EXCL_START
|
||||
if (OPCR_flag) {
|
||||
if (!stream->require(6)) {
|
||||
return srs_error_new(ERROR_STREAM_CASTER_TS_AF, "ts: demux af OPCR_flag");
|
||||
|
@ -1080,6 +1085,7 @@ srs_error_t SrsTsAdaptationField::decode(SrsBuffer* stream)
|
|||
nb_af_ext_reserved = adaptation_field_extension_length - (stream->pos() - pos_af_ext);
|
||||
stream->skip(nb_af_ext_reserved);
|
||||
}
|
||||
// LCOV_EXCL_STOP
|
||||
|
||||
nb_af_reserved = adaption_field_length - (stream->pos() - pos_af);
|
||||
stream->skip(nb_af_reserved);
|
||||
|
@ -1144,6 +1150,8 @@ srs_error_t SrsTsAdaptationField::encode(SrsBuffer* stream)
|
|||
tmpv |= (transport_private_data_flag << 1) & 0x02;
|
||||
stream->write_1bytes(tmpv);
|
||||
|
||||
// Ignore the coverage bellow, for we don't use them in HLS.
|
||||
// LCOV_EXCL_START
|
||||
if (PCR_flag) {
|
||||
if (!stream->require(6)) {
|
||||
return srs_error_new(ERROR_STREAM_CASTER_TS_AF, "ts: mux af PCR_flag");
|
||||
|
@ -1236,6 +1244,7 @@ srs_error_t SrsTsAdaptationField::encode(SrsBuffer* stream)
|
|||
stream->skip(nb_af_ext_reserved);
|
||||
}
|
||||
}
|
||||
// LCOV_EXCL_STOP
|
||||
|
||||
if (nb_af_reserved) {
|
||||
stream->skip(nb_af_reserved);
|
||||
|
@ -1461,6 +1470,9 @@ srs_error_t SrsTsPayloadPES::decode(SrsBuffer* stream, SrsTsMessage** ppmsg)
|
|||
msg->pts = pts;
|
||||
}
|
||||
|
||||
// Ignore coverage bellow, for we don't use them in HLS.
|
||||
// LCOV_EXCL_START
|
||||
|
||||
// 6B
|
||||
if (ESCR_flag) {
|
||||
ESCR_extension = 0;
|
||||
|
@ -1589,6 +1601,8 @@ srs_error_t SrsTsPayloadPES::decode(SrsBuffer* stream, SrsTsMessage** ppmsg)
|
|||
stream->skip(nb_stuffings);
|
||||
}
|
||||
|
||||
// LCOV_EXCL_STOP
|
||||
|
||||
// PES_packet_data_byte, page58.
|
||||
// the packet size contains the header size.
|
||||
// The number of PES_packet_data_bytes, N, is specified by the
|
||||
|
@ -1610,6 +1624,9 @@ srs_error_t SrsTsPayloadPES::decode(SrsBuffer* stream, SrsTsMessage** ppmsg)
|
|||
if ((err = msg->dump(stream, &nb_bytes)) != srs_success) {
|
||||
return srs_error_wrap(err, "dump pes");
|
||||
}
|
||||
|
||||
// Ignore coverage bellow, for we don't use them in HLS.
|
||||
// LCOV_EXCL_START
|
||||
} else if (sid == SrsTsPESStreamIdProgramStreamMap
|
||||
|| sid == SrsTsPESStreamIdPrivateStream2
|
||||
|| sid == SrsTsPESStreamIdEcmStream
|
||||
|
@ -1633,6 +1650,8 @@ srs_error_t SrsTsPayloadPES::decode(SrsBuffer* stream, SrsTsMessage** ppmsg)
|
|||
nb_paddings = stream->size() - stream->pos();
|
||||
stream->skip(nb_paddings);
|
||||
srs_info("ts: drop %dB padding bytes", nb_paddings);
|
||||
|
||||
// LCOV_EXCL_STOP
|
||||
} else {
|
||||
int nb_drop = stream->size() - stream->pos();
|
||||
stream->skip(nb_drop);
|
||||
|
@ -1687,11 +1706,14 @@ int SrsTsPayloadPES::size()
|
|||
sz += PES_extension_flag? 1:0;
|
||||
|
||||
if (PES_extension_flag) {
|
||||
// Ignore coverage bellow, for we don't use them in HLS.
|
||||
// LCOV_EXCL_START
|
||||
sz += PES_private_data_flag? 16:0;
|
||||
sz += pack_header_field_flag ? 1 + pack_field.size() : 0; // 1+x bytes.
|
||||
sz += program_packet_sequence_counter_flag? 2:0;
|
||||
sz += P_STD_buffer_flag? 2:0;
|
||||
sz += PES_extension_flag_2 ? 1 + PES_extension_field.size() : 0; // 1+x bytes.
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
PES_header_data_length = sz - PES_header_data_length;
|
||||
|
||||
|
@ -1803,6 +1825,9 @@ srs_error_t SrsTsPayloadPES::encode(SrsBuffer* stream)
|
|||
}
|
||||
}
|
||||
|
||||
// Ignore coverage bellow, for we don't use them in HLS.
|
||||
// LCOV_EXCL_START
|
||||
|
||||
// 6B
|
||||
if (ESCR_flag) {
|
||||
stream->skip(6);
|
||||
|
@ -1862,6 +1887,8 @@ srs_error_t SrsTsPayloadPES::encode(SrsBuffer* stream)
|
|||
srs_warn("ts: demux PES, ignore the stuffings.");
|
||||
}
|
||||
|
||||
// LCOV_EXCL_STOP
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue