Esempio n. 1
0
bool VAAPIContext::CreateDisplay(QSize size, bool noreuse)
{
    m_size = size;
    if (!m_copy)
    {
        m_copy = new MythUSWCCopy(m_size.width());
    }
    else
    {
        m_copy->reset(m_size.width());
    }

    bool ok = true;
    m_display = VAAPIDisplay::GetDisplay(m_dispType, noreuse);
    CREATE_CHECK(!m_size.isEmpty(), "Invalid size");
    CREATE_CHECK(m_display != NULL, "Invalid display");
    CREATE_CHECK(InitDisplay(),     "Invalid VADisplay");
    CREATE_CHECK(InitProfiles(),    "No supported profiles");
    if (ok)
        LOG(VB_PLAYBACK, LOG_INFO, LOC +
            QString("Created context (%1x%2->%3x%4)")
            .arg(size.width()).arg(size.height())
            .arg(m_size.width()).arg(m_size.height()));
    // ATI hue adjustment
    if (m_display)
        m_hueBase = VideoOutput::CalcHueBase(m_display->GetDriver());

    return ok;
}
Esempio n. 2
0
//=======================================================================================================================================
// Delete a profile
void hedPlayerProfileManager::DeleteProfile(int index)
{
    hedString filePath;
    int       i;
    FILE*     file;

    sysLogPrintDebug("hedPlayerProfileManager::DeleteProfile(%d) - Deleting (%s)", index, m_ProfileList[index].name);
    if(index < 0 || index > m_ProfileCount - 1) return;

    sprintf(filePath,"%s.profile",m_ProfileList[index].name);
    remove(sysGetAppDataPath(filePath));

    for(i = index; i < m_ProfileCount - 1; i++)
        m_ProfileList[i] = m_ProfileList[i + 1];
    m_ProfileCount--;

    // Save profile list
    file = fopen(sysGetAppDataPath("profiles"),"wt");
    fprintf(file,"%d\n",m_ProfileCount);
    for(i = 0; i < m_ProfileCount; i++)
        fprintf(file,"%s\n",m_ProfileList[i].name);
    fclose(file);

    InitProfiles();
}