Difference between revisions of "Channel table"

From MythTV Official Wiki
Jump to: navigation, search
m (table style)
Line 3: Line 3:
 
Amended on April 5, 2006 to reflect the present schema (adding new fields)
 
Amended on April 5, 2006 to reflect the present schema (adding new fields)
  
<pre>
+
{| cellpadding="4"
mysql> describe channel;
+
|- bgcolor="#9999ff"
+---------------+-----------------------+------+-----+---------+-------+
+
Field       !! Type                  !! Null !! Key !! Default !! Extra
| Field         | Type                  | Null | Key | Default | Extra |
+
|- bgcolor="#cccccc"
+---------------+-----------------------+------+-----+---------+-------+
+
| chanid        || int(10) unsigned      ||      || PRI || 0      ||
| chanid        | int(10) unsigned      |      | PRI | 0      |       |
+
|- bgcolor="#cccccc"
| channum      | varchar(10)          |      | MUL |        |       |
+
| channum      || varchar(10)          ||      || MUL ||        ||
| freqid        | varchar(10)          | YES  |    | NULL    |       |
+
|- bgcolor="#cccccc"
| sourceid      | int(10) unsigned      | YES  |    | NULL    |       |
+
| freqid        || varchar(10)          || YES  ||    || NULL    ||
| callsign      | varchar(20)          |      |    |        |       |
+
|- bgcolor="#cccccc"
| name          | varchar(64)          |      |    |        |       |
+
| sourceid      || int(10) unsigned      || YES  ||    || NULL    ||
| icon          | varchar(255)          |      |    | none    |       |
+
|- bgcolor="#cccccc"
| finetune      | int(11)              | YES  |    | NULL    |       |
+
| callsign      || varchar(20)          ||      ||    ||        ||
| videofilters  | varchar(255)          |      |    |        |       |
+
|- bgcolor="#cccccc"
| xmltvid      | varchar(64)          |      |    |        |       |
+
| name          || varchar(64)          ||      ||    ||        ||
| recpriority  | int(10)              |      |    | 0      |       |
+
|- bgcolor="#cccccc"
| contrast      | int(11)              | YES  |    | 32768  |       |
+
| icon          || varchar(255)          ||      ||    || none    ||
| brightness    | int(11)              | YES  |    | 32768  |       |
+
|- bgcolor="#cccccc"
| colour        | int(11)              | YES  |    | 32768  |       |
+
| finetune      || int(11)              || YES  ||    || NULL    ||
| hue          | int(11)              | YES  |    | 32768  |       |
+
|- bgcolor="#cccccc"
| tvformat      | varchar(10)          |      |    | Default |       |
+
| videofilters  || varchar(255)          ||      ||    ||        ||
| commfree      | tinyint(4)            |      |    | 0      |       |
+
|- bgcolor="#cccccc"
| visible      | tinyint(1)            |      |    | 1      |       |
+
| xmltvid      || varchar(64)          ||      ||    ||        ||
| outputfilters | varchar(255)          |      |    |        |       |
+
|- bgcolor="#cccccc"
| useonairguide | tinyint(1)            | YES  |    | 0      |       |
+
| recpriority  || int(10)              ||      ||    || 0      ||
| mplexid      | smallint(6)          | YES  |    | NULL    |       |
+
|- bgcolor="#cccccc"
| serviceid    | mediumint(8) unsigned | YES  |    | NULL    |       |
+
| contrast      || int(11)              || YES  ||    || 32768  ||
| atscsrcid    | int(11)              | YES  |    | NULL    |       |
+
|- bgcolor="#cccccc"
+---------------+-----------------------+------+-----+---------+-------+
+
| brightness    || int(11)              || YES  ||    || 32768  ||
23 rows in set (0.00 sec)
+
|- bgcolor="#cccccc"
 
+
| colour        || int(11)              || YES  ||    || 32768  ||
</pre>
+
|- bgcolor="#cccccc"
 
+
| hue          || int(11)              || YES  ||    || 32768  ||
 +
|- bgcolor="#cccccc"
 +
| tvformat      || varchar(10)          ||      ||    || Default ||
 +
|- bgcolor="#cccccc"
 +
| commfree      || tinyint(4)            ||      ||    || 0      ||
 +
|- bgcolor="#cccccc"
 +
| visible      || tinyint(1)            ||      ||    || 1      ||
 +
|- bgcolor="#cccccc"
 +
| outputfilters || varchar(255)          ||      ||    ||        ||
 +
|- bgcolor="#cccccc"
 +
| useonairguide || tinyint(1)            || YES  ||    || 0      ||
 +
|- bgcolor="#cccccc"
 +
| mplexid      || smallint(6)          || YES  ||    || NULL    ||
 +
|- bgcolor="#cccccc"
 +
| serviceid    || mediumint(8) unsigned || YES  ||    || NULL    ||
 +
|- bgcolor="#cccccc"
 +
| atscsrcid    || int(11)              || YES  ||    || NULL    ||
 +
|-
 +
|}
 
