[mythtv] [experimental patch] pchdtv bttv support

Daniel Thor Kristjansson danielk at mrl.nyu.edu
Mon Jan 17 21:25:01 EST 2005


On Mon, 17 Jan 2005, Isaac Richards wrote:
]On Monday 17 January 2005 06:25 pm, Daniel Thor Kristjansson wrote:
]>    http://www.mrl.nyu.edu/~danielk/mythtv/daughtercard-v4.tbz
]> Also this patch modifies the myth protocol so it updates the protocol
]> version. So you will need to relink any plugins.
]
]I don't really like this approach.  Why can't the TVRec object simply switch 
]between the two types of recorder objects as needed?  I think that would be 
]much, much simpler.

That's what I thought too. This was my first implementation, and it
didn't work very well. The scheduler gave me troubles and I had to 
create a completely new channel object that contained both regular and 
hdtv channel and implemented virtualized inputs on top of these. (The 
current channel object is very tied to a single device file). It 
surprisingly turned out more complex. I also needed to keep two 
different ring buffers in TVRec or do some fancy footwork.

This patch seems a little complex at the moment, but I'm simplifying the 
patch right now. What it will break down to once simplified is as 
follows:

 * IsBusy in PlaybackSock, and TVRec is replaced with 
   IsRecorderBusy(IS_RECORDER_BUSY) and IsTunerBusy(IS_TUNER_BUSY). And 
   the proper modifications are made to mainserver.cpp 
 * setupTV() in programs/mythbackend/main.cpp is modified to create
   the TunerLock's in addition to the EncoderLink objects
 * In the Scheduler class there are three modifications
   in FindNextConflict 
     "if (p->cardid != 0 && p->cardid != q->cardid)"
   becomes
     "if (p->tunerid != 0 && p->tunerid != q->tunerid)"
   in RunScheduler
     one IsBusy in call becomes an IsRecorderBusy call
   in AddNewRecords
     capturecard.parentid is added to the select statement
     and it is used to update the tunerid field in programinfo
     "p->tunerid = (parentid==-1)? cardid : parentid;"
 * int tunerid is added to ProgramInfo
 * RecTV() is modified as follows
     GetState() -- blocks until changeState is false, in all tuner sharers
     IsBusy() -- split into IsRecorderBusy() and IsTunerBusy()
     GetDevices() -- fetches parentid in addition to other db stuff
     TVRec::TVRec() -- creates links to tuner sharers, & shared tunerlocks
     StartRecording() and RunTV() -- modified to handle pending 
       recordings on other cards sharing tuner
     RunTV() -- blocks GetState while processing events in HandleStateChange()

The beauty of this is that it isn't a special case for the pcHDTV card, 
it will work equally well for dealing with the radio tuner on other 
cards.

-- Daniel


More information about the mythtv-dev mailing list