Go to the documentation of this file.
5 #include <QSharedPointer>
15 #define LOC QString("DVBStream[%1]: ").arg(m_cardId)
19 int desired_program,
int cardnum,
bool cacheTables)
21 m_desiredNetId(desired_netid), m_desiredTsId(desired_tsid)
48 uint networkID = first_sdt->OriginalNetworkID();
49 if (networkID == netid)
54 uint last_section = first_sdt->LastSection();
57 for (
uint i = 1; i <= last_section; ++i)
68 Reset(netid, tsid, serviceid);
81 const int table_id = psip.
TableID();
114 uint key = (table_id<<16) | service_id;
149 uint key = (table_id<<16) | service_id;
164 int desired_serviceid)
183 for (
const auto & nit : std::as_const(
m_cachedNit))
245 listener->HandleNIT(nit);
252 listener->HandleNIT(&nit);
285 listener->HandleTDT(&tdt);
297 listener->HandleNITo(&nit);
334 listener->HandleSDTo(tsid, &sdt);
350 listener->HandleBAT(bat);
357 listener->HandleBAT(&bat);
381 listener->HandleEIT(&eit);
401 listener->HandleEIT(&cit);
431 listener->HandleSDT(tsid, sdt);
438 bool has_eit = !in_use_pids.empty();
439 return want_eit != has_eit;
450 if (
find(cur_pids.begin(), cur_pids.end(),
457 find(cur_pids.begin(), cur_pids.end(),
464 find(cur_pids.begin(), cur_pids.end(),
476 if (
find(cur_pids.begin(), cur_pids.end(),
477 pid) == cur_pids.end())
478 add_pids.push_back(pid);
482 if (
find(cur_pids.begin(), cur_pids.end(),
483 pid) == cur_pids.end())
484 add_pids.push_back(pid);
490 find(cur_pids.begin(), cur_pids.end(),
497 find(cur_pids.begin(), cur_pids.end(),
504 find(cur_pids.begin(), cur_pids.end(),
511 find(cur_pids.begin(), cur_pids.end(),
520 if (
find(cur_pids.begin(), cur_pids.end(),
527 find(cur_pids.begin(), cur_pids.end(),
534 find(cur_pids.begin(), cur_pids.end(),
546 if (
find(cur_pids.begin(), cur_pids.end(),
547 pid) != cur_pids.end())
548 del_pids.push_back(pid);
552 if (
find(cur_pids.begin(), cur_pids.end(),
553 pid) != cur_pids.end())
554 del_pids.push_back(pid);
560 find(cur_pids.begin(), cur_pids.end(),
567 find(cur_pids.begin(), cur_pids.end(),
574 find(cur_pids.begin(), cur_pids.end(),
581 find(cur_pids.begin(), cur_pids.end(),
588 return !add_pids.empty() || !del_pids.empty();
621 LOG(VB_GENERAL, LOG_WARNING,
LOC +
622 "Currently we ignore \'current\' param");
632 LOG(VB_GENERAL, LOG_WARNING,
LOC +
633 "Currently we ignore \'current\' param");
642 for (
uint i = 0; i <= last_section; i++)
654 LOG(VB_GENERAL, LOG_WARNING,
LOC +
655 "Currently we ignore \'current\' param");
657 for (
uint i = 0; i <= 255; i++)
669 LOG(VB_GENERAL, LOG_WARNING,
LOC +
670 "Currently we ignore \'current\' param");
672 bat_cache_t::const_iterator it =
m_cachedBats.constFind(batid << 8);
676 uint last_section = (*it)->LastSection();
680 for (
uint i = 1; i <= last_section; i++)
714 LOG(VB_GENERAL, LOG_WARNING,
LOC +
715 "Currently we ignore \'current\' param");
717 sdt_cache_t::const_iterator it =
m_cachedSdts.constFind(tsid << 8);
721 uint last_section = (*it)->LastSection();
725 for (
uint i = 1; i <= last_section; i++)
737 LOG(VB_GENERAL, LOG_WARNING,
LOC +
738 "Currently we ignore \'current\' param");
740 for (
uint i = 0; i <= 255; i++)
756 for (
uint i = 0; i < nit->TransportStreamCount(); i++)
781 if ((
int)nit->TransportStreamCount() >
m_cachedSdts.size())
784 for (
uint i = 0; i < nit->TransportStreamCount(); i++)
798 LOG(VB_GENERAL, LOG_WARNING,
LOC +
799 "Currently we ignore \'current\' param");
803 nit_cache_t::const_iterator it =
m_cachedNit.constFind(section_num);
816 for (
uint i = 0; i < 256; i++)
832 LOG(VB_GENERAL, LOG_WARNING,
LOC +
833 "Currently we ignore \'current\' param");
837 uint key = (batid << 8) | section_num;
838 bat_cache_t::const_iterator it =
m_cachedBats.constFind(key);
850 LOG(VB_GENERAL, LOG_WARNING,
LOC +
851 "Currently we ignore \'current\' param");
870 LOG(VB_GENERAL, LOG_WARNING,
LOC +
871 "Currently we ignore \'current\' param");
875 uint key = (tsid << 8) | section_num;
876 sdt_cache_t::const_iterator it =
m_cachedSdts.constFind(key);
888 LOG(VB_GENERAL, LOG_WARNING,
LOC +
889 "Currently we ignore \'current\' param");
896 uint lastSection = sdt->LastSection();
900 for (
uint section = 1; section <= lastSection; section++)
917 LOG(VB_GENERAL, LOG_WARNING,
LOC +
918 "Currently we ignore \'current\' param");
933 for (
auto & sdt : sdts)
974 psip_refcnt_map_t::iterator it;
1024 [val](
auto & listener){ return val == listener; } ))
1036 if (((
void*)val) == ((
void*)*it))
1049 [val](
auto & listener){ return val == listener; } ))
1061 if (((
void*)val) == ((
void*)*it))
1074 [val](
auto & listener){ return val == listener; } ))
1086 if (((
void*)val) == ((
void*)*it))
psip_refcnt_map_t m_cachedRefCnt
void RemoveDVBMainListener(DVBMainStreamListener *val)
bool HasCachedAnySDT(uint tsid, bool current=true) const
bat_vec_t GetCachedBATs(bool current=true) const
sdt_vec_t GetCachedSDTs(bool current=true) const
DVBStreamData(uint desired_netid, uint desired_tsid, int desired_program, int cardnum, bool cacheTables=false)
QRecursiveMutex m_cacheLock
bool IsRedundant(uint pid, const PSIPTable &psip) const override
Returns true if table already seen.
bool HasCachedAnySDTs(bool current=true) const
bool HasCachedAllSDTs(bool current=true) const
bool HasCachedAllBATs(bool current=true) const
static constexpr uint8_t MCA_EIT_TSID
void SetDesiredProgram(int p)
This table gives the current DVB stream time.
bool HasAllSections() const
void SetSectionSeen(uint32_t key, int32_t version, uint32_t section, uint32_t last_section, uint32_t segment_last_section=0xffff)
bool HasAllSections(uint32_t key) const
virtual bool DeleteCachedTable(const PSIPTable *psip) const
dvb_eit_listener_vec_t m_dvbEitListeners
TableStatusMap m_batStatus
virtual bool IsRedundant(uint pid, const PSIPTable &psip) const
Returns true if table already seen.
TableStatusMap m_eitStatus
BouquetAssociationTable const * bat_const_ptr_t
uint ServiceID(uint i) const
service_id 16 0.0+p
void Reset(void) override
dvb_has_eit_t m_dvbHasEit
Tell us if the DVB service has EIT.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
std::vector< uint > uint_vec_t
bool HasAllNIToSections(void) const
std::vector< const BouquetAssociationTable * > bat_vec_t
bool HandleTables(uint pid, const PSIPTable &psip) override
Process PSIP packets.
bool DeleteCachedTable(const PSIPTable *psip) const override
bool HasCachedAnyBAT(uint batid, bool current=true) const
TableStatusMap m_sdtStatus
NetworkInformationTable const * nit_const_ptr_t
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
bool HasAllBATSections(uint bid) const
void UpdateTimeOffset(uint64_t si_utc_time)
TableStatusMap m_sdtoStatus
bat_const_ptr_t GetCachedBAT(uint batid, uint section_num, bool current=true) const
void AddEIT(uint atsc_major, uint atsc_minor, const EventInformationTable *eit)
bool IsSectionSeen(int32_t version, uint32_t section) const
A PSIP table is a variant of a PES packet containing an MPEG, ATSC or DVB table.
void AddDVBEITListener(DVBEITStreamListener *val)
void ProcessSDT(uint tsid, const ServiceDescriptionTable *sdt)
bool HasCachedAllSDT(uint tsid, bool current=true) const
virtual void ReturnCachedTable(const PSIPTable *psip) const
uint ServiceCount() const
Number of services.
nit_const_ptr_t GetCachedNIT(uint section_num, bool current=true) const
std::vector< const ServiceDescriptionTable * > sdt_vec_t
uint OriginalNetworkID() const
original_network_id 16 8.0
ServiceDescriptionTable const * sdt_const_ptr_t
void CacheBAT(BouquetAssociationTable *bat)
bool HasCachedAllBAT(uint batid, bool current=true) const
void CacheNIT(NetworkInformationTable *nit)
QRecursiveMutex m_listenerLock
virtual bool HandleTables(uint pid, const PSIPTable &psip)
Process PSIP packets.
dvb_main_listener_vec_t m_dvbMainListeners
@ PREMIERE_EIT_DIREKT_PID
Encapsulates data about MPEG stream and emits events for each table.
bool HasCachedAllNIT(bool current=true) const
time_t UTCUnix(void) const
This table tells the decoder on which PIDs to find A/V data.
void RemoveDVBOtherListener(DVBOtherStreamListener *val)
sdt_const_ptr_t GetCachedSDT(uint tsid, uint section_num, bool current=true) const
bool HasAnyEIT(void) const
bool HasCachedAnyBATs(bool current=true) const
uint ContentID(void) const
uint LastSection(void) const
void SetDesiredService(uint netid, uint tsid, int serviceid)
void IncrementRefCnt(const PSIPTable *psip) const
bool HasAllSDToSections(uint tsid) const
TableStatusMap m_citStatus
dvb_other_listener_vec_t m_dvbOtherListeners
void CacheSDT(ServiceDescriptionTable *sdt)
Tells what channels can be found on each transponder for one bouquet (a bunch of channels from one pr...
static bool IsEIT(uint table_id)
bool HasEITPresentFollowing(uint i) const
void AddDVBMainListener(DVBMainStreamListener *val)
bool HasAllNITSections(void) const
std::vector< const NetworkInformationTable * > nit_vec_t
void RemoveDVBEITListener(DVBEITStreamListener *val)
uint TableIDExtension(void) const
void SetVersion(int32_t version, uint32_t last_section)
psip_refcnt_map_t m_cachedSlatedForDeletion
bool HasCachedSDT(bool current=true) const
virtual void AddListeningPID(uint pid, PIDPriority priority=kPIDPriorityNormal)
bool HasEITPIDChanges(const uint_vec_t &in_use_pids) const override
bool HasAllSDTSections(uint tsid) const
bool HasEITSchedule(uint i) const
bool IsSectionSeen(uint32_t key, int32_t version, uint32_t section) const
bool HasCachedAnyNIT(bool current=true) const
~DVBStreamData() override
bool GetEITPIDChanges(const uint_vec_t &cur_pids, uint_vec_t &add_pids, uint_vec_t &del_pids) const override
void ReturnCachedSDTTables(sdt_vec_t &sdts) const
bool m_dvbEitDishnetLong
Decode DishNet's long-term DVB EIT.
void AddDVBOtherListener(DVBOtherStreamListener *val)
void SetSectionSeen(int32_t version, uint32_t section, uint32_t last_section, uint32_t segment_last_section=0xffff)
uint TSID() const
transport_stream_id 16 3.0 0x0000
static pid_list_t::iterator find(const PIDInfoMap &map, pid_list_t &list, pid_list_t::iterator begin, pid_list_t::iterator end, bool find_open)
sdt_vec_t GetCachedSDTSections(uint tsid, bool current=true) const
uint m_desiredNetId
DVB table monitoring.