Ticket #4631: 4631-v1.patch
File 4631-v1.patch, 10.1 KB (added by , 16 years ago) |
---|
-
libs/libmythtv/dbcheck.cpp
10 10 #include "mythdbcon.h" 11 11 #include "datadirect.h" // for DataDirectProcessor::FixProgramIDs 12 12 #include "dbutil.h" 13 #include "videodisplayprofile.h" // for "1214" 13 14 14 15 #define MINIMUM_DBMS_VERSION 5 15 16 16 17 /// This is the DB schema version expected by the running MythTV instance. 17 const QString currentDatabaseVersion = "121 3";18 const QString currentDatabaseVersion = "1214"; 18 19 19 20 static bool UpdateDBVersionNumber(const QString &newnumber); 20 21 static bool performActualUpdate(const QString updates[], QString version, … … 3579 3580 return false; 3580 3581 } 3581 3582 3583 if (dbver == "1213") 3584 { 3585 VERBOSE(VB_IMPORTANT, "In 1213 upg"); 3586 MSqlQuery query(MSqlQuery::InitCon()); 3587 query.prepare("SELECT hostname " 3588 "FROM displayprofilegroups " 3589 "GROUP BY hostname"); 3590 bool ok = query.exec(); 3591 while (ok && query.next()) 3592 { 3593 QString host = query.value(0).toString(); 3594 QStringList profiles = VideoDisplayProfile::GetProfiles(host); 3595 if (profiles.contains("High Quality") && 3596 profiles.contains("Normal") && 3597 profiles.contains("Slim")) 3598 { 3599 continue; 3600 } 3601 3602 VideoDisplayProfile::CreateNewProfiles(host); 3603 profiles = VideoDisplayProfile::GetProfiles(host); 3604 QString profile = VideoDisplayProfile::GetDefaultProfileName(host); 3605 3606 VERBOSE(VB_IMPORTANT, QString("In 1213 upg(%1): p %2") 3607 .arg(host).arg(profile)); 3608 3609 if (profiles.contains("Normal") && 3610 (profile=="CPU++" || profile=="CPU+" || profile=="CPU--")) 3611 { 3612 VideoDisplayProfile::SetDefaultProfileName("Normal", host); 3613 } 3614 } 3615 3616 const QString updates[] = { "" }; 3617 if (!performActualUpdate(updates, "1214", dbver)) 3618 return false; 3619 } 3620 3621 3582 3622 //"ALTER TABLE cardinput DROP COLUMN preference;" in 0.22 3583 3623 //"ALTER TABLE channel DROP COLUMN atscsrcid;" in 0.22 3584 3624 //"ALTER TABLE recordedmarkup DROP COLUMN offset;" in 0.22 -
libs/libmythtv/videodisplayprofile.h
131 131 132 132 static void DeleteProfiles(const QString &hostname); 133 133 static void CreateProfiles(const QString &hostname); 134 static void CreateOldProfiles(const QString &hostname); 135 static void CreateNewProfiles(const QString &hostname); 134 136 135 137 static QStringList GetVideoRenderers(const QString &decoder); 136 138 static QString GetVideoRendererHelp(const QString &renderer); -
libs/libmythtv/videodisplayprofile.cpp
902 902 bool VideoDisplayProfile::DeleteProfileGroup( 903 903 const QString &groupname, const QString &hostname) 904 904 { 905 bool ok = true; 905 906 MSqlQuery query(MSqlQuery::InitCon()); 907 MSqlQuery query2(MSqlQuery::InitCon()); 908 906 909 query.prepare( 910 "SELECT profilegroupid " 911 "FROM displayprofilegroups " 912 "WHERE name = :NAME AND " 913 " hostname = :HOST "); 914 915 query.bindValue(":NAME", groupname); 916 query.bindValue(":HOST", hostname); 917 918 if (!query.exec() || !query.isActive()) 919 { 920 MythContext::DBError("delete_profile_group 1", query); 921 ok = false; 922 } 923 else 924 { 925 while (query.next()) 926 { 927 query2.prepare("DELETE FROM displayprofiles " 928 "WHERE profilegroupid = :PROFID"); 929 query2.bindValue(":PROFID", query.value(0).toUInt()); 930 if (!query2.exec()) 931 { 932 MythContext::DBError("delete_profile_group 2", query2); 933 ok = false; 934 } 935 } 936 } 937 938 query.prepare( 907 939 "DELETE FROM displayprofilegroups " 908 940 "WHERE name = :NAME AND " 909 941 " hostname = :HOST"); … … 913 945 914 946 if (!query.exec()) 915 947 { 916 MythContext::DBError("delete_profile_group ", query);917 returnfalse;948 MythContext::DBError("delete_profile_group 3", query); 949 ok = false; 918 950 } 919 951 920 return true;952 return ok; 921 953 } 922 954 923 void VideoDisplayProfile::Create Profiles(const QString &hostname)955 void VideoDisplayProfile::CreateOldProfiles(const QString &hostname) 924 956 { 925 DeleteProfiles(hostname);926 957 (void) QObject::tr("CPU++", "Sample: No hardware assist"); 958 DeleteProfileGroup("CPU++", hostname); 927 959 uint groupid = CreateProfileGroup("CPU++", hostname); 928 960 CreateProfile(groupid, 1, ">", 0, 0, "", 0, 0, 929 961 "ffmpeg", 1, "xv-blit", "softblend", true, … … 932 964 "ffmpeg", 1, "quartz-blit", "softblend", true, 933 965 "linearblend", "linearblend", ""); 934 966 967 (void) QObject::tr("CPU+", "Sample: Hardware assist HD only"); 968 DeleteProfileGroup("CPU+", hostname); 935 969 groupid = CreateProfileGroup("CPU+", hostname); 936 970 CreateProfile(groupid, 1, "<=", 720, 576, ">", 0, 0, 937 971 "ffmpeg", 1, "xv-blit", "softblend", true, … … 949 983 "libmpeg2", 1, "xv-blit", "chromakey", false, 950 984 "bobdeint", "onefield", ""); 951 985 986 (void) QObject::tr("CPU--", "Sample: Hardware assist all"); 987 DeleteProfileGroup("CPU--", hostname); 952 988 groupid = CreateProfileGroup("CPU--", hostname); 953 989 CreateProfile(groupid, 1, "<=", 720, 576, ">", 0, 0, 954 990 "ivtv", 1, "ivtv", "ivtv", true, … … 967 1003 "none", "none", ""); 968 1004 } 969 1005 1006 void VideoDisplayProfile::CreateNewProfiles(const QString &hostname) 1007 { 1008 (void) QObject::tr("High Quality", "Sample: high quality"); 1009 DeleteProfileGroup("High Quality", hostname); 1010 uint groupid = CreateProfileGroup("High Quality", hostname); 1011 CreateProfile(groupid, 1, ">=", 1920, 1080, "", 0, 0, 1012 "ffmpeg", 2, "xv-blit", "softblend", true, 1013 "linearblend", "linearblend", ""); 1014 CreateProfile(groupid, 2, ">", 0, 0, "", 0, 0, 1015 "ffmpeg", 1, "xv-blit", "softblend", true, 1016 "yadifdoubleprocessdeint", "yadifdeint", ""); 1017 CreateProfile(groupid, 3, ">=", 1920, 1080, "", 0, 0, 1018 "ffmpeg", 2, "quartz-blit", "softblend", true, 1019 "linearblend", "linearblend", ""); 1020 CreateProfile(groupid, 4, ">", 0, 0, "", 0, 0, 1021 "ffmpeg", 1, "quartz-blit", "softblend", true, 1022 "yadifdoubleprocessdeint", "yadifdeint", ""); 1023 1024 (void) QObject::tr("Normal", "Sample: average quality"); 1025 DeleteProfileGroup("Normal", hostname); 1026 groupid = CreateProfileGroup("Normal", hostname); 1027 CreateProfile(groupid, 1, ">=", 1280, 720, "", 0, 0, 1028 "ffmpeg", 1, "xv-blit", "softblend", false, 1029 "linearblend", "linearblend", ""); 1030 CreateProfile(groupid, 2, ">", 0, 0, "", 0, 0, 1031 "ffmpeg", 1, "xv-blit", "softblend", true, 1032 "greedyhdoubleprocessdeint", "kerneldeint", ""); 1033 CreateProfile(groupid, 3, ">=", 1280, 720, "", 0, 0, 1034 "ffmpeg", 1, "quartz-blit", "softblend", false, 1035 "linearblend", "linearblend", ""); 1036 CreateProfile(groupid, 4, ">", 0, 0, "", 0, 0, 1037 "ffmpeg", 1, "quartz-blit", "softblend", true, 1038 "greedyhdoubleprocessdeint", "kerneldeint", ""); 1039 1040 (void) QObject::tr("Normal", "Sample: low CPU usage"); 1041 DeleteProfileGroup("Slim", hostname); 1042 groupid = CreateProfileGroup("Slim", hostname); 1043 CreateProfile(groupid, 1, ">=", 1280, 720, "", 0, 0, 1044 "ffmpeg", 1, "xv-blit", "softblend", false, 1045 "onefield", "onefield", ""); 1046 CreateProfile(groupid, 2, ">", 0, 0, "", 0, 0, 1047 "ffmpeg", 1, "xv-blit", "softblend", true, 1048 "linearblend", "linearblend", ""); 1049 CreateProfile(groupid, 3, ">=", 1280, 720, "", 0, 0, 1050 "ffmpeg", 1, "quartz-blit", "softblend", false, 1051 "onefield", "onefield", ""); 1052 CreateProfile(groupid, 4, ">", 0, 0, "", 0, 0, 1053 "ffmpeg", 1, "quartz-blit", "softblend", true, 1054 "linearblend", "linearblend", ""); 1055 } 1056 1057 void VideoDisplayProfile::CreateProfiles(const QString &hostname) 1058 { 1059 CreateOldProfiles(hostname); 1060 CreateNewProfiles(hostname); 1061 } 1062 970 1063 QStringList VideoDisplayProfile::GetVideoRenderers(const QString &decoder) 971 1064 { 972 1065 QMutexLocker locker(&safe_lock); -
programs/mythfrontend/globalsettings.cpp
1361 1361 if (profiles.empty()) 1362 1362 return; 1363 1363 1364 if (!profiles.contains("Normal") && 1365 !profiles.contains("High Quality") && 1366 !profiles.contains("Slim")) 1367 { 1368 VideoDisplayProfile::CreateNewProfiles(host); 1369 profiles = VideoDisplayProfile::GetProfiles(host); 1370 } 1371 1364 1372 QString profile = VideoDisplayProfile::GetDefaultProfileName(host); 1365 1373 if (!profiles.contains(profile)) 1366 1374 { 1367 profile = profiles[0];1375 profile = (profiles.contains("Normal")) ? "Normal" : profiles[0]; 1368 1376 VideoDisplayProfile::SetDefaultProfileName(profile, host); 1369 1377 } 1370 1378 … … 1372 1380 grouptrigger->setLabel(QObject::tr("Current Video Playback Profile")); 1373 1381 QStringList::const_iterator it; 1374 1382 for (it = profiles.begin(); it != profiles.end(); it++) 1375 grouptrigger->addSelection( *it);1383 grouptrigger->addSelection(QObject::tr(*it), *it); 1376 1384 1377 1385 HorizontalConfigurationGroup *grp = 1378 1386 new HorizontalConfigurationGroup(false, false, true, true);