Ticket #6032: HDicons.codechanges.noPBB.diff

File HDicons.codechanges.noPBB.diff, 6.1 KB (added by robert.mcnamara@…, 15 years ago)

Code changes without touching PBB

  • libs/libmythtv/dbcheck.cpp

     
    1818#define MINIMUM_DBMS_VERSION 5,0,15
    1919
    2020/// This is the DB schema version expected by the running MythTV instance.
    21 const QString currentDatabaseVersion = "1228";
     21const QString currentDatabaseVersion = "1229";
    2222
    2323static bool UpdateDBVersionNumber(const QString &newnumber);
    2424static bool performActualUpdate(
     
    43964396            return false;
    43974397    }
    43984398
     4399    if (dbver == "1228")
     4400    {
     4401        const char *updates[] = {
     4402"ALTER TABLE recordedprogram CHANGE COLUMN videoprop videoprop "
     4403"    SET('HDTV', 'WIDESCREEN', 'AVC', '720', '1080') NOT NULL; ",
     4404NULL
     4405};
     4406         
     4407        if (!performActualUpdate(updates, "1229", dbver))
     4408            return false;
     4409    } 
     4410
    43994411    return true;
    44004412}
    44014413
  • libs/libmythtv/programinfo.h

     
    9595    VID_HDTV          = 0x01,
    9696    VID_WIDESCREEN    = 0x02,
    9797    VID_AVC           = 0x04,
     98    VID_720           = 0x08,
     99    VID_1080          = 0x10,
    98100};
    99101
    100102// if SubtitleTypes changes, the audioprop column in program and
     
    316318    void SetAspectChange(MarkTypes type, long long frame,
    317319                         uint customAspect);
    318320
    319     // Resolution Set
     321    // Resolution Set/Get
    320322    void SetResolution(uint width, uint height, long long frame);
     323    int GetHeight(void);
     324    void SetVidpropHeight(int height);
    321325
    322326    // GUI stuff
    323327    void showDetails(void) const;
     
    354358    QString chanstr;
    355359    QString chansign;
    356360    QString channame;
     361    uint tall;
    357362
    358 
    359363    int recpriority;
    360364    QString recgroup;
    361365    QString playgroup;
  • libs/libmythtv/tv_rec.cpp

     
    10831083    int filelen = -1;
    10841084    pauseNotify = false;
    10851085    ispip = false;
     1086    int recHeight;
    10861087
    10871088    if (recorder && HasFlags(kFlagRecorderRunning))
    10881089    {
     
    10901091        // may not be constant if using a DTV based recorder.
    10911092        filelen = (int)((float)GetFramesWritten() / GetFramerate());
    10921093
     1094        // Get the height and set the videoprops
     1095        recHeight = curRecording->GetHeight();
     1096        curRecording->SetVidpropHeight(recHeight);
     1097
    10931098        QString message = QString("DONE_RECORDING %1 %2")
    10941099            .arg(cardid).arg(filelen);
    10951100        MythEvent me(message);
  • libs/libmythtv/programinfo.cpp

     
    30263026        MythDB::DBError("Resolution insert", query);
    30273027}
    30283028
     3029/** \fn ProgramInfo::GetHeight(void)
     3030 *  \brief Gets overall average height.
     3031 */
     3032int ProgramInfo::GetHeight(void)
     3033{
     3034    MSqlQuery query(MSqlQuery::InitCon());
     3035
     3036    query.prepare("SELECT recordedmarkup.DATA FROM recordedmarkup"
     3037                  " WHERE recordedmarkup.chanid = :CHANID"
     3038                  " AND recordedmarkup.starttime = :STARTTIME"
     3039                  " AND recordedmarkup.type = 31"
     3040                  " GROUP BY recordedmarkup.data ORDER BY"
     3041                  " SUM((SELECT IFNULL(rm.mark, recordedmarkup.mark)"
     3042                  " FROM recordedmarkup AS rm WHERE rm.chanid = recordedmarkup.chanid"
     3043                  " AND rm.starttime = recordedmarkup.starttime AND"
     3044                  " rm.type = recordedmarkup.type AND"
     3045                  " rm.mark > recordedmarkup.mark"
     3046                  " ORDER BY rm.mark ASC LIMIT 1)"
     3047                  " - recordedmarkup.mark) DESC LIMIT 1;");
     3048    query.bindValue(":CHANID", chanid);
     3049    query.bindValue(":STARTTIME", recstartts);
     3050
     3051    if (query.exec() && query.isActive() && query.size() > 0)
     3052    {
     3053        query.next();
     3054        tall = query.value(0).toInt();
     3055    }
     3056    else
     3057        tall = 0;
     3058
     3059    return tall;
     3060}
     3061
     3062/** \fn ProgramInfo::SetVidpropHeight(int height)
     3063 *  \brief Sets overall average height flag in videoprops.
     3064 */
     3065void ProgramInfo::SetVidpropHeight(int height)
     3066{
     3067
     3068    MSqlQuery query(MSqlQuery::InitCon());
     3069
     3070    query.prepare("UPDATE recordedprogram SET videoprop ="
     3071    " CONCAT_WS(',', IF(videoprop = '', NULL, videoprop), :VALUE)"
     3072    " WHERE chanid = :CHANID AND starttime = :STARTTIME;");
     3073
     3074    if (height > 700 && height < 800)
     3075    {
     3076        VERBOSE(VB_IMPORTANT, QString("Recording designated 720p because height was %1").arg(height));
     3077        videoproperties |= VID_720;
     3078
     3079        query.bindValue(":VALUE", "720");
     3080        query.bindValue(":CHANID", chanid);
     3081        query.bindValue(":STARTTIME", startts);
     3082
     3083        query.exec();
     3084        if (!query.isActive())
     3085        MythDB::DBError("UpdateRes", query);
     3086
     3087    }
     3088    else if (height > 1000 && height < 1100)
     3089    {
     3090        VERBOSE(VB_IMPORTANT, QString("Recording designated 1080i/p because height was %1").arg(height));
     3091        videoproperties |= VID_1080;
     3092
     3093        query.bindValue(":VALUE", "1080");
     3094        query.bindValue(":CHANID", chanid);
     3095        query.bindValue(":STARTTIME", startts);
     3096
     3097        query.exec();
     3098        if (!query.isActive())
     3099        MythDB::DBError("UpdateRes", query);
     3100    }
     3101    else
     3102    {
     3103        VERBOSE(VB_IMPORTANT, QString("Unknown type, recording height was %1").arg(height));
     3104        return;
     3105    }
     3106}
     3107
    30293108/** \fn ProgramInfo::ReactivateRecording(void)
    30303109 *  \brief Asks the scheduler to restart this recording if possible.
    30313110 */
     
    38533932        attr += QObject::tr("Widescreen") + ", ";
    38543933    if  (videoprop & VID_AVC)
    38553934        attr += QObject::tr("AVC/H.264") + ", ";
     3935    if  (videoprop & VID_720)
     3936        attr += QObject::tr("720p Resolution") + ", ";
     3937    if  (videoprop & VID_1080)
     3938        attr += QObject::tr("1080i/p Resolution") + ", ";
    38563939
    38573940    if (subtype & SUB_HARDHEAR)
    38583941        attr += QObject::tr("CC","Closed Captioned") + ", ";