[mythtv] DVB integration - first attempt!

Ben Bucksch linux.news at bucksch.org
Wed Apr 23 13:43:24 EDT 2003

Edward Wildgoose wrote:

>Ben, this sounds great.  I would like to get a look at it so far
OK, I created a patch, it's at 
<http://www.bucksch.org/xfer/dvb-1.tar.bz2> (it's 80K, not sure if that 
is appropriate as attachment for this list). Note that the DVB part is 
*not* useable - as I said, it's unfinished and doesn't work yet.

What should work, though, is the analog part - I made a change how 
normal analog cards are tuned, and it's of course that I didn't cause 
regressions there, so it would be nice, if you could test for any bugs 
that are not in normal CVS.

Other than that, I'd be happy to get feedback on the general approach I 
took. But, as I said, the details of the code are still quite a mess at 
some places, so keep in mind that it's a work in progress.

>and I will see what I can do about a shell account. 
>I'm not sure that I quite understand what you are doing though
What you described is more or less the second ("stream" in the code) 
approach. Just that I don't work with unix socket, but will try to 
accept a stream from stdout of a help app (e.g. dvbstream) directly.

>- Use an external daemon program to provide the tuning.  This is effectively going to be a thin wrapper around dvbstream
I don't think that dvbstream is appropriate in that usage. In Myth, the 
tuning is independent from the data stream (you can change the channel 
of an ongoing recording, if I understood it correctly), and dvbstream 
takes tuning param on the commandline. Of course, that would mean to 
restart dvbstream during each tuning, and that doesn't line up with 
MythTV's internal workings. I first thought (when I replied to Richard 
King) that this complete negates that whole pipe approach, but then I 
realized that dvbsteam has a telnet interface, so you could write a 
little wrapper (using netcat or whatever) which tells a running 
dvbstream to change the channel using its telnet interface. A hack, for 
sure, but it could work.

The same approach - one external program for the stream, via stdout, 
another external program for tuning, like cardinput.externalcommand 
today - could work for completely different kinds of inputs as well, 
that's why I thought that code would be useful in general and added it. 
It would probably be a hack in all cases, but a hack that a user can do 
without changes to the MythTV source code, which has considerable 

Because that's a hack, my other approach is to try to integrate this all 
into MythTV. I do that by partially using dvbstream source code.

>Anyway, the main question is how to modify myth???
See the attached code :).

>Do you think it is a simple matter to just alter the MpegRecord.cpp module to ditch the v4l2 stuff, or is something more complicated needed?
That, and we have the same problem in channel.cpp. I subclassed both 
MpegRecorder and Channel to StreamRecorder and StreamChannel, overriding 
all the methods accessing /dev/video with either alternate versions or 
empty functions (because they are not needed or don't make sense for 
us). Then I changed tv_rec.cpp to create these classes in the case of 
cardtype DVB or Stream, basically the same Isaac did for the PVR250 
(cardtype "MPEG").


More information about the mythtv-dev mailing list