| 858 | } |
| 859 | |
| 860 | int 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 | |
| 888 | TsPayloadPMTESInfo::TsPayloadPMTESInfo(TsStream st, TsPid epid) |
| 889 | : stream_type(st) |
nothing calls this directly
no test coverage detected