[mythtv] Bootstrapping DB settings

Bruce Markey mythtv-dev@snowman.net
Wed, 04 Dec 2002 07:05:32 -0800


Matt, the new interface for the settings stored in the
database looks like it's off to a good start. I like this
approach to managing settings. Here are some observations
while trying to get started using this first check in.

1) There is a mismatch for codecparams in the 0-7-to-0-8.sql
file. "type" is included in the primary key but is not
defined. At first I tried adding it as a not null varchar
but then I never saw it being set so maybe it doesn't belong
in the key...

2) Entering the recording settings with empty codecparams
and recordingprofiles tables causes some weird behavior the
first couple times through. It seems as if the first time
a profile is committed, the 13 name/value pairs in
codecparams have "0" in the profile column while there
are two rows created in recordingprofiles with id values
of 1 and 2 with missing data in each row.

Editing and committing "Custom" a second time adds 13
new rows in codecparams with a profile value of 1 and
the "Custom" row then has all fields filled in correctly.

3) Even though the "Finish" button goes back to the list
of profiles (suggesting you could begin adding another)
the edited profile doesn't appear to get committed until
exiting back to the setup menu. Is this the intended
behavior?

4) It looks as if the codecparams table is used as a group
of name/value pairs but the data seems like it should be
in rows. Did you consider using the names as columns then
putting the values in rows for each profile number?


Of these, fixing the sql upgrade file is the only thing
that needs attention before starting to use builds from
cvs.

--  bjm


AFTER FIRST SETTINGS COMMIT:

mysql> select * from recordingprofiles;
+----+--------+------------+------------+
| id | name   | videocodec | audiocodec |
+----+--------+------------+------------+
|  1 | Custom |            | NULL       |
|  2 |        | MPEG-4     | NULL       |
+----+--------+------------+------------+
2 rows in set (0.00 sec)

mysql> select * from codecparams;
+---------+-------------------------+-------+
| profile | name                    | value |
+---------+-------------------------+-------+
|       0 | width                   | 352   |
|       0 | height                  | 480   |
|       0 | rtjpegquality           | 170   |
|       0 | rtjpeglumafilter        | 0     |
|       0 | rtjpegchromafilter      | 0     |
|       0 | mpeg4bitrate            | 2200  |
|       0 | mpeg4maxquality         | 2     |
|       0 | mpeg4minquality         | 15    |
|       0 | mpeg4qualdiff           | 3     |
|       0 | hardwaremjpegquality    | 100   |
|       0 | hardwaremjpegdecimation | 2     |
|       0 | samplerate              | 44100 |
|       0 | mp3quality              | 7     |
+---------+-------------------------+-------+
13 rows in set (0.00 sec)

AFTER SECOND SETTINGS COMMIT:

mysql> select * from recordingprofiles;
+----+--------+------------+------------+
| id | name   | videocodec | audiocodec |
+----+--------+------------+------------+
|  1 | Custom | MPEG-4     | MP3        |
|  2 |        | MPEG-4     | NULL       |
+----+--------+------------+------------+
2 rows in set (0.01 sec)

mysql> select * from codecparams;
+---------+-------------------------+-------+
| profile | name                    | value |
+---------+-------------------------+-------+
|       0 | width                   | 352   |
|       0 | height                  | 480   |
|       0 | rtjpegquality           | 170   |
|       0 | rtjpeglumafilter        | 0     |
|       0 | rtjpegchromafilter      | 0     |
|       0 | mpeg4bitrate            | 2200  |
|       0 | mpeg4maxquality         | 2     |
|       0 | mpeg4minquality         | 15    |
|       0 | mpeg4qualdiff           | 3     |
|       0 | hardwaremjpegquality    | 100   |
|       0 | hardwaremjpegdecimation | 2     |
|       0 | samplerate              | 44100 |
|       0 | mp3quality              | 7     |
|       1 | width                   | 352   |
|       1 | height                  | 480   |
|       1 | rtjpegquality           | 170   |
|       1 | rtjpeglumafilter        | 0     |
|       1 | rtjpegchromafilter      | 0     |
|       1 | mpeg4bitrate            | 2200  |
|       1 | mpeg4maxquality         | 2     |
|       1 | mpeg4minquality         | 15    |
|       1 | mpeg4qualdiff           | 3     |
|       1 | hardwaremjpegquality    | 100   |
|       1 | hardwaremjpegdecimation | 2     |
|       1 | samplerate              | 44100 |
|       1 | mp3quality              | 7     |
+---------+-------------------------+-------+
26 rows in set (0.00 sec)