[mythtv] dvbsections.cpp / dvbchannel.cpp Changes In Progress

Taylor Jacob rtjacob at earthlink.net
Sun Aug 22 12:25:27 EDT 2004


I am currently in the process of putting the code I was working on externally of myth to scan the
DVB SI Tables into dvbsections.cpp.  So far I have the PAT/PMT/NIT/SDT objects built, and being
pulled reliably in my myth setup.  I suspect it will take me another 2-3 weeks since I don't get
much time to work on this stuff to have an experimental patch ready.

If anyone seens any fundamental flaws in how I am approaching this please let me know (especially
you Kenneth since I am changing a good deal of your code).

First round of patches (Network Scanning and DB Changes Only):

There will be a new class BaseSections that DVBSections will be part of since many of the header
functions, section tracking functions, and objects will be useful for ATSC (and I suspect
OpenCable)as well which I might look into working on whenever I get this DVB part done.

DVBSections will become public so that videosource can access it directly to do service scanning
from setup.

There will be a new signal from dvbchannel Tune() that will be sent to clear the PAT/PMT memory
before the PIDs are requested (This way auto-tuning based on PAT/PMT can be achieved a bit later
down the road).  This may eliminate the need for ChannelChanged since you can't change to a
channel you don't know the PIDs for (how the scanning portion of the code will work).

The database will be changed so that each DVB input will be listed in cardinput with its proper
diseqc options, and lnb settings (DVB-T and DVB-C will have these blank).  The CardInput types
will be DiSEqC Input xx if its a DVB-S card or standard DVBInput if its a DVB-C/T card.

The dvb_channel table will be eliminated.

There will be a table called dvb_transport that will store information on each transport, and be
linked to a sourceID, not a specific cardinput. (This will mean people with 2 dvb-s cards will not
have to have 2 copies of each channel; 1 for each card).

The channels table will add a few fields for each service.  (ServiceID, Reference to
dvb_transport, pmtcache (which will be removed later on when Auto-PID functionality is tested and
working for dvbcam), EITSource Transport.

There will be a thread for verifying Transport information that will run on a specified interval
that will re-tune to all transports in the database and verify SDT Versions.  If it is different
it will add all serviceIDs, and if they are audio/video mark them as visible in channel, otherwise
make them hidden.  This way all services will be known to myth whenever DVBAudio Only channels
support can be added.  This thread will stop itself whenever DVBRecorder starts, and get fired
back up when it stops so that it doesn't interfere with recordings or livetv.

AddPid,DelPid will become private in dvbsections.cpp since there is no reason for channel to open
a specific table for parsing since it cannot parse a table itself.

There will be functions PullNIT/PullSDT/PullEIT for each set of service tables that will emit a
signal when the table either times out or completes.  You then can request the object with other
functions for manipulation.

Whenever a new channel is tuned the PAT/PMT tables will be cached for every service described in
the PAT (makes scanning stations easier, and doesn't take any more time than the current method).

I am considering making there be a logfile of channel adds/deletes/changes for the dvbscanning
code, so that users can see what is going on (at least when its first being implimented and hasn't
been 100% tested and working).  Should this be a file, or should I make a table in the DB that
holds this information for a week or so similar to the signal strengh report?)

I also am having trouble deciding how to deal with multiple tuner cards pulling EIT and verifying
channels since each dvbchannel runs independent.  I think the best way is that the highest
numbered DVB card that has access to a specified Transport will be the only one allowed to tune to
it and run the treads.  (This should be the opposite of recording order so that the loops can run
freely more often).

There also will need to be some localization features added since some providers use custom
descriptors that could be parsed differently in different areas (DVB-T channel numbering
Descriptor in the UK, or Haufmann encoded EIT descriptors found in North America).   This will
most likely be added on network by network or transport by transport basis to not have strange
parsing errors on descriptors in the wrong region.

PLEASE NOTE: I do not have access to a DVB-C card or service so if someone with DVB-C cares they
will need to either write a DVB-C transport descriptor parser, or give me access to their system
to verify this functionality will work.

Phase 2 (Auto-PID Tuning):

Will change dvbchannel to wait for sections to provide the correct pids for the serviceID tuned to.

Will remove almost all entries from dvb_pid except for pid overrides.  This would mean if there
was no entry for in dvb_pid that the channel would be auto-tuned.

This also could mean that if a service was not on the specified transport anymore you could
possibly run a scan of the network to find where it had moved to.

Phase 3 (EIT Scanning and DB Population)

There will be an EIT parsing thread that runs like the channelverifier thread and updates/adds to
the program database at a certain interval.  This also will require localization functions for
some carriers since in NA i have found some carriers that encode everything in the long
description, and using regexps I can parse out the subttitle, audio type, etc information.







More information about the mythtv-dev mailing list