Questions & answers on Windows TV app. interaction
The following is from a mail I sent to DScaler developers (see also this RFE), but since I did not hear back from them and this will apply equivalently to all M$ Windows TV applications I've included it here.
- Q: How much effort is involved on the side of TV applications?
It should be fairly easy, since there's demo/reference clients and test applications (tvsim, vbirec) with all the necessary interface code, as well as the K!TV Nextview plugin as an example. The protocol between TV app and nxtvepg is not complex at all - based on shared memory and event triggers - so you'll probably be able to understand it almost immediately.
The source code for the demo interface isn't cleanly packaged yet (most of it is in one file: tvsim/winshmclnt.c, but VBI acquisition code is shared with the nxtvepg sources in epgvbi and epgdb subdirectories), but I can provide you with that and also write more documentation. In essence, you would need to add a few function calls at the right places in the TV app (e.g. one during startup, one for every channel change, one for every VBI line) and an event handler which processes incoming messages, most importantly EPG information (see WINSHMCLNT_EVENT in winshmclnt.h) Note the TV app does not need to deal with the shared memory directly, as there are interface functions to update or query contents.
The effort depends on how many features you want to support and how well. A few hours only is probably unrealistic, but it shouldn't take more than a few days, including testing. The full set of features would be:
- nxtvepg attach/detach (mandatory): upon application startup the TV app triggers an event and waits for nxtvepg to free the TV card if necessary
- VBI forwarding: allows Nextview acquisition when a provider channel is tuned in (Canal+ in F, Kabel1 and RTL2 in D (available on ASTRA satellite), SF1 in CH); also supports channel identification for EPG OSD.
- EPG OSD in the TV picture: after each channel change the EPG app is triggered to provide programme title, running times etc. for display in TV app's OSD; nxtvepg will also highlight the current programme in its TV schedules.
- remote control of the TV app by the EPG app: supports channel switches by double-clicking an entry in the TV schedules plus further optional commands which can be hooked into nxtvepg's context menu or reminder scripts, e.g. to start a recording.
- granting tuner: while the TV app is minimized or paused it can grant the TV tuner to nxtvepg to allow to switch to the Nextview provider channel to update the EPG database.
Most of these features can be demonstrated by tvsim.
- Q: How much adaptions are required for VBI forwarding?
Note that VBI forwarding is optional. But since the effort is low and it makes EPG OSD more reliable (at least for channels which support VPS/PDC) I'd highly recommend to include it.
The simplest way would be to include the nxtvepg slicer and pass it every VBI scan line. The interface module would then slice the data, filter for EPG teletext packets and VPS/PDC and pass that to nxtvepg through a ring buffer in shared memory. Alternatively you can pass already sliced data, e.g. for teletext a 40 byte array plus decoded page/packet number. I don't think any special conversions would be required in the TV app. You can use the vbirec tool to test if VPS/PDC and teletext are decoded and received correctly at the remote side of shared memory.
- Q: What information does nxtvepg provide in return?
nxtvepg fills a structure in shared memory with the current channel's program title, start/stop time and theme codes (movie, series etc.) This info is intended for OSD. nxtvepg can also provide it's entire database in XMLTV or plain text format.
If you have additional questions feel free to mail to "tomzo" at users.sourceforge.net