PDA

View Full Version : [DEV] Combine Sky Movies EPG



Speedy2206
05-05-2007, 12:36 PM
I have thought of two ways of doing this.

METHOD 1
The first involves a file which is completely seperate from the services and zapit - /var/tuxbox/config/skymovies.conf

It has a format like this:
ChannelName=pic_serviceid,epg_service.id

Therefore (based on renwichs post in DBOX2 section):


SkyComedy=1e26,04b5
SkyAction=1e27,04b4
SkySciFi=1e29,04e6

And so on and so forth...

In sisections.cpp (sectionsd) we just read the file and link the two values together. Quite a simple idea and the coding looks clean and tidy too.


METHOD 2
The second method uses the real XML interface (libxml) to read the services.xml. An extra node is added titled "use_epg" which links the two values.

Again, we use sisections.cpp to get the node attribute and link the two values together. The coding for this one should theoretically look clean but what I came up with looked very ugly.


What do we think?

descriptors.cpp (zapit) can still be used for automatic channel renaming

Speedy2206
05-05-2007, 12:38 PM
Oh and also (this is probably a question for cydine but also to anyone else that knows), this section of code here:


if (e.service_id == 0x0404)
e.service_id = 0x0405;
else if (e.service_id == 0x04e8)
e.service_id = 0x0403;
else if (e.service_id == 0x0205)
e.service_id = 0x026c;

How do you obtain the values for e.service_id (highlighted in bold). I can see that they are hex numbers, but where can this information be found in services.xml (if its even there). Do you convert decimal to hex or anything like that?

Probably a stupid question lol.
But I havent looked into that bit as my DBOX itself is completely f**ked and I am just literally coding off the top of my head now.

icemanv3
05-05-2007, 01:09 PM
Method 2 ftw to be honest.

Although it also needs the way of renaming the channel, but i think myservices already has this?


Basically most of mine have the channel name and EPG on one channel, and the picture on another. However one or two (Skyfamily being one of them has everything on one channel.

Speedy2206
05-05-2007, 02:03 PM
I eventually changed the XML coding (method 2) to this:


#include "SIutils.hpp"
#include "SIservices.hpp"
#include "SIevents.hpp"
#include "SIbouquets.hpp"
#include "SInetworks.hpp"
#include "SIsections.hpp"
#include <dmxapi.h>
#include <zapit/dvbstring.h>

/* Speedy2206: Sky Movies EPG dependancies */
#include <zapit/xmlinterface.h>
#include <sys/stat.h>
#define SERVICES_XML "/var/tuxbox/config/zapit"


#define NOVA 0x3ffe
#define CANALDIGITAAL 0x3fff



while (actPos < &buffer[bufferLength - sizeof(struct eit_event)]) {
evt = (struct eit_event *) actPos;
SIevent e(evt);
e.service_id = service_id();

/* ================================================== =================================================
Speedy2206: NEW CODE for Sky Movies EPG transfer. I have never played with XML before so this will
probably not work. I can't even test either. */

xmlDocPtr parser;
if(stat(SERVICES_XML,&testbuf) == 0) // If services.xml is OK...
{
if ((parser = parseXmlFile(SERVICES_XML, false))) { // Parse XML
printf("[SIsections] " SERVICES_XML " found.\n"); // Debug Message
//FindTransponder(xmlDocGetRootElement(parser)->xmlChildrenNode); // Not sure what this is (found it in zapit code)
while ((node = xmlGetNextOccurence(node, "use_epg")) != NULL) // For each "use_epg" found...
{
pic_servid = xmlGetNumericAttribute(node, "service_id", 16); // pic service_id in base16
epg_servid = xmlGetNumericAttribute(node, "use_epg", 16); // epg service_id in base16
if (e.service_id == pic_servid) // If current sID = sID in services.xml
e.service_id = epg_servid; // Replace with sID for EPG
node = node->xmlNextNode; // Read next node until end
}
xmlFreeDoc(parser); // Release the document
}
}
/* ================================================== ================================================= */

e.original_network_id = original_network_id();
e.transport_stream_id = transport_stream_id();
descriptors_loop_length = (evt->descriptors_loop_length_hi << 8) | evt->descriptors_loop_length_lo;
parseDescriptors(((const char *)evt) + sizeof(struct eit_event), min((unsigned)(buffer + bufferLength - actPos), descriptors_loop_length), e);
evts.insert(e);
actPos += sizeof(struct eit_event) + descriptors_loop_length;
}

.. But I have no way of testing whether or not it works or even compiles.

renwich
05-05-2007, 07:15 PM
if (e.service_id == 0x0404)
e.service_id = 0x0405;
else if (e.service_id == 0x04e8)
e.service_id = 0x0403;
else if (e.service_id == 0x0205)
e.service_id = 0x026c;

AFAIK as an example
<channel service_id="00c9" name="SM9_ETV" service_type="01"/> = 0x00c9
<channel service_id="00d0" name="Sky Movies 9" service_type="01"/> =0x00d0
<channel service_id="0404" name="Sky Movies 10" =0x0404
<channel service_id="0405" name="Sky Mv 10" =0x0405
I prefer your second method and am more than willing to test

renwich
13-05-2007, 12:07 PM
@speedy you had chance to do any more on this..??

renwich
04-01-2008, 08:36 PM
@Cydine are you able to give any clues on how to do this m8..