Ticket #5530: csat-eithelper.diff

File csat-eithelper.diff, 5.1 KB (added by anonymous, 16 years ago)
  • mythtv/libs/libmythtv/eithelper.h

    old new  
    4848class ExtendedTextTable;
    4949class DVBEventInformationTable;
    5050class PremiereContentInformationTable;
     51class CSatCaraibesInformationTable;
    5152
    5253class EITHelper
    5354{
     
    7273                    const ExtendedTextTable     *ett);
    7374        void AddEIT(const DVBEventInformationTable *eit);
    7475        void AddEIT(const PremiereContentInformationTable *eit);
     76        void AddEIT(CSatCaraibesInformationTable *eit);
    7577#else // if !USING_BACKEND
    7678        void AddEIT(uint, uint, const EventInformationTable*) {}
    7779        void AddETT(uint, uint, const ExtendedTextTable*) {}
    7880        void AddEIT(const DVBEventInformationTable*) {}
    7981        void AddEIT(const PremiereContentInformationTable*) {}
     82        void AddEIT(const CSatCaraibesInformationTable*) {}
    8083#endif // !USING_BACKEND
    8184
    8285        // EIT cache handling
  • mythtv/libs/libmythtv/eithelper.cpp

    old new  
    1919#include "atsctables.h"
    2020#include "dvbtables.h"
    2121#include "premieretables.h"
     22#include "csatcaraibestables.h"
    2223#include "dishdescriptors.h"
    2324#include "premieredescriptors.h"
    2425#include "util.h"
     
    511512    }
    512513}
    513514
     515// This function gets special eit data from the French provider
     516// Canal Satellite Caraibes. It probably applies to this provider
     517// in France. This EIT is available for all channels for 7-10 days                   
     518void EITHelper::AddEIT(CSatCaraibesInformationTable *cit)
     519{
     520    QString title         = QString::null;
     521    QString subtitle      = QString::null;
     522    QString description   = QString::null;
     523    QString category      = QString::null;
     524    MythCategoryType category_type = kCategoryNone;
     525    unsigned char subtitle_type=0, audio_props=0, video_props=0;
     526    uint fix = fixup[ 601LL << 32 | 1 << 16 |  0 ] | EITFixUp::kFixGenericDVB;
     527    if (!cit->IsReady()) {
     528        VERBOSE(VB_EIT,LOC+"CSAT EIT NOT READY YET");
     529        return;
     530    }
     531    for (uint i = 0;i < cit->NbSchedules();i++) {
     532        const CSatCaraibesSchedule& schedule = cit->GetSchedule(i);
     533        QString title = schedule.title;
     534        const vector<CSatCaraibesShowing>& showings = schedule.showings;
     535        QMap<uint, QString>::const_iterator sum;
     536        bool sum_available = false;
     537
     538        if (schedule.key) {
     539            /* If the summary is not there we go on with the next schedule */
     540            if (!(cit->GetSummary(i, sum))) continue;
     541            sum_available = true;
     542        }
     543        for (vector<CSatCaraibesShowing>::const_iterator it = showings.begin();
     544             it != showings.end();it++) {
     545            QDateTime starttime = (*it).Start;
     546            //    EITFixUp::TimeFix(starttime);
     547            QDateTime endtime   = starttime.addSecs(schedule.duration*60);
     548            uint chanid;
     549            DBEvent *event;
     550            const CSatCaraibesChannelInfo& info = cit->GetChannelInfoFromIndex((*it).channel_index);
     551            chanid = GetChanID(info.tsid,info.serviceid,info.orignetworkid);
     552            VERBOSE(VB_EIT, LOC +
     553                    QString("CSATCARAIBES EIT for NIT %1, TID %2, SID %3, "
     554                            "T: %4, Start: %5, Dur: %6 Thm: %7, summ: %8")
     555                    .arg(info.orignetworkid).arg(info.tsid).arg(info.serviceid)
     556                    .arg(title).arg(starttime.toString()).arg(schedule.duration)
     557                    .arg(schedule.theme).arg((sum_available ? *sum :"No summary")));
     558     
     559            if (!chanid)
     560            {
     561                VERBOSE(VB_EIT, LOC +
     562                        QString("CSATCARAIBES EIT for NIT %1, TID %2, SID %3, "
     563                                "title: %4. Channel not found!")
     564                        .arg(info.orignetworkid).arg(info.tsid).arg(info.serviceid)
     565                        .arg(title));
     566                continue;
     567            }
     568     
     569            /*      event = new DBEvent(chanid,
     570                    title, QString::null, sum_available ? (*sum).value():"",
     571                    category,  category_type,
     572                    starttime, endtime, fix,
     573                    subtitle_type,
     574                    audio_props,
     575                    video_props,
     576                    "",  "");
     577                    db_events.enqueue(event);*/
     578        }
     579    }
     580}
    514581
    515582void EITHelper::PruneEITCache(uint timestamp)
    516583{
     
    855908        fix[ 1100LL << 32 | 1 << 16 |  8710 ] = // NRJ 12
    856909        EITFixUp::kEFixForceISO8859_15;
    857910
     911    // IntelSat 903 DVB-S french channels (CanalSat Caraibes)
     912    // The original network id is the same as the previous one
     913    // at least transport ids are different
     914    // For now all channels are marked as needing fixup
     915    fix[   601LL << 32 | 1 << 16 |  0 ] =
     916        fix[ 602LL << 32 | 1 << 16 |  0 ] =
     917        fix[ 603LL << 32 | 1 << 16 |  0 ] =
     918        fix[ 604LL << 32 | 1 << 16 |  0 ] =
     919        EITFixUp::kEFixForceISO8859_15;
    858920}
    859921
    860922static int calc_eit_utc_offset(void)