MCPcopy Create free account
hub / github.com/apache/brpc / PsiEncode

Method PsiEncode

src/brpc/ts.cpp:860–886  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

858}
859
860int TsPayloadPAT::PsiEncode(void* data) const {
861 char* p = (char*)data;
862
863 policy::WriteBigEndian2Bytes(&p, transport_stream_id);
864
865 int8_t cniv = current_next_indicator & 0x01;
866 cniv |= (version_number << 1) & 0x3E;
867 cniv |= (const1_value << 6) & 0xC0;
868 policy::Write1Byte(&p, cniv);
869
870 policy::Write1Byte(&p, section_number);
871 policy::Write1Byte(&p, last_section_number);
872
873 for (size_t i = 0; i < programs.size(); ++i) {
874 if (programs[i].Encode(p) != 0) {
875 LOG(ERROR) << "Fail to encode TsPayloadPAT.programs[" << i << ']';
876 return -1;
877 }
878 p += programs[i].ByteSize();
879 // update the apply pid table.
880 packet()->channel_group()->set(programs[i].pid);
881 }
882
883 // update the apply pid table.
884 packet()->channel_group()->set(packet()->pid());
885 return 0;
886}
887
888TsPayloadPMTESInfo::TsPayloadPMTESInfo(TsStream st, TsPid epid)
889 : stream_type(st)

Callers

nothing calls this directly

Calls 8

WriteBigEndian2BytesFunction · 0.85
Write1ByteFunction · 0.85
channel_groupMethod · 0.80
pidMethod · 0.80
sizeMethod · 0.45
EncodeMethod · 0.45
ByteSizeMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected