Ticket #6032: resflagging.diff

File resflagging.diff, 5.1 KB (added by robert.mcnamara@…, 15 years ago)

Updated against trunk

  • libs/libmythtv/programinfo.h

     
    321321
    322322    // Resolution Set/Get
    323323    void SetResolution(uint width, uint height, long long frame);
     324    int GetWidth(void);
    324325    int GetHeight(void);
    325     void SetVidpropHeight(int height);
     326    void SetVidpropHeight(int width);
    326327
    327328    // GUI stuff
    328329    void showDetails(void) const;
     
    359360    QString chanstr;
    360361    QString chansign;
    361362    QString channame;
     363    uint m_videoWidth;
    362364    uint m_videoHeight;
    363365
    364366    int recpriority;
  • libs/libmythtv/programinfo.cpp

     
    160160
    161161    record = NULL;
    162162
     163    m_videoWidth = 0;
    163164    m_videoHeight = 0;
    164165}
    165166
     
    265266    lastInUseTime = other.lastInUseTime;
    266267    record = NULL;
    267268
     269    m_videoWidth = other.m_videoWidth;
    268270    m_videoHeight = other.m_videoHeight;
    269271
    270272    positionMapDBReplacement = other.positionMapDBReplacement;
     
    30993101    return m_videoHeight;
    31003102}
    31013103
    3102 /** \fn ProgramInfo::SetVidpropHeight(int height)
     3104/** \fn ProgramInfo::GetWidth(void)
     3105 *  \brief Gets overall average width.
     3106 */
     3107int ProgramInfo::GetWidth(void)
     3108{
     3109    MSqlQuery query(MSqlQuery::InitCon());
     3110 
     3111    query.prepare("SELECT recordedmarkup.DATA FROM recordedmarkup"
     3112                  " WHERE recordedmarkup.chanid = :CHANID"
     3113                  " AND recordedmarkup.starttime = :STARTTIME"
     3114                  " AND recordedmarkup.type = 30"
     3115                  " GROUP BY recordedmarkup.data ORDER BY"
     3116                  " SUM((SELECT IFNULL(rm.mark, recordedmarkup.mark)"
     3117                  " FROM recordedmarkup AS rm WHERE rm.chanid = recordedmarkup.chanid"
     3118                  " AND rm.starttime = recordedmarkup.starttime AND"
     3119                  " rm.type = recordedmarkup.type AND"
     3120                  " rm.mark > recordedmarkup.mark"
     3121                  " ORDER BY rm.mark ASC LIMIT 1)"
     3122                  " - recordedmarkup.mark) DESC LIMIT 1;");
     3123    query.bindValue(":CHANID", chanid);
     3124    query.bindValue(":STARTTIME", recstartts);
     3125 
     3126    if (query.exec() && query.next())
     3127    {
     3128        m_videoWidth = query.value(0).toInt();
     3129    }
     3130    else
     3131        m_videoWidth = 0;
     3132
     3133    return m_videoWidth;
     3134}
     3135
     3136/** \fn ProgramInfo::SetVidpropHeight(int width)
    31033137 *  \brief Sets overall average height flag in videoprops.
    31043138 */
    3105 void ProgramInfo::SetVidpropHeight(int height)
     3139void ProgramInfo::SetVidpropHeight(int width)
    31063140{
    31073141    MSqlQuery query(MSqlQuery::InitCon());
    31083142
     
    31103144    " CONCAT_WS(',', IF(videoprop = '', NULL, videoprop), :VALUE)"
    31113145    " WHERE chanid = :CHANID AND starttime = :STARTTIME;");
    31123146
    3113     if (height > 700 && height < 800)
     3147    if (width > 1300)
    31143148    {
    3115         VERBOSE(VB_IMPORTANT, QString("Recording designated 720p because height was %1").arg(height));
    3116         videoproperties |= VID_720;
     3149        VERBOSE(VB_IMPORTANT, QString("Recording designated 1080i/p because width was %1").arg(width));
     3150        videoproperties |= VID_1080;
    31173151
    3118         query.bindValue(":VALUE", "720");
     3152        query.bindValue(":VALUE", "1080");
    31193153        query.bindValue(":CHANID", chanid);
    31203154        query.bindValue(":STARTTIME", startts);
    31213155
    31223156        if (!query.exec())
    31233157            MythDB::DBError("UpdateRes", query);
    3124 
    31253158    }
    3126     else if (height > 1000 && height < 1100)
     3159    else if (width > 800)
    31273160    {
    3128         VERBOSE(VB_IMPORTANT, QString("Recording designated 1080i/p because height was %1").arg(height));
    3129         videoproperties |= VID_1080;
     3161        VERBOSE(VB_IMPORTANT, QString("Recording designated 720p because width was %1").arg(width));
     3162        videoproperties |= VID_720;
    31303163
    3131         query.bindValue(":VALUE", "1080");
     3164        query.bindValue(":VALUE", "720");
    31323165        query.bindValue(":CHANID", chanid);
    31333166        query.bindValue(":STARTTIME", startts);
    31343167
     
    31373170    }
    31383171    else
    31393172    {
    3140         VERBOSE(VB_IMPORTANT, QString("Unknown type, recording height was %1").arg(height));
     3173        VERBOSE(VB_IMPORTANT, QString("Unknown type, recording width was %1").arg(width));
    31413174        return;
    31423175    }
    31433176
    3144     m_videoHeight = height;
     3177    m_videoWidth = width;
    31453178}
    31463179
    31473180
  • libs/libmythtv/tv_rec.cpp

     
    10861086{
    10871087    pauseNotify = false;
    10881088    ispip = false;
    1089     int recHeight;
     1089    int recWidth;
    10901090
    10911091    if (recorder && HasFlags(kFlagRecorderRunning))
    10921092    {
    1093         // Get the height and set the videoprops
    1094         recHeight = curRecording->GetHeight();
    1095         curRecording->SetVidpropHeight(recHeight);
     1093        // Get the width and set the videoprops
     1094        recWidth = curRecording->GetWidth();
     1095        curRecording->SetVidpropHeight(recWidth);
    10961096
    10971097        int secsSince = curRecording->recstartts
    10981098            .secsTo(QDateTime::currentDateTime());