Ticket #6274: HDHR-DVB.0-21.patch

File HDHR-DVB.0-21.patch, 6.9 KB (added by Nigel, 15 years ago)

Same thing for fixes

  • libs/libmythtv/hdhrchannel.h

     
    11/** -*- Mode: c++ -*-
    2  *  Dbox2Channel
    3  *  Copyright (c) 2006 by Silicondust Engineering Ltd.
     2 *  HDHRChannel
     3 *  Copyright (c) 2006-2009 by Silicondust Engineering Ltd.
    44 *  Distributed as part of MythTV under GPL v2 and later.
    55 */
    66
     
    5252    bool DelAllPIDs(void);
    5353    bool UpdateFilters(void);
    5454
    55     // ATSC scanning stuff
     55    // ATSC/DVB scanning/tuning stuff
    5656    bool TuneMultiplex(uint mplexid, QString inputname);
    5757    bool Tune(const DTVMultiplex &tuning, QString inputname);
    5858
  • libs/libmythtv/hdhrrecorder.h

     
    1818typedef vector<uint>        uint_vec_t;
    1919
    2020class HDHRRecorder : public DTVRecorder,
     21                     public DVBMainStreamListener,
     22                     public ATSCMainStreamListener,
    2123                     public MPEGStreamListener,
    2224                     public MPEGSingleProgramStreamListener
    2325{
    24     friend class ATSCStreamData;
    25 
    2626  public:
    2727    HDHRRecorder(TVRec *rec, HDHRChannel *channel);
    2828    ~HDHRRecorder();
     
    5252    void HandleSingleProgramPAT(ProgramAssociationTable *pat);
    5353    void HandleSingleProgramPMT(ProgramMapTable *pmt);
    5454
    55     /*
    5655    // ATSC
    5756    void HandleSTT(const SystemTimeTable*) {}
    58     void HandleMGT(const MasterGuideTable *mgt);
     57    void HandleMGT(const MasterGuideTable*) {}
    5958    void HandleVCT(uint, const VirtualChannelTable*) {}
    60     */
    6159
     60    // DVB
     61    void HandleTDT(const TimeDateTable*) {}
     62    void HandleNIT(const NetworkInformationTable*) {}
     63    void HandleSDT(uint /*tsid*/, const ServiceDescriptionTable*) {}
     64
    6265  private:
    6366    bool AdjustFilters(void);
    6467    bool AdjustEITPIDs(void);
  • libs/libmythtv/hdhrchannel.cpp

     
    11/**
    2  *  DBox2Channel
    3  *  Copyright (c) 2006 by Silicondust Engineering Ltd.
     2 *  HDHRChannel
     3 *  Copyright (c) 2006-2009 by Silicondust Engineering Ltd.
    44 *  Distributed as part of MythTV under GPL v2 and later.
    55 */
    66
     
    2424#include "hdhrchannel.h"
    2525#include "videosource.h"
    2626#include "channelutil.h"
    27 #include "frequencytables.h"
    2827
    2928#define DEBUG_PID_FILTERS
    3029
     
    384383
    385384bool HDHRChannel::Tune(const DTVMultiplex &tuning, QString inputname)
    386385{
     386    QString modulation;
     387    QString si_std = tuning.sistandard;
     388
     389
     390    switch (tuning.modulation)
     391    {
     392        case DTVModulation::kModulation8VSB:   modulation = "8vsb";   break;
     393        case DTVModulation::kModulationQAM16:  modulation = "qam16";  break;
     394        case DTVModulation::kModulationQAM32:  modulation = "qam32";  break;
     395        case DTVModulation::kModulationQAM64:  modulation = "qam64";  break;
     396        case DTVModulation::kModulationQAM128: modulation = "qam128"; break;
     397        case DTVModulation::kModulationQAM256: modulation = "qam256"; break;
     398        default:                               modulation = "auto";
     399    }
     400
     401    if (modulation == "auto" && si_std == "dvb")
     402        switch (tuning.bandwidth)
     403        {
     404            case DTVBandwidth::kBandwidth6MHz: modulation = "auto6t"; break;
     405            case DTVBandwidth::kBandwidth7MHz: modulation = "auto7t"; break;
     406            case DTVBandwidth::kBandwidth8MHz: modulation = "auto8t"; break;
     407        }
     408    //else if (modulation == "auto" && si_std == "atsc")
     409    else if (si_std == "dvb")
     410        switch (tuning.bandwidth)
     411        {
     412            case DTVBandwidth::kBandwidth6MHz: modulation.prepend("t6"); break;
     413            case DTVBandwidth::kBandwidth7MHz: modulation.prepend("t7"); break;
     414            case DTVBandwidth::kBandwidth8MHz: modulation.prepend("t8"); break;
     415        }
     416
     417
    387418    return Tune(tuning.frequency, inputname,
    388                 tuning.modulation.toString(), tuning.sistandard);
     419                modulation, si_std);
    389420}
    390421
    391422bool HDHRChannel::Tune(uint frequency, QString /*input*/,
    392423                       QString modulation, QString si_std)
    393424{
    394     bool ok = false;
     425    QString channel = modulation + ':' + QString::number(frequency);
    395426
    396     VERBOSE(VB_CHANNEL, LOC +
    397             QString("TuneTo(%1,%2)").arg(frequency).arg(modulation));
     427    VERBOSE(VB_CHANNEL, LOC + "Tune() to " + channel);
    398428
    399     if (modulation == "8vsb")
    400         ok = TunerSet("channel", QString("8vsb:%1").arg(frequency));
    401     else if (modulation == "qam_64")
    402         ok = TunerSet("channel", QString("qam64:%1").arg(frequency));
    403     else if (modulation == "qam_256")
    404         ok = TunerSet("channel", QString("qam256:%1").arg(frequency));
    405 
    406     if (ok)
     429    if (TunerSet("channel", channel).length())
     430    {
    407431        SetSIStandard(si_std);
     432        return true;
     433    }
    408434
    409     return ok;
     435    return false;
    410436}
    411437
    412438bool HDHRChannel::AddPID(uint pid, bool do_update)
  • libs/libmythtv/hdhrrecorder.cpp

     
    2727#include "hdhrrecorder.h"
    2828#include "atsctables.h"
    2929#include "atscstreamdata.h"
     30#include "dvbstreamdata.h"
    3031#include "eithelper.h"
    3132#include "tv_rec.h"
    3233
     
    176177        data->AddMPEGListener(this);
    177178
    178179        ATSCStreamData *atsc = dynamic_cast<ATSCStreamData*>(data);
     180        DVBStreamData  *dvb  = dynamic_cast<DVBStreamData*>(data);
    179181
    180182        if (atsc && atsc->DesiredMinorChannel())
    181183            atsc->SetDesiredChannel(atsc->DesiredMajorChannel(),
    182184                                    atsc->DesiredMinorChannel());
     185        else if (dvb)
     186            dvb->AddDVBMainListener(this);
    183187        else if (data->DesiredProgram() >= 0)
    184188            data->SetDesiredProgram(data->DesiredProgram());
    185189    }
  • libs/libmythtv/scanwizardhelpers.cpp

     
    394394        addSelection(tr("Import channels.conf"),
    395395                     QString::number(DVBUtilsImport));
    396396        break;
     397    case CardUtil::HDHOMERUN:
     398        addSelection(tr("Full Scan (ATSC)"),
     399                     QString::number(FullScan_ATSC), true);
     400        addSelection(tr("Full Scan (DVB)"),
     401                     QString::number(FullScan_OFDM), true);
     402        addSelection(tr("Full Scan (DVB, tuned)"),
     403                     QString::number(NITAddScan_OFDM));
    397404    case CardUtil::ATSC:
    398     case CardUtil::HDHOMERUN:
    399405        addSelection(tr("Full Scan"),
    400406                     QString::number(FullScan_ATSC), true);
    401407        addSelection(tr("Import channels.conf"),