Ok, so I've been doing some work on recordserver and ivtv_record and am running into some pitfalls wrt the lack of VideoGroups. Sorry to do this but I need to bring this up again. :)


What we talked about using:

TV_[DVB|TV|IVTV]_[DEVICE|POST_CMD|PRE_CMD...] ie: TV_DVB_DEVICE = ['/dev/dvb']

CHANNEL_LIST = [
     ('vox.de', 'VOX', ['dvb:VOX', 'tv0:1234', 'tv1:1234'])
]
(Or Hans' suggestion... see below)

TV_MPLAYER_URLS['tv0'] = '-tv device=/dev/video0:...'
TV_MPLAYER_URLS['tv1'] = '-tv device=/dev/video1:input=4...'
TV_MPLAYER_URLS['ivtv0'] = '-cache 8192 /dev/video2'


We are still missing some fine grained configuration that came from video groups, most of that config we don't really need but we need to know more about each dvb/tv0/tv1 such as: audio device to capture from, are we using tuner, composite, or svideo input, what number said input is mapped to on the card, the norm (NTSC/PAL/SECAM), and the chanlist (us-cable, etc). The old VIDEO_GROUPS array is very user unfriendly and the TV_* single variable assignment is much cleaner from that perspective. On the other hand if we introduce new variables for TV_[DVB|TV|IVTV]_[device|input|norm|adevice...] there will be too many variables to deal with and even then you also have to consider multiple devices of each kind (tv0, tv1, tv2). We had talked about using lists to handle that, which introduces more complexity.


I've done some more thinking and come up with something in between. Inside config.py I would like to introduce a new class:

class TVSettings:
    """
    vdev:        The video device, such as /dev/video.
    adev:        The audio device, such as /dev/dsp.
    input_type:  tuner, composite, svideo, webcam
    input_num:   The number of this input according to V4L
    tuner_norm:  NTSC, PAL, SECAM
    tuner_chanlist:  us-cable,
    """

    def __init__(self):

        self.vdev = '/dev/video0'
        self.adev = '/dev/dsp0'
        self.input_type = 'tuner'
        self.input_num  = 0
        self.tuner_norm = CONF.norm
        self.tuner_chanlist = CONF.chanlist

That is much smaller than VideoGroup. But still, we don't want users to have to instantiate this class by themselves in their config! We can do that behind the scenes in config.py or freevo_config.py (please bear with me):

# Accept the defaults for the first regular tv card
TV_SETTINGS['tv'] = TVSettings()

# The user may decide to call that tv0 instead, do another for convenience
TV_SETTINGS['tv0'] = TVSettings()

TV_SETTINGS['tv1'] = TVSettings()
TV_SETTINGS['tv1'].vdev = '/dev/video1'
TV_SETTINGS['tv1'].adev = '/dev/dsp1'

TV_SETTINGS['tv2'] = TVSettings()
TV_SETTINGS['tv2'].vdev = '/dev/video2'
TV_SETTINGS['tv2'].adev = '/dev/dsp2'


# Accept the defaults for the first ivtv card TV_SETTINGS['ivtv'] = TVSettings() TV_SETTINGS['ivtv'].adev = None TV_SETTINGS['ivtv'].input_num = 4

# The user may decide to call that ivtv0 instead, do another for convenience
TV_SETTINGS['ivtv0'] = TVSettings()
TV_SETTINGS['ivtv0'].adev = None
TV_SETTINGS['ivtv0'].input_num = 4

TV_SETTINGS['ivtv1'] = TVSettings()
TV_SETTINGS['ivtv1'].vdev = '/dev/video1'
TV_SETTINGS['ivtv1'].adev = None
TV_SETTINGS['ivtv1'].input_num = 4

TV_SETTINGS['ivtv2'] = TVSettings()
TV_SETTINGS['ivtv2'].vdev = '/dev/video2'
TV_SETTINGS['ivtv2'].adev = None
TV_SETTINGS['ivtv2'].input_num = 4

# Accept the defaults for the first DVB card
TV_SETTINGS['dvb'] = TVSettings()
TV_SETTINGS['dvb'].vdev = '/dev/dvb/adapter0/dvr0'
# Or we could use '/dev/dvb/adapter0/' to find each device
# in that dir.
TV_SETTINGS['dvb'].adev = None

# The user may decide to call that dvb0 instead, do another for convenience
TV_SETTINGS['dvb0'] = TVSettings()
TV_SETTINGS['dvb0'].vdev = '/dev/dvb/adapter0/dvr0'
TV_SETTINGS['dvb0'].adev = None

TV_SETTINGS['dvb1'] = TVSettings()
TV_SETTINGS['dvb1'].vdev = '/dev/dvb/adapter1/dvr1'
TV_SETTINGS['dvb1'].adev = None

TV_SETTINGS['dvb2'] = TVSettings()
TV_SETTINGS['dvb2'].vdev = '/dev/dvb/adapter2/dvr2'
TV_SETTINGS['dvb2'].adev = None


Ok, all that behind the scenes, hidden from the user. Most people will require no further configuration if we default TV_CHANNELS to 'tv0:'. Using this method we'll have ell the information we'll need for each device, even with more complicated situations (using svideo input, external tuner..). Consider these scenarios:


1) User has a regular tv tuner but it is on video1 instead.

TV_SETTINGS['tv0'].vdev = '/dev/video1'
# Or maybe their second tuner is on video2
TV_SETTINGS['tv1'].vdev = '/dev/video2'


2) User has a regular tv tuner hooked up to a cable box recording from svideo and using an infrared transmitter to change channels:


TV_SETTINGS['tv0'].input_type = 'svideo'
TV_SETTINGS['tv0'].input_num = 2
# and _maybe_ tuner_type but I think we can do without
TV_SETTINGS['tv0'].tuner_type = 'external'
# That was pretty easy to configure.


3) My second tuner is PAL but my conf uses NTSC (unrealistic):

TV_SETTINGS['tv1'].norm = 'PAL'


Actually I'm having a hard time thinking of scenarios where the user might need to change something and even then it is easy. If the user needs more than 3 tv cards they should be able to figure out how to add 'tv3'.


Also, I like Hans' suggestion of using DEFAULT_CHANNEL_METHOD = ['tv0', 'tv1'] or CHANNEL_METHOD_ALTERNATIVES = {'tv0': 'tv1'} to default to one type and to determine that two devices see the same channels.

I would still like to use TV_MPLAYER_URLS['tv0'] = '-tv device=/dev/video0:...' and this in fact would really be a requirement for the tv.mplayer plugin.

As for using an external tuner plugin to channel change, the plugin could be configured to change channels for ['tv1, 'ivtv0']. In my SVDRP plugin I will have it change channels for ['dvb0']. It would even be possible to move V4L tuning into a plugin, definitely needed by ivtv and possibly timeshifting for tv0.

Comments? *crossed fingers*

-Rob





-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
Freevo-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to