Skip to content

Commit

Permalink
Update playback profiles after recent changes.
Browse files Browse the repository at this point in the history
WARNING: Changes DB Schema version, so DB schema version is no longer
compatible with 0.24-fixes.

Removes CPU++, CPU+, and CPU-- playback profile groups.  These groups were
unnecessary after the removal of XvMC, libmpeg2, and PVR-350 decoding/
rendering.  Systems set to use any of these profiles groups are changed
to use the default group, Normal.

Changes users' custom profiles to replace XvMC and libmpeg2 decoders with
standard (ffmpeg) and XvMC video renderer with Xv (xv-blit) and ia44blend
OSD renderer with softblend.

Updates the VideoDisplayProfile::GetDefaultProfileName() to use Normal,
instead of CPU+.  This also fixes the issue where new systems incorrectly
used CPU+ by default.

Create example VDPAU profile groups when creating initial profile groups
(rather than 2 steps later).
  • Loading branch information
sphery committed Dec 9, 2010
1 parent 2ec3a29 commit 4cd8186
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
21 changes: 20 additions & 1 deletion mythtv/libs/libmythtv/dbcheck.cpp
Expand Up @@ -20,7 +20,7 @@ using namespace std;
mythtv/bindings/perl/MythTV.pm
*/
/// This is the DB schema version expected by the running MythTV instance.
const QString currentDatabaseVersion = "1264";
const QString currentDatabaseVersion = "1265";

static bool UpdateDBVersionNumber(const QString &newnumber, QString &dbver);
static bool performActualUpdate(
Expand Down Expand Up @@ -5502,6 +5502,25 @@ NULL
return false;
}

if (dbver == "1264")
{
const char *updates[] = {
"DELETE FROM displayprofiles WHERE profilegroupid IN "
" (SELECT profilegroupid FROM displayprofilegroups "
" WHERE name IN ('CPU++', 'CPU+', 'CPU--'))",
"DELETE FROM displayprofilegroups WHERE name IN ('CPU++', 'CPU+', 'CPU--')",
"DELETE FROM settings WHERE value = 'DefaultVideoPlaybackProfile' "
" AND data IN ('CPU++', 'CPU+', 'CPU--')",
"UPDATE displayprofiles SET data = 'ffmpeg' WHERE data = 'libmpeg2'",
"UPDATE displayprofiles SET data = 'ffmpeg' WHERE data = 'xvmc'",
"UPDATE displayprofiles SET data = 'xv-blit' WHERE data = 'xvmc-blit'",
"UPDATE displayprofiles SET data = 'softblend' WHERE data = 'ia44blend'",
NULL
};
if (!performActualUpdate(updates, "1265", dbver))
return false;
}

return true;
}

Expand Down
22 changes: 3 additions & 19 deletions mythtv/libs/libmythtv/videodisplayprofile.cpp
Expand Up @@ -761,14 +761,14 @@ QString VideoDisplayProfile::GetDefaultProfileName(const QString &hostname)

QStringList profiles = GetProfiles(hostname);

tmp = (profiles.contains(tmp)) ? tmp : QString::null;
tmp = (profiles.contains(tmp)) ? tmp : QString();

if (tmp.isEmpty())
{
if (profiles.size())
tmp = profiles[0];

tmp = (profiles.contains("CPU+")) ? "CPU+" : tmp;
tmp = (profiles.contains("Normal")) ? "Normal" : tmp;

if (!tmp.isEmpty())
{
Expand Down Expand Up @@ -998,22 +998,6 @@ bool VideoDisplayProfile::DeleteProfileGroup(
return ok;
}

void VideoDisplayProfile::CreateOldProfiles(const QString &hostname)
{
(void) QObject::tr("CPU++", "Sample: No hardware assist");
DeleteProfileGroup("CPU++", hostname);
uint groupid = CreateProfileGroup("CPU++", hostname);
CreateProfile(groupid, 1, ">", 0, 0, "", 0, 0,
"ffmpeg", 1, true, "xv-blit", "softblend", true,
"bobdeint", "linearblend", "");
CreateProfile(groupid, 2, ">", 0, 0, "", 0, 0,
"ffmpeg", 1, true, "quartz-blit", "softblend", true,
"linearblend", "linearblend", "");

DeleteProfileGroup("CPU+", hostname);
DeleteProfileGroup("CPU--", hostname);
}

void VideoDisplayProfile::CreateNewProfiles(const QString &hostname)
{
(void) QObject::tr("High Quality", "Sample: high quality");
Expand Down Expand Up @@ -1098,8 +1082,8 @@ void VideoDisplayProfile::CreateVDPAUProfiles(const QString &hostname)

void VideoDisplayProfile::CreateProfiles(const QString &hostname)
{
CreateOldProfiles(hostname);
CreateNewProfiles(hostname);
CreateVDPAUProfiles(hostname);
}

QStringList VideoDisplayProfile::GetVideoRenderers(const QString &decoder)
Expand Down
1 change: 0 additions & 1 deletion mythtv/libs/libmythtv/videodisplayprofile.h
Expand Up @@ -146,7 +146,6 @@ class MPUBLIC VideoDisplayProfile

static void DeleteProfiles(const QString &hostname);
static void CreateProfiles(const QString &hostname);
static void CreateOldProfiles(const QString &hostname);
static void CreateNewProfiles(const QString &hostname);
static void CreateVDPAUProfiles(const QString &hostname);

Expand Down

0 comments on commit 4cd8186

Please sign in to comment.