R. G. Newbury [[User:65.94.232.153|65.94.232.153]] 15:56, 5 April 2006 (UTC)
 
R. G. Newbury [[User:65.94.232.153|65.94.232.153]] 15:56, 5 April 2006 (UTC)
  

Revision as of 22:35, 3 March 2007

Each row in this table describes one tunable channel, where a channel is a unique combination of hardware settings such as frequency, modulation and subchannel id (serviceid) for satellite and digital cable -- if you get CNN from two Video Sources, it will appear twice in this table (though, as long as the callsigns are the same, ScheduledRecordings will be moved from one tuner to another, priorities permitting). The sourceid is used to find a tuner which can tune the channel. The mplexid field is used to point to information in the dtv_multiplex table which will be used to tune the tuner, and the serviceid is used to select a particular digital stream from the tuned feed.

Amended on April 5, 2006 to reflect the present schema (adding new fields)

Field Type Null Key Default Extra
chanid int(10) unsigned PRI 0
channum varchar(10) MUL
freqid varchar(10) YES NULL
sourceid int(10) unsigned YES NULL
callsign varchar(20)
name varchar(64)
icon varchar(255) none
finetune int(11) YES NULL
videofilters varchar(255)
xmltvid varchar(64)
recpriority int(10) 0
contrast int(11) YES 32768
brightness int(11) YES 32768
colour int(11) YES 32768
hue int(11) YES 32768
tvformat varchar(10) Default
commfree tinyint(4) 0
visible tinyint(1) 1
outputfilters varchar(255)
useonairguide tinyint(1) YES 0
mplexid smallint(6) YES NULL
serviceid mediumint(8) unsigned YES NULL
atscsrcid int(11) YES NULL

R. G. Newbury 65.94.232.153 15:56, 5 April 2006 (UTC)

This is a channel record for an atsc digital cable stream, which is nominally on channel 74, but is listed by the cable supplier as channel 406. The mplexid is 110 and the dtv_multiplex table defines the modulation method to be used to decode the stream(in this case QAM_256). The actual stream is denoted by the serviceid of 52.

mysql> select * from channel where mplexid = '110' and chanid = '2743';

| chanid | channum | freqid | sourceid | callsign | name | icon | finetune | videofilters | xmltvid | recpriority | contrast | brightness | colour | hue | tvformat | commfree | visible | outputfilters | useonairguide | mplexid | serviceid | atscsrcid | tmoffset | atsc_major_chan | atsc_minor_chan |

| 2743 | 406 | 74 | 2 | RSP | Sportsnet Pacific | | NULL | | 18801 | 0 | 32768 | 32768 | 32768 | 32768 | atsc | 0 | 1 | | 0 | 110 | 52 | NULL | 0 | 0 | 0 |

Although the channum of 406 is the cable co's. reference (and also used by DataDirect), xmltvid is the unique reference key, as this channel may be given a different number elsewhere on the same cable co. system. The tvformat must be atsc for digital cable or OTA. Note that for cable channels the channel number is a whole number, while OTA uses the 18.2 style